Problem deploying IIOP beans
robkot Dec 26, 2004 9:58 AMVersion: JBoss 2.3.6
OS: SUSE Linux Pro 9.0
JDK 1.4.2
Hi,
for educational purposes, I've modified Interest example, without IIOP it works well. However, I'd like to use IIOP and access beans from C++ CORBA applications (preferably TAO). Following documentation, I added the following to my jboss.xml file:
<invoker-bindings>
<invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
</invoker-bindings>
Should it be placed in <enterprise-beans> section or in ? IIOP section of documentation (http://www.jboss.org/developers/projects/jboss/IIOP) says it should be in but then deployment fails:
20:18:39,044 INFO [EjbModule] Deploying Interest
20:18:39,144 INFO [StatelessSessionInstancePool] Registration is not done -> stop
20:18:39,285 ERROR [StatelessSessionContainer] Initialization failed jboss.j2ee:jndiName=interest/Interest,service=EJB
java.lang.NullPointerException
at org.jboss.iiop.rmi.ir.InterfaceRepository.addInterface(InterfaceRepository.java:896)
[...]
20:18:39,318 WARN [ServiceController] Problem creating service jboss.j2ee:jndiName=interest/Interest,service=EJB
RuntimeMBeanException: java.lang.NullPointerException
Cause: java.lang.NullPointerException
[...]
20:18:39,421 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
MBeans waiting for other MBeans:
ObjectName: jboss.j2ee:jndiName=interest/Interest,plugin=pool,service=EJB
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=interest/Interest,service=EJB
state: FAILED
I Depend On:
Depends On Me: RuntimeMBeanException: java.lang.NullPointerException
Cause: java.lang.NullPointerException
MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.j2ee:jndiName=interest/Interest,plugin=pool,service=EJB
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=interest/Interest,service=EJB
state: FAILED
I Depend On:
Depends On Me: RuntimeMBeanException: java.lang.NullPointerException
Cause: java.lang.NullPointerException
For the record: I compile everything by hand, calling javac and jar. Perhaps I'm misssing something ?
Someone on this forum suggests that <invoker-bindings> should be directly in <enterprise-beans>. I changed it, and then:
20:48:47,159 INFO [EjbModule] Deploying Interest
20:48:47,238 INFO [StatelessSessionInstancePool] Registration is not done -> stop
20:48:47,461 INFO [EJBDeployer] Deployed: file:/home/robert/java/jboss/ver326/tmp/jboss-3.2.6/server/all/deploy/Interest.jar
However, Naming Service seems to be empty when inspected using JacORB's nmg tool:
$ nmg -ORBInitRef NameService=corbaloc::1.2@localhost:3528/JBoss/Naming/root &
(localhost, 127.0.0.1 or real address, doesn't matter). The same for TAO's nslist.
Shouldn't home be registered during bean deployment ?
And, of course, client does not work. Using jndi.properties with:
java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
java.naming.provider.url=corbaloc::localhost:3528/JBoss/Naming/root
Running (EJB) client:
Got context
javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
The relevant code fragment is:
InitialContext jndiContext = new InitialContext();
System.out.println("Got context");
// Get a reference to the Interest Bean
Object ref = jndiContext.lookup("interest/Interest");
System.out.println("Got reference");
So it seems lookup fails - not surprisingly. I read posts on the forum and someone said that JBoss shoud print message indicating that home was registered in NS. I did an experinment: using nmg I created context "interest" and object "Interest" inside. using some IOR of the NS, just for testing. Then client correctly looked up and retrieved reference, but, obviously, failed on narrow.
My jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtds/ejb-jar_2_0.dtd">
<enterprise-beans>
<invoker-bindings>
<invoker-proxy-binding-name>iiop</invoker-proxy-binding-name>
</invoker-bindings>
<ejb-name>Interest</ejb-name>
<jndi-name>interest/Interest</jndi-name>
</enterprise-beans>
ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtds/ejb-jar_2_0.dtd">
<ejb-jar>
JBoss Interest Sample Application
<display-name>Interest EJB</display-name>
<enterprise-beans>
<ejb-name>Interest</ejb-name>
InterestHome
Interest
<ejb-class>InterestBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</enterprise-beans>
</ejb-jar>
Why is NS empty after deployment ? Do I make some obvious mistake ?
Thanks for any help,
Robert