Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: EasyBeans 1.0 M6
-
Fix Version/s: EasyBeans 1.0 RC1
-
Component/s: None
-
Labels:None
-
Environment:Windows XP Pro, Tomcat 6.0.13, JDK 1.5.0_12
-
Global Rank:1848
Description
I get socket read timeout when starting EasyBeans embedded in Tomcat. Apparently it tries to connect to JRMP naming service.
IIOP is set as RMI. I have jacorb configured properly in my JDK (its libs in {JDK}/jre/lib/endorsed directory).
orb.properties:
org.omg.CORBA.ORBClass=org.jacorb.orb.ORB
org.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton
easybeans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<easybeans xmlns="http://org.objectweb.easybeans.server">
<!-- Define components that will be started at runtime -->
<components>
<!-- RMI/JRMP will be used as protocol layer -->
<rmi>
<protocol name="iiop" port="2000" hostname="localhost" />
</rmi>
<!-- Start a transaction service -->
<tm />
<!-- Start a JMS provider -->
<jms port="16030" hostname="localhost" />
<!-- Creates an embedded HSQLDB database -->
<hsqldb port="9001" dbName="jdbc_1">
<user name="easybeans" password="easybeans" />
</hsqldb>
<hsqldb port="9002" dbName="jdbc_2">
<user name="easybeans" password="easybeans" />
</hsqldb>
<!-- Creates a JDBC pool with jdbc_1 JNDI name -->
<jdbcpool jndiName="jdbc_1" username="easybeans"
password="easybeans"
url="jdbc:hsqldb:hsql://localhost:9001/jdbc_1"
driver="org.hsqldb.jdbcDriver" />
<!-- Creates a JDBC pool with jdbc_2 JNDI name -->
<jdbcpool jndiName="jdbc_2" username="easybeans"
password="easybeans"
url="jdbc:hsqldb:hsql://localhost:9002/jdbc_2"
driver="org.hsqldb.jdbcDriver" />
<!-- Start smartclient server with a link to the rmi component-->
<smart-server port="2503" rmi="#rmi" />
</components>
</easybeans>
Tomcat log:
2007-08-10 11:02:56 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native library 1.1.10.
2007-08-10 11:02:56 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].
2007-08-10 11:02:56 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
2007-08-10 11:02:56 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
2007-08-10 11:02:56 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 739 ms
2007-08-10 11:02:56 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
2007-08-10 11:02:56 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
10.08.07 11:02:57 (I) EasyBeansContextListener.contextInitialized : Detecting TOMCAT web container
10.08.07 11:02:57 (I) EasyBeansContextListener.contextInitialized : Add deploy directory 'D:\Programy\Java\Tomcat-6.0.13\easybeans-deploy'
10.08.07 11:02:57 (I) PolicyProvider.init : Using EasyBeans policy provider 'org.objectweb.easybeans.security.jacc.provider.JPolicy'.
10.08.07 11:02:57 (I) PolicyProvider.init : Using EasyBeans PolicyConfigurationFactory provider and EasyBeans Policy provider
10.08.07 11:02:57 (I) Embedded.configure : Using directories '[D:\Programy\Java\Tomcat-6.0.13\easybeans-deploy]' as deploy directories
10.08.07 11:03:08 (I) TraceCarol.infoCarol : Name service for iiop is started on port 2000
10.08.07 11:04:08 (S) StandardContext.listenerStart : Exception sending context initialized event to listener instance of class org.objectweb.easybeans.server.war.EasyBeansContextListener
java.lang.IllegalStateException: Cannot start embedded EasyBeans server
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextInitialized(EasyBeansContextListener.java:170)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.objectweb.easybeans.server.EmbeddedException: Cannot start components
at org.objectweb.easybeans.server.Embedded.start(Embedded.java:207)
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextInitialized(EasyBeansContextListener.java:168)
... 24 more
Caused by: org.objectweb.easybeans.component.api.EZBComponentException: Cannot bind transaction factory
at org.objectweb.easybeans.component.jotm.JOTMComponent.start(JOTMComponent.java:96)
at org.objectweb.easybeans.component.ComponentManager.startComponents(ComponentManager.java:199)
at org.objectweb.easybeans.server.Embedded.start(Embedded.java:205)
... 25 more
Caused by: javax.naming.NamingException: Cannot rebind object 'org.objectweb.jotm.TransactionFactoryImpl@d58939' with name 'TMFactory' :null [Root exception is javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out]]
at org.objectweb.carol.rmi.exception.NamingExceptionHelper.create(NamingExceptionHelper.java:50)
at org.objectweb.carol.jndi.spi.JacORBIIOPContext.rebind(JacORBIIOPContext.java:254)
at org.objectweb.carol.jndi.spi.AbsContext.rebind(AbsContext.java:198)
at javax.naming.InitialContext.rebind(InitialContext.java:367)
at org.objectweb.carol.jndi.spi.MultiContext.rebind(MultiContext.java:171)
at javax.naming.InitialContext.rebind(InitialContext.java:367)
at org.objectweb.easybeans.component.jotm.JOTMComponent.start(JOTMComponent.java:94)
... 27 more
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out]
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:138)
at javax.naming.InitialContext.rebind(InitialContext.java:371)
at org.objectweb.carol.jndi.spi.AbsContext.rebind(AbsContext.java:188)
at org.objectweb.carol.jndi.spi.JacORBIIOPContext.rebind(JacORBIIOPContext.java:251)
... 32 more
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:273)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.rebind(RegistryContext.java:136)
... 35 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at java.io.DataInputStream.readByte(DataInputStream.java:241)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:215)
... 39 more
10.08.07 11:04:08 (S) StandardContext.start : Error listenerStart
10.08.07 11:04:08 (S) StandardContext.start : Context [/ow_easybeans] startup failed due to previous errors
10.08.07 11:04:08 (I) EasyBeansContextListener.contextDestroyed : Stopping EasyBeans embedded server...
10.08.07 11:04:08 (S) StandardContext.listenerStop : Exception sending context destroyed event to listener instance of class org.objectweb.easybeans.server.war.EasyBeansContextListener
java.lang.IllegalStateException: Cannot stop the embedded server
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextDestroyed(EasyBeansContextListener.java:188)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3866)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4500)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4364)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.objectweb.easybeans.server.EmbeddedException: Cannot stop the server as it is not started.
at org.objectweb.easybeans.server.Embedded.stop(Embedded.java:327)
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextDestroyed(EasyBeansContextListener.java:186)
... 25 more
10.08.07 11:04:09 (I) ApplicationContext.log : ContextListener: contextInitialized()
10.08.07 11:04:09 (I) ApplicationContext.log : SessionListener: contextInitialized()
10.08.07 11:04:09 (I) Http11AprProtocol.start : Starting Coyote HTTP/1.1 on http-8080
10.08.07 11:04:09 (I) AjpAprProtocol.start : Starting Coyote AJP/1.3 on ajp-8009
10.08.07 11:04:09 (I) Catalina.start : Server startup in 72777 ms
Am i doing something wrong? Is JRMP naming service obligatory to start EasyBeans? When i put IIOP and JRMP settings in easybeans.xml I get another error:
easybeans.xml:
...
<rmi>
<protocol name="jrmp" port="1099" hostname="localhost" />
<protocol name="iiop" port="2000" hostname="localhost" />
</rmi>
...
10.08.07 11:13:53 (I) TraceCarol.infoCarol : Name service for iiop is started on port 2000
10.08.07 11:13:54 (I) TraceCarol.infoCarol : Name service for jrmp is started on port 1099
10.08.07 11:13:54 (S) StandardContext.listenerStart : Exception sending context initialized event to listener instance of class org.objectweb.easybeans.server.war.EasyBeansContextListener
java.lang.IllegalStateException: Cannot start embedded EasyBeans server
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextInitialized(EasyBeansContextListener.java:170)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.objectweb.easybeans.server.EmbeddedException: Cannot start components
at org.objectweb.easybeans.server.Embedded.start(Embedded.java:207)
at org.objectweb.easybeans.server.war.EasyBeansContextListener.contextInitialized(EasyBeansContextListener.java:168)
... 24 more
Caused by: org.objectweb.easybeans.component.api.EZBComponentException: Cannot create transaction factory
at org.objectweb.easybeans.component.jotm.JOTMComponent.start(JOTMComponent.java:89)
at org.objectweb.easybeans.component.ComponentManager.startComponents(ComponentManager.java:199)
at org.objectweb.easybeans.server.Embedded.start(Embedded.java:205)
... 25 more
Caused by: java.rmi.server.ExportException: object already exported
at sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:172)
at sun.rmi.transport.Transport.exportObject(Transport.java:75)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:196)
at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:180)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:220)
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.exportObject(PortableRemoteObject.java:103)
at org.objectweb.carol.rmi.multi.JacORBPRODelegate.exportObject(JacORBPRODelegate.java:82)
at org.objectweb.carol.rmi.multi.MultiPRODelegate.exportObject(MultiPRODelegate.java:90)
at javax.rmi.PortableRemoteObject.exportObject(PortableRemoteObject.java:87)
at javax.rmi.PortableRemoteObject.<init>(PortableRemoteObject.java:71)
at org.objectweb.jotm.TransactionFactoryImpl.<init>(TransactionFactoryImpl.java:65)
at org.objectweb.easybeans.component.jotm.JOTMComponent.start(JOTMComponent.java:87)
... 27 more
Hi Paweł,
EasyBeans is not providing iiop tie/stubs of JOTM.
You should add them to the existing libraries.
The iiop jar is provided in the following file : http://download.forge.objectweb.org/jotm/jotm-2.0.10.tgz
The name is jotm_iiop_stubs.jar
I didn't think that people will use IIOP in Tomcat/EasyBeans. This is why this jar is not included
Florent