I'm having trouble with using IIOP and JBoss 3.0.x. I've 
tried all the tricks I've been able to find on the JBoss 
website and on this newsgroup without success. Your help 
would be appreciated!

I've taken the standard template project and modified it 
slightly so that I can use it as the starting point for 
benchmarking the kind of operations we might use in future 
systems. The mods are:
        - add a couple of trivial methods to the 
          TestSessionBean
          
        - change the TestClient so that it invokes 
          those methods and so that it uses 
          PortableRemoteObject.narrow()
          
Those modifications work as expected when invoked from a 
servlet in the same JVM and from TestClient, *unless* I try
to use IIOP.

If I try to set TestSessionBean so that it uses IIOP, then
        - using the jmx-console/HtmlAdaptor shows the Global
          JNDI Namespace has a TestSession with the expected
          JNDI Name but it is of class javax.ejb.EJBHome
          
        - the TestClient has a ClassCastException during 
          the PortableRemoteObject.narrow( ref, TestSessionHome.class )
          
        - ref = jndiContext.lookup( TestSessionHome.JNDI_NAME ) is
          com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR:xx
          where xx is the hex digits shown on the server's log thus:
          [ejb/test/TestSession] EJBHome reference for ejb/test/TestSession:IOR:xx

        - eh = (javax.ejb.EJBHome) PortableRemoteObject.narrow(ref, 
javax.ejb.EJBHome.class)
          is also IOR:xx

Things I've tried based on the newsgroup and JBoss website:
        - jndi.properties changed to have "...url=IOR..."
          and "cosnaming.CNCtxFactory"
          
        - TestSessionBean has tag class tag
          @jboss:container-configuration name="IIOP Stateful SessionBean"
          
        - TestClient uses PortableRemoteObject.narrow()
        
        - using only the jacorb.jar in the JBoss distribution
        
        - server jacorb.properties unchanged after installation
        

More details below...

Thanks for you help

tom gardner

------------------------------------------------------------------------
TestSessionBean excerpts

/**
 * Session Bean Template
 *
 * ATTENTION: Some of the XDoclet tags are hidden from XDoclet by
 *            adding a "--" between @ and the namespace. Please remove
 *            this "--" to make it active or add a space to make an
 *            active tag inactive.
 *
 * @ejb:bean name="test/TestSession"
 *           display-name="Bug TestSession Bean"
 *           type="Stateful"
 *           transaction-type="Container"
 *           jndi-name="ejb/test/TestSession"
 *
 * @ejb:ejb-ref ejb-name="test/TestEntity"
 *              ref-name="mytest/TestEntity"
 * 
 * @jboss:container-configuration name="IIOP Stateful SessionBean"
 *
 * @--ejb:resource-ref res-name="test/Mail"
 *                   res-type="javax.mail.Session"
 *                   res-auth="Container"
 *
 * @--jboss:resource-manager res-man-class="javax.mail.Session"
 *                         res-man-name="test/Mail"
 *                         res-man-jndi-name="java:Mail"
 **/
public class TestSessionBean
   implements SessionBean {

   /**
   * @ejb:interface-method view-type="remote"
   **/
   public void doNothing() throws RemoteException {
   }
   ....
------------------------------------------------------------------------
Generated jboss.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" 
"http://www.jboss.org/j2ee/dtd/jboss.dtd";>
<jboss>
   <enterprise-beans>
      <entity>
         <ejb-name>test/TestEntity</ejb-name>
         <jndi-name>ejb/test/TestEntity</jndi-name>
      </entity>
      <session>
         <ejb-name>test/SequenceGenerator</ejb-name>
         <jndi-name>ejb/test/SequenceGenerator</jndi-name>
      </session>
      <session>
         <ejb-name>test/TestSession</ejb-name>
         <jndi-name>ejb/test/TestSession</jndi-name>
         <configuration-name>IIOP Stateful SessionBean</configuration-name>
      </session>
      <message-driven>
         <ejb-name>test/TestMessage</ejb-name>
         <destination-jndi-name>queue/testQueue</destination-jndi-name>
      </message-driven>
   </enterprise-beans>
   <resource-managers>
   </resource-managers>
</jboss>

------------------------------------------------------------------------        
jmx-adaptor/HTML adaptor shows

+- ejb (class: org.jnp.interfaces.NamingContext)
  |   +- test (class: org.jnp.interfaces.NamingContext)
  |   |   +- SequenceGenerator (proxy: $Proxy22 implements interface 
test.interfaces.SequenceGeneratorHome,interface javax.ejb.Handle)
  |   |   +- TestSession (class: javax.ejb.EJBHome)
  |   |   +- TestEntity (proxy: $Proxy24 implements interface 
test.interfaces.TestEntityHome,interface javax.ejb.Handle)
  
------------------------------------------------------------------------        
 
TestClient excerpts

    private static TestSession createSession() {
        System.out.println("Client creating a TestSession");
        TestSession session = null;
        try {
                InitialContext jndiContext = new InitialContext();
        
                Object ref = jndiContext.lookup( TestSessionHome.JNDI_NAME );
                System.out.println("Got reference to " + TestSessionHome.JNDI_NAME + 
": " + ref );
        
                javax.ejb.EJBHome eh = (javax.ejb.EJBHome) 
PortableRemoteObject.narrow( ref, 
javax.ejb.EJBHome.class );
                System.out.println("Got EJBHome: " + eh );
                
                TestSessionHome home = (TestSessionHome) PortableRemoteObject.narrow( 
ref, 
TestSessionHome.class );
                System.out.println("Got TestSessionHome: " + home);

                session = home.create();
                System.out.println("Got session");      
        } catch ...

------------------------------------------------------------------------
client jndi.properties; server config unchanged after installation

# iiop
java.naming.provider.url=IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E61
6D696E672F4E616D696E67436F6E746578744578743A312E30000000000002000000000000
0068000102000000000E3135382E3233342E37392E38340021EB000000114A426F73732F4E
616D696E672F726F6F74000000000000020000000000000008000000004A41430000000001
0000001C000000000001000100000001050100010001010900000001050100010000000100
00002C0000000000000001000000010000001C000000000001000100000001050100010001
01090000000105010001
java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory

# non-iiop
#java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
#java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
#java.naming.provider.url=localhost

------------------------------------------------------------------------
server log: selected INFO messages

[CorbaORBService] Naming: 
[IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696
E67436F6E746578744578743A312E300000000000020000000000000068000102000000000
E3135382E3233342E37392E38340021EB000000114A426F73732F4E616D696E672F726F6F7
4000000000000020000000000000008000000004A414300000000010000001C00000000000
100010000000105010001000101090000000105010001000000010000002C0000000000000
001000000010000001C0000000000010001000000010501000100010109000000010501000
1]
[CorbaORBService] IR: 
[IOR:000000000000002149444C3A6F6D672E6F72672F434F5242412F5265706F7369746F72
793A312E3000000000000000020000000000000064000102000000000E3135382E3233342E
37392E38340021EB0000000E4A426F73732F546573742F49523A000000000002000000000
0000008000000004A414300000000010000001C00000000000100010000000105010001000
101090000000105010001000000010000002C0000000000000001000000010000001C00000
000000100010000000105010001000101090000000105010001]
[ejb/test/TestSession] EJBHome reference for 
ejb/test/TestSession:IOR:0000000000000035524D493A746573742E696E7465726661636573
2E5465737453657373696F6E486F6D653A3030303030303030303030303030303000000000
0000000200000000000000BA000102000000000E3135382E3233342E37392E38340021EB00
0000244A426F73732F454A42486F6D652F656A62262574657374262554657374536573736
96F6E000000030000000000000008000000004A414300000000010000001C0000000000010
0010000000105010001000101090000000105010001000000190000003A000000000000003
2687474703A2F2F756B7031303737353A383038332F576562434C5B656A622F746573742F
5465737453657373696F6E5D2F000000000000010000006E00000000000000020000000100
00001C00000000000100010000000105010001000101090000000105010001000000190000
003A0000000000000032687474703A2F2F756B7031303737353A383038332F576562434C5
B656A622F746573742F5465737453657373696F6E5D2F00
[ejb/test/TestSession] Bound test/TestSession to ejb/test/TestSession
[test/TestEntity] Created table 'TESTENTITY' successfully.
[EjbModule] Started
[MainDeployer] Deployed package: 
file:/C:/pack/java/jboss-3.0.1RC1/server/all/deploy/ejb-
test.jar
[MainDeployer] Starting deployment of package: file:/C:/pack/java/jboss-
3.0.1RC1/server/all/deploy/jmx-ejb-adaptor.jar

------------------------------------------------------------------------
server startup using run.bat

C:\pack\java\jboss-3.0.1RC1\bin>run -c all
ECHO is off.
.
  JBoss Bootstrap Environment
.
  JBOSS_HOME: C:\pack\java\jboss-3.0.1RC1\bin\\..
.
  JAVA: c:\pack\java\j2sdk1.4.0_01\bin\java
.
  JAVA_OPTS: -server -Dprogram.name=run.bat
.
  CLASSPATH: ;c:\pack\java\j2sdk1.4.0_01\lib\tools.jar;C:\pack\java\jboss-3.0.1R
C1\bin\\run.jar
.
ECHO is off.
.
13:12:39,379 INFO  [Server] JBoss Release: JBoss-3.0.1RC1 CVSTag=Branch_3_0
13:12:39,439 INFO  [Server] Home Dir: C:\pack\java\jboss-3.0.1RC1
13:12:39,439 INFO  [Server] Home URL: file:/C:/pack/java/jboss-3.0.1RC1/
13:12:39,439 INFO  [Server] Library URL: file:/C:/pack/java/jboss-3.0.1RC1/lib/
13:12:39,439 INFO  [Server] Patch URL: null
13:12:39,449 INFO  [Server] Server Name: all
13:12:39,449 INFO  [Server] Server Home Dir: C:\pack\java\jboss-3.0.1RC1\server\all
13:12:39,449 INFO  [Server] Server Home URL: 
file:/C:/pack/java/jboss-3.0.1RC1/server/all/
13:12:39,449 INFO  [Server] Server Data Dir: C:\pack\java\jboss-3.0.1RC1\server\all\db
13:12:39,449 INFO  [Server] Server Temp Dir: C:\pack\java\jboss-3.0.1RC1\server\all\tmp
13:12:39,449 INFO  [Server] Server Config URL: file:/C:/pack/java/jboss-
3.0.1RC1/server/all/conf/
13:12:39,449 INFO  [Server] Server Library URL: file:/C:/pack/java/jboss-
3.0.1RC1/server/all/lib/

------------------------------------------------------------------------
client startup using run-client.bat
C:\users\tgg\java\jb3template\build\bin>run-client
C:\pack\java\j2sdk1.4.0_01\jre\bin\java.exe -classpath 
".;
C:\pack\java\jboss-3.0.1RC1\client\concurrent.jar;
C:\pack\java\jboss-3.0.1RC1\client\gnu-regexp.jar;
C:\pack\java\jboss-3.0.1RC1\client\jaas.jar;
C:\pack\java\jboss-3.0.1RC1\client\jacorb.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-common-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-iiop-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-j2ee.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-jsr77.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-net-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jboss-system-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jbossha-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jbossmq-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jbossmqha.jar;
C:\pack\java\jboss-3.0.1RC1\client\jbosssx-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jcert.jar;
C:\pack\java\jboss-3.0.1RC1\client\jmx-connector-client-factory.jar;
C:\pack\java\jboss-3.0.1RC1\client\jmx-ejb-connector-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jmx-rmi-connector-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jnet.jar;
C:\pack\java\jboss-3.0.1RC1\client\jnp-client.jar;
C:\pack\java\jboss-3.0.1RC1\client\jsse.jar;
C:\pack\java\jboss-3.0.1RC1\client\log4j.jar;
..\client\client-test.jar" test.client.TestClient

Client creating a TestSession
Got reference to ejb/test/TestSession: 
com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR:0000000000000035524d493a746
573742e696e74657266616365732e5465737453657373696f6e486f6d653a30303030303030
303030303030303030000000000000000200000000000000ba000102000000000e3135382e
3233342e37392e38340021eb000000244a426f73732f454a42486f6d652f656a622625746573
7426255465737453657373696f6e000000030000000000000008000000004a4143000000000
10000001c00000000000100010000000105010001000101090000000105010001000000190
000003a0000000000000032687474703a2f2f756b7031303737353a383038332f576562434c
5b656a622f746573742f5465737453657373696f6e5d2f000000000000010000006e00000000
00000002000000010000001c00000000000100010000000105010001000101090000000105
010001000000190000003a0000000000000032687474703a2f2f756b7031303737353a38303
8332f576562434c5b656a622f746573742f5465737453657373696f6e5d2f00
Got EJBHome: 
IOR:0000000000000035524d493a746573742e696e74657266616365732e5465737453657373696f6e486f6d653a30303030303030303030303030303030000000000000000200000000000000ba000102000000000e3135382e3233342e37392e38340021eb000000244a426f73732f454a42486f6d652f656a6226257465737426255465737453657373696f6e0000000300000000
00000008000000004a414300000000010000001c00000000000100010000000105010001000101090000000105010001000000190000003a0000000000000032687474703a2f2f756b7031303737353a383038332f576562434c5b656a622f746573742f5465737453657373696f6e5d2f000000000000010000006e0000000000000002000000010000001c00000000000100010000
000105010001000101090000000105010001000000190000003a0000000000000032687474703a2f2f756b7031303737353a383038332f576562434c5b656a622f746573742f5465737453657373696f6e5d2f00
java.lang.ClassCastException        
        at 
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
        at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
        at test.client.TestClient.createSession(TestClient.java:96)
        at test.client.TestClient.main(TestClient.java:22)


------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------







----
"In anything at all, perfection is finally attained not when there 
is no longer anything to add, but when there is no longer anything 
to take away." Antoine de Saint Exupery, in "The Little Prince"


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
PC Mods, Computing goodies, cases & more
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to