-
2. Re: Unable to obtain object reference in separate JVM
greno Apr 29, 2002 12:40 PM (in response to greno)Adrian, thanks.
This got us a little further but not quite there.
We started Tomcat with the -nonaming option and then encountered the following exception:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
We searched on NoInitialContextException and found this:
http://main.jboss.org/forums/thread.jsp?forum=50&thread=7943&message=830698&q=nonaming#830698
So we copied all of these jars into CATALINA_HOME/lib and
added java.naming.provider.url=localhost:1099 to jndi.properties but we still are getting the NoInitialContextException. Now nothing seems to make this go away now.
Also here is a jndi listing:
java:comp namespace of the Bonus bean:
+- env (class: org.jnp.interfaces.NamingContext)
| +- jdbc (class: org.jnp.interfaces.NamingContext)
| | +- Bonus[link -> java:/BonusDS] (class: javax.naming.LinkRef)
java:comp namespace of the Calc bean:
+- env (class: org.jnp.interfaces.NamingContext)
java: Namespace
+- jaas (class: javax.naming.Context)
+- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
+- JmsXA (class: org.jboss.jms.ra.JmsConnectionFactoryImpl)
+- MinervaSharedLocalCMFactory (class: org.jboss.pool.connector.jboss.MinervaSharedLocalCMFactory)
+- BonusDS (class: org.jboss.pool.jdbc.xa.XAPoolDataSource)
+- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
+- MinervaXACMFactory (class: org.jboss.pool.connector.jboss.MinervaXACMFactory)
+- TransactionManager (class: org.jboss.tm.TxManager)
+- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
+- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
+- DefaultJMSProvider (class: org.jboss.jms.jndi.JBossMQProvider)
+- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
+- Mail (class: javax.mail.Session)
+- MinervaDS (class: org.jboss.pool.connector.jdbc.JDBCDataSource)
+- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
+- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
+- comp (class: javax.naming.Context)
+- MinervaNoTransCMFactory (class: org.jboss.pool.connector.jboss.MinervaNoTransCMFactory)
Global JNDI Namespace
+- TopicConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
+- jmx (class: org.jboss.jmx.server.JMXAdaptorImpl)
+- bonus (proxy: $Proxy2 implements Beans.BonusHome (no security manager: RMI class loader disabled))
+- Calc (proxy: $Proxy3 implements Beans.CalcHome (no security manager: RMI class loader disabled))
+- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
+- UserTransactionSessionFactory (class: org.jboss.tm.usertx.server.UserTransactionSessionFactoryImpl)
+- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
+- invokers (class: org.jnp.interfaces.NamingContext)
| +- Calc (class: org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker)
| +- bonus (class: org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker)
+- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
+- UILXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
+- RMIXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
+- queue (class: org.jnp.interfaces.NamingContext)
| +- D (class: org.jboss.mq.SpyQueue)
| +- C (class: org.jboss.mq.SpyQueue)
| +- B (class: org.jboss.mq.SpyQueue)
| +- A (class: org.jboss.mq.SpyQueue)
| +- controlQueue (class: org.jboss.mq.SpyQueue)
| +- testQueue (class: org.jboss.mq.SpyQueue)
| +- ex (class: org.jboss.mq.SpyQueue)
| +- DLQ (class: org.jboss.mq.SpyQueue)
| +- F (class: org.jboss.mq.SpyQueue)
| +- E (class: org.jboss.mq.SpyQueue)
+- topic (class: org.jnp.interfaces.NamingContext)
| +- example (class: org.jboss.mq.SpyTopic)
| +- testTopic (class: org.jboss.mq.SpyTopic)
| +- bob (class: org.jboss.mq.SpyTopic)
+- UILConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
+- servercollector (class: org.jboss.management.ServerDataCollector)
+- RMIConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
+- jmx:xxxxxxxxxxxx:rmi (class: org.jboss.jmx.server.RMIConnectorImpl)
+- QueueConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
What are we missing to get rid of the NoInitialContextException?
Also, I don't understand in jndi why the CalcHome is shown as Calc instead of calcs. I thought that the <jndi-name> element overrode the <ejb-name> element in the namespace. Also does the "RMI class loader disabled" have any bearing?
Thanks again. -
3. Re: Unable to obtain object reference in separate JVM
uglyhead69 Apr 29, 2002 4:27 PM (in response to greno)I think the solution is to change
java.naming.provider.url=localhost:1099
to java.naming.provider.url=hostRunningJBoss:1099 From the description you gave, your splitting web content and EJB content over two hosts. So the naming context factory in Tomcat needs to know the jndi server url. -
4. Re: Unable to obtain object reference in separate JVM
greno Apr 29, 2002 4:37 PM (in response to greno)That is the ultimate goal, but for testing we still have the two servers located on the same machine so localhost will work for now.