Difference between jboss-4.0.3SP1-installer.jar and jboss-4.
kumachan Mar 21, 2006 9:55 PMHello.
A different kind of error occurs when a program the same by two kinds of jboss (jboss-4.0.3SP1-installer.jar and jboss-4.0.3SP1.tar.gz) was moved.
Please help me when there is a person who understands the cause.
Remote Interface:
package sample; import javax.ejb.Remote; @Remote public interface Sample{ void func(); }
Stateless Session Bean Class:
package sample; import javax.ejb.Stateless; @Stateless public class SampleBean implements Sample{ public void func() { System.out.println("execute func."); } }
Client Application:
import javax.naming.*; import java.util.*; import java.lang.*; import sample.*; public class Client { public static void main(String[] args) throws Exception { Context ctx = new InitialContext(); Sample ejb = (Sample)ctx.lookup(xxxxxxxxxx); ejb.func(); } }
jndi.properties (classpath is passed):
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=localhost:1099
The under line part of my client application changes.
1:Jboss is installed from jboss-4.0.3SP1-installer.jar
[How from application to call bean:]
Sample ejb = (Sample) ctx.lookup("SampleBean/remote");
[error from jboss:]
Exception in thread "main" javax.naming.NameNotFoundException: SampleBean not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Client.main(Client.java:11)
[How from application to call bean:]
Sample ejb = (Sample) ctx.lookup(Sample.class.getName());
[error from jboss:]
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/aspects/asynch/AsynchProvider
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2232)
at java.lang.Class.getDeclaredField(Class.java:1852)
at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1555)
at java.io.ObjectStreamClass.access$600(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:381)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:373)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:268)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:504)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:57)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:637)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Client.main(Client.java:11)
The program moves when jboss-aspect-jdk50-client.jar is added to the classpath here.
2:Jboss is installed from jboss-4.0.3SP1.tar.gz (jboss-EJB-3.0_RC5-PFD is added)
[How from application to call bean:]
Sample ejb = (Sample) ctx.lookup("SampleBean/remote");
It succeeded in the movement of the program.
[How from application to call bean:]
Sample ejb = (Sample) ctx.lookup(Sample.class.getName());
[error from jboss:]
Exception in thread "main" javax.naming.NameNotFoundException: sample.Sample not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at un.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Client.main(Client.java:11)