I'm trying to write a simple test EJB in NetBeans, deploy into JBoss 4.0.4
and invoke a method from PB.
Everything works fine, in PB I created the EJB proxy, a JavaVM, an
EJBConnection, but when I use the EJBConnection's Lookup method, it gives
back the TestSessionRemote Java interface, which contains no methods.
NetBeans put my test 'multiply' method into the TestSessionRemoteBusiness
interface. Anybody has any experience what's wrong?
When I generated the proxy, I used TestSessionRemote for remote interface
and TestSessionRemoteHome for home interface. Also tried using
TestSessionRemoteBusiness for remote interface but nothing happened.
Here is the code which invokes the multiply method of EJB:
-----------------------------------------
EJBConnection lnvo_ejb_conn
TestSessionRemote lnvo_TestSessionRemote
TestSessionRemoteHome lnvo_TestSessionRemoteHome
String ls_properties[ ]
String ls_msg
Int li_number
// connecting to application server
ls_properties[1] =
"javax.naming.Context.INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory"
ls_properties[2] =
"javax.naming.Context.URL_PKG_PREFIXES=jboss.naming:org.jnp.interfaces"
ls_properties[3] = "javax.naming.Context.PROVIDER_URL=jnp://localhost:1099/"
Try
lnvo_ejb_conn = Create EJBConnection
lnvo_ejb_conn.connectToServer(ls_properties)
Catch (Exception ex)
MessageBox("EJB connect error", ex.GetMessage())
End Try
// invoke
Try
lnvo_TestSessionRemoteHome = lnvo_ejb_conn.Lookup("TestSessionRemoteHome",
"TestSessionBean", "hu.sybase.TestSessionRemoteHome")
lnvo_TestSessionRemote = lnvo_TestSessionRemoteHome.create( )
//li_number = lnvo_TestSessionRemote.multiply( 2, 10 )
Catch (Exception ex2)
messagebox("EJB invoke error", ex2.GetMessage())
End Try
-----------------------------------------
Thanks,
Peter Michaleczky
how do you generate the proxy objects? using PB wizard?
"Peter Michaleczky" <michalec...@sybase.hu> wrote in message
news:47285628@forums-1-dub...