From: Raphael V. <rv_...@os...> - 2005-09-29 07:35:33
|
Hi, I tried to call a EJB from the JavaBridge (2.0.8) as described here: http://cvs.sourceforge.net/viewcvs.py/php-java-bridge/php-java-bridge/examples/j2ee/README?rev=1.4&view=markup It results in the following error: Fatal error: Uncaught [o(Exception):"java.lang.Exception: Invoke failed: [c:javax.rmi.PortableRemoteObject]->narrow((java.lang.Object)o(CDRInputStream_1_0$1):"com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR:0000000000000022524d493a446f63756d656e74486f6d653a30303030303030303030303030303030000000000000010000000000000188000102000000000d31302e3131322e32302e393500000e7400000056afabcb00000000260000003f00000009533141532d4f5242000000000000000200000008526f6f74504f41000000001237333932333136393634333532383139320000000000000d0106a0bb2b46000000000001ff0a000000000007000000010000002000000000000100010000000205010001000100200001010900000001000101000000002600000002000200000000000300000018000000000000000d31302e3131322e32302e393500000eec0000000300000018000000000000000d31302e3131322e32302e393500000f500000001f0000000400000003000000200000000400000001000000210000007c00000000000000010000000000000024000000200000006600000000000000010000000d31302e3131322e32302e393500000eec0040000000000008060667! 810201010100000017040100080606678102010101000000 in C:\Htdocs\JavaBridge\globals.php on line 34 Line 34 in globals.php is: $home = $PortableRemoteObject->narrow($objref, $DocumentHome); After that I tried a similar example with an Session EJB in an OC4J-Container. This does not work as well. The error eccurs in the same method PortableRemoteObject->narrow: Fatal error: Uncaught [o(Exception):"java.lang.Exception: Invoke failed: [c:javax.rmi.PortableRemoteObject]->narrow((java.lang.Object)o(__Proxy2):"SessionEJB EJBHome", (java.lang.Class)i:mypackage2.SessionEJBHome). Cause: java.lang.ClassCastException"] thrown in C:\Htdocs\JavaBridge\testClient.php on line 52 Seems so as if the Bridge has problems to cast the EJB to the home interface. Has anybody tried the example successfully? Regards, Raphael Vullriede |
From: Jost B. <jos...@ya...> - 2005-09-29 16:13:41
|
Hi, > Fatal error: Uncaught > [o(Exception):"java.lang.Exception: Invoke failed: > [c:javax.rmi.PortableRemoteObject]->narrow((java.lang.Object)o(CDRInputStream_1_0$1):"com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR: I have just tried this with the sun j2ee sample server, narrow correctly returns the stub there: [o(_DocumentHome_Stub):"IOR:00000000..."] So this problem seems to be oc4j specific. I have tried to deploy the sample.jar into oracle but I have given up for the moment because this AS doesn't accept plain .jar files; I think I'll have to create a .ear first. This ClassCastException rings a bell, however. Do you use the j2ee.jar from oracle or from sun? > Seems so as if the Bridge has problems to cast the > EJB to the home interface. I think this is a oracle specific problem and doesn't have anything to do with the bridge. -- If I remember correctly, this error appears if one mixes the j2ee jar files from different vendors. We have wasted several hours, but I cannot remember how we solved this problem. I will check this, asap. Please see PR1308217 for details: http://sourceforge.net/tracker/index.php?func=detail&aid=1308217&group_id=117793&atid=679233 Regards, Jost Boekemeier ___________________________________________________________ Was denken Sie über E-Mail? Wir hören auf Ihre Meinung: http://surveylink.yahoo.com/wix/p0379378.aspx |
From: Raphael V. <rv_...@os...> - 2005-09-29 21:49:31
|
Hi, thanks for your reply. >>[o(Exception):"java.lang.Exception: Invoke failed: >> > > [c:javax.rmi.PortableRemoteObject]->narrow((java.lang.Object)o(CDRInputStream_1_0$1):"com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR: > > I have just tried this with the sun j2ee sample > server, narrow correctly returns the stub there: > [o(_DocumentHome_Stub):"IOR:00000000..."] > > So this problem seems to be oc4j specific. I have > tried to deploy the sample.jar into oracle but I have > given up for the moment because this AS doesn't accept > plain .jar files; I think I'll have to create a .ear > first. My first test was with the Sun AS (Version 8.1_02 (build b06-fcs)). I followed the tutorial step by step. Which mode do you use for the JavaBridge? Does it run in an AS or standalone? This is the only difference I could imagine. For this example I have used the j2ee.jar from sun which was delivered with the Application Server. > This ClassCastException rings a bell, however. Do you > use the j2ee.jar from oracle or from sun? > > > >>Seems so as if the Bridge has problems to cast the >>EJB to the home interface. > > > I think this is a oracle specific problem and doesn't > have anything to do with the bridge. -- If I remember > correctly, this error appears if one mixes the j2ee > jar files from different vendors. We have wasted > several hours, but I cannot remember how we solved > this problem. For the Test with the OC4j Container I used the oc4j.jar which has a own implementation of the necessary classes and interfaces. > I will check this, asap. Please see PR1308217 for > details: > http://sourceforge.net/tracker/index.php?func=detail&aid=1308217&group_id=117793&atid=679233 Thanks for your support! Regards, Raphael |
From: Jost B. <jos...@ya...> - 2005-09-30 15:27:07
|
Hi, > JavaBridge? Does it run in an AS or standalone? This > is the only difference I could imagine. It runs as standalone with the generated ejb client jar and the sun j2ee jar in the java_require() path. Whether or not it runs inside the AS shouldn't make a difference as long as the correct client and j2ee jars are used. > For the Test with the OC4j Container I used the > oc4j.jar which has a own > implementation of the necessary classes and > interfaces. Okay, and where does the client jar come from, does it contain the stub classes? I have just tested this with the client jar generated from the deploytool, this works on oracle, too, without generating a class cast exception. Can you please attach the client jar at the end of the ticket? BTW, if I remember correctly, oracle doesn't need the narrow, because it uses wrapper instead of a proxy. So you could simply ommit the narrow and the example should work. But that's an oracle specific "hack" which will not work with other servers. Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |
From: Raphael V. <rv_...@os...> - 2005-10-02 17:42:15
|
Hi, > Okay, and where does the client jar come from, does it > contain the stub classes? I have just tested this with > the client jar generated from the deploytool, this > works on oracle, too, without generating a class cast > exception. I used the documentBeanClient.jar which was shipped with the example. After generating a new with the deploytool it works! Thanks for the hint. regards, Raphael |