-
1. Re: Why is Remote Interface not installed
jaikiran Apr 29, 2008 4:57 AM (in response to baumar)but the Remote Interface cannot be found through the lookup.
Markus,
Can you tell us what exactly you mean by remote interface cannot be found? Do you see any exceptions while doing the lookup? If yes, please post those logs. Also, please post the code where you are doing the lookup. -
2. Re: Why is Remote Interface not installed
baumar Apr 29, 2008 12:11 PM (in response to baumar)Hi,
Sorry to forget this, I was too straight.
(My analysis was: the NamingException is due to the ClassNotFoundException: The class of the remote interface cannot be found because it is not there, as it shows in the JMX-console. But maybe that analysis is already wrong...)
The code for the client is:public class PersonFeederClient { public static void main(String[] args) { Properties props =null; InitialContext context = null; // get context props = new Properties(); props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); props.put("java.naming.provider.url", "jnp://localhost:1099"); try { context = new InitialContext(props); } catch (NamingException e) { System.out.println("could not get context, exit."); e.printStackTrace(); System.exit(0); } PersonHandlerRemote phr = null; try { phr = (PersonHandlerRemote) context.lookup("PersonHandlerBean/remote"); } catch (NamingException e) { System.out.println("could not get PersonHandlerRemote, exit."); e.printStackTrace(); System.exit(0); } System.out.println("methods in PersonHandlerRemote: "); for (Method method : phr.getClass().getMethods()) { System.out.println(method.getName()); } // create a list of persons Person smith = new Person(); smith.initAll(1, "John", "Smith"); phr.addPerson(smith); phr.printAllPerson("added Smith:"); System.out.println(); phr.deletePerson(smith); phr.printAllPerson("deleted Smith"); System.out.println(); }
And the stacktrace is:could not get PersonHandlerRemote, exit. javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(Unknown Source) at com.informationcontrol.forumorganizer.client.PersonFeederClient.main(PersonFeederClient.java:36) Caused by: java.lang.reflect.UndeclaredThrowableException at $Proxy0.createProxy(Unknown Source) at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52) at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source) at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125) at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142) ... 4 more Caused by: java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor; at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50) at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readArray(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128) at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66) at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279) at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143) at org.jboss.remoting.Client.invoke(Client.java:525) at org.jboss.remoting.Client.invoke(Client.java:488) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61) ... 9 more
-
3. Re: Why is Remote Interface not installed
jaikiran Apr 30, 2008 1:36 AM (in response to baumar)Caused by: java.lang.ClassNotFoundException: [Lorg.jboss.aop.advice.Interceptor;
You probably have not included the jbossall-client.jar (which is located at %JBOS_HOME%/client folder) in the classpath of your client application (PersonFeederClient). -
4. Re: Why is Remote Interface not installed
baumar Apr 30, 2008 6:37 AM (in response to baumar)Hi Jaikiran,
Thanks for the hint. I checked the run configuration, and found the jar included in the default classpath. I checked if it might need to be higher up in the hierarchy. Since I couldn't move it higher up in the hierarchy (?), I added it manually as its own unit and moved it to all places up and down and got always the same result.
In my - I confess not very clear understanding - the problem might be already in the packaging or deployment. I deployed a similar construction (the example 4.1 in Chapter 24 of Enterprise JavaBeans 3.0, 5th Edition By Richard Monson-Haefel). When I deploy the jar from the exercise, I can see the bean and the interface in the jmx console, whereas for the construction I made, the remote interface is just a java object, and my jar leads to a StatefulProxyFactory, which is not there in the TravelAgent.Trave lAgentBean (class: org.jnp.interfaces.NamingContext) | +- remote (proxy: $Proxy94 implements interface com.titan.travelagent.TravelAgentRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject) +- PersonHandlerBean (class: org.jnp.interfaces.NamingContext) | +- remote (class: java.lang.Object) | +- remoteStatefulProxyFactory (proxy: $Proxy82 implements interface org.jboss.ejb3.ProxyFactory)
I compared the annotations, the way the remote interfaces are build and implemented, but I cannot see the difference. I was guessing there must be a line that makes the difference, but I didn't find it.
Then I remembered that I used the conveniant ant file to create the jar, whereas in my code I did it with eclipse.
So I went back to the exercise 4.1 and tried to deploy it the same way with eclipse. And - surprise or not - it didn't work, but gave the error:--- MBeans waiting for other MBeans --- ObjectName: jboss.j2ee:jar=titanmanual.jar,name=TravelAgentBean,service=EJB3 State: NOTYETINSTALLED I Depend On: persistence.units:unitName=titan --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM --- ObjectName: persistence.units:unitName=titan State: NOTYETINSTALLED Depends On Me: jboss.j2ee:jar=titanmanual.jar,name=TravelAgentBean,service=EJB3
I my "JBoss-JEE-Errorpatterns" I had this text as a typical sign for having forgotten to include the META-INF with the persistence.xml, but I checked, it is there and contains the persistence-unit name.
I compared the 2 jars file by file and found the manifest having 2 more lines defining the ant-version and a created byAnt-Version: Apache Ant 1.7.0 Created-By: 1.6.0_03-b05 (Sun Microsystems Inc.)
The other file, that was different, was TravelAgentBean having 1 byte more when created with ant (from the same file), but I have to get a byte comparison tool to find what was different.
Another thing that looks like a bug was the fact that when exporting with eclipse from the original structure, all class files where doubled (in the eclipse export), one file was com.titan.* and the other build.classes.com.titan. I could not find, where and how to eliminate this.
I cleaned build and added bin as destination for the source. Know, every class was deployed only once; strange enough the Client.class was always exported, though I tried several times and excluded it manually - it was always there.
Is this typical to face so many problems and difficulties with deploying the jar file with eclipse to JBoss? (Maybe there is a self-aid group?-)
I saw later version provide more support, like in 4.2.2, but on one side I was missing documentation and on the other hand, the 'comfort-function' even hided more, what happened. -
5. Re: Why is Remote Interface not installed
jaikiran Apr 30, 2008 9:52 AM (in response to baumar)"baumar" wrote:
In my - I confess not very clear understanding - the problem might be already in the packaging or deployment. I deployed a similar construction (the example 4.1 in Chapter 24 of Enterprise JavaBeans 3.0, 5th Edition By Richard Monson-Haefel). When I deploy the jar from the exercise, I can see the bean and the interface in the jmx console, whereas for the construction I made, the remote interface is just a java object, and my jar leads to a StatefulProxyFactory, which is not there in the TravelAgent.
Markus,
I think i know what's going on (the TravelAgentBean and the book you mentioned acted as a hint). I remember some months back there was a user who had reported the exact same problem. During that discussion, we had found out the issue to be the JDK (version) he was using. I guess you are using Java 6 (either on the client or on the JBoss server or maybe both). If yes, then stop using Java 6 and instead use Java 1.5 (and remember to remove all the references to Java 6 in Eclipse, JBoss and the client - i mean do a clean build after setting the JAVA_HOME to JDK 1.5). If this does not solve the issue and please post back with the details."baumar" wrote:
Is this typical to face so many problems and difficulties with deploying the jar file with eclipse to JBoss? (Maybe there is a self-aid group?-)
Personally, with JBoss i do not use any IDEs for deploying (because deploying is just a matter of copying to the deploy folder) or building (i use Ant instead). Using an IDE for these activities adds an layer of unneccessary complications."baumar" wrote:
I saw later version provide more support, like in 4.2.2, but on one side I was missing documentation and on the other hand, the 'comfort-function' even hided more, what happened.
I would definitely recommend that you move to the latest stable version (4.2.2 GA), if not immidiately then maybe some time later. The documentation is definitely available on the JBoss site. Let us know if you are not able to locate it. -
6. Re: Why is Remote Interface not installed
baumar May 4, 2008 5:39 PM (in response to baumar)Hi Jaikiran,
First of all, thanks a lot for your support!
For once, using the latest version - of Java - was not very successful and I changed the JDK back to 1.5. I did it before, now I run only on 1.5 to exclude another source of errors, but it did not resolve the problem.
Where shall I begin? I also had installed JBoss 4.2.2 to see if it works there.
First I had to get rid of SampleEAR.ear, because it started up with error with the standard installation already.
After this I could install my jar with "only" one warning
22:25:25,578 INFO [SessionFactoryObjectFactory] Factory name: persistence.units:jar=person-422.jar,unitName=fotest
22:25:25,578 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingC
ontextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
22:25:25,593 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.units:jar=person-422.jar,unitNa
me=fotest
22:25:25,593 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
22:25:25,593 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingC
ontextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
22:25:26,031 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
22:25:26,046 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=person-422.jar,name=PersonFeederBean,service=
EJB3 with dependencies:
22:25:26,046 INFO [JmxKernelAbstraction] persistence.units:jar=person-422.jar,unitName=fotest
22:25:26,343 INFO [EJBContainer] STARTED EJB: com.informationcontrol.forumorganizer.persistence.PersonFeederBean ejbNam
e: PersonFeederBean
22:25:26,812 INFO [EJB3Deployer] Deployed: file:/C:/Programme/JBoss/jboss422-GA/server/default/deploy/person-422.jar
However, in the JMX console I can only see the bean, not the remote interface:PersonFeederBean (class: org.jnp.interfaces.NamingContext) | +- remote (class: java.lang.Object) | +- remoteStatefulProxyFactory (proxy: $Proxy77 implements interface org.jboss.ejb3.ProxyFactory)
I looked around for the warning message but didn't find anything that seemed to match the current situation. (one post (in combination with Seam) was: Remove the line from persistence.xml; but I don't have the line in my file...)
I also have the impression, the error I get when running the client happens earlier, as the client application doesn't even start but stops with a message that I should send to Microsoft!:
javaw.exe has a problem and has to be stopped...
The problem report looks like this:
EventType : BEX P1 : javaw.exe P2 : 5.0.40.5 P3 : 42a021bf
P4 : dnsq.dll P5 : 7.0.0.119 P6 : 464f429d P7 : 00001852
P8 : c0000409 P9 : 00000000
I know this error showed up before and until now I didn't find a workaround...
So I went back to 404, because there I could at least launch the client.
The pattern is still the same as before, I can install a jar once, but cannot redeploy. At least I know the error pattern, though it is not really a "hot" deploy.
The application did still not run, because I passed an Entity object with all fields set (I checked with a system out) but JBoss reported an Insert statement with all values null and ? ?, including the id, which caused of course a SQL-exception. However, I saw a warning that the server started without transaction support:23:05:16,953 INFO [TreeCache] setEvictionPolicyConfig(): [config: null] 23:05:16,968 WARN [TreeCache] No transaction manager lookup class has been defined. Transactions cannot be used 23:05:17,000 INFO [TreeCache] interceptor chain is: class org.jboss.cache.interceptors.CallInterceptor class org.jboss.cache.interceptors.PessimisticLockInterceptor class org.jboss.cache.interceptors.CacheLoaderInterceptor class org.jboss.cache.interceptors.UnlockInterceptor class org.jboss.cache.interceptors.ReplicationInterceptor class org.jboss.cache.interceptors.CacheStoreInterceptor 23:05:17,031 INFO [TreeCache] cache mode is REPL_SYNC
For sure I didn't stop Transaction support deliberately; so eventually I guessed this installation is f.u. and decided to install JBoss again.
While reinstalling, I noticed the pane "Isolation and call by value semantics"; I investigated and saw that the errors mentioned looked similar to what I get. When I first installed it, I think didn't check, this time I did. I also rearranged my code as you suggested:try { ctx = new InitialContext(); NamingEnumeration nameList = ctx.listBindings(""); while (nameList.hasMore()) { Binding binding = (Binding) nameList.next(); System.out.println(binding.getName()+"; "+binding.getObject()); } } catch (NamingException e) { System.out.println("Problem with InitialContext: "); e.printStackTrace(); } try { pfr = (PersonFeederRemote) ctx.lookup("PersonFeederBean/remote"); } catch (NamingException e1) { System.out.println("could not find PersonFeederBean/remote"); e1.printStackTrace(); } if (pfr == null) { System.out.println("PersonFeederRemote is null"); } else { Method[] methods = pfr.getClass().getMethods(); for (Method method: methods) { System.out.println(method.getName());} }
However, the Remote cannot be found and the error looks similar as before, so my hope having found the problem faded again:PersonFeederBean; org.jnp.interfaces.NamingContext@1d332b XAConnectionFactory; Reference Class Name: org.jboss.mq.SpyXAConnectionFactory Type: DCF Content: [B@10a6ae2 ... could not find PersonFeederBean/remote javax.naming.NamingException: Could not dereference object [Root exception is java.lang.reflect.UndeclaredThrowableException] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1150) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.informationcontrol.forumorganizer.client.ClientPersonFeeder.main(ClientPersonFeeder.java:41) Caused by: java.lang.reflect.UndeclaredThrowableException at $Proxy1.createProxy(Unknown Source) at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125) at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142) ... 4 more Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = 595045557897063404, local class serialVersionUID = -3758782076801249473 at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:306) at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143) at org.jboss.remoting.Client.invoke(Client.java:525) at org.jboss.remoting.Client.invoke(Client.java:488) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:48) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61) ... 9 more Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class incompatible: stream classdesc serialVersionUID = 595045557897063404, local class serialVersionUID = -3758782076801249473 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519) 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.readArray(ObjectInputStream.java:1628) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293) 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.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 org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:122) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711) 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 org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128) at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66) at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279) ... 17 more
So instead of resolving the problem on the server, it doesn't even seem to reach it anymore... -
7. Re: Why is Remote Interface not installed
jaikiran May 5, 2008 6:16 AM (in response to baumar)Markus,
Let's stick to JBoss-4.0.4 (i guess the book is based on that?). And let's stick to JDK-1.5 in all places (the client and the server).Caused by: java.io.InvalidClassException: org.jboss.ejb3.remoting.IsLocalInterceptor; local class in
compatible: stream classdesc serialVersionUID = 595045557897063404, local class serialVersionUID = -
3758782076801249473
The exception that you are seeing is because of an incorrect version of jar file in your client classpath. Remove all the jar files from your client classpath and then include only the jbossall-client.jar which is present in the %JBOSS_HOME%\client folder of your JBoss-4.0.4 version of the server. Then rebuild your entire project with JDK 1.5 and deploy it to the server. Let us know how it goes. -
8. Re: Why is Remote Interface not installed
baumar Jun 20, 2008 10:23 AM (in response to baumar)Hi Jaikiran,
Thanks for the hint. I searched and found the error report for that issue, but didn't know, what exactly had to be done. Well, I did what you said, but it didn't work.
I also tried your earlier suggestion to avoid deployment with eclipse and use ant instead. I used the script of the EJB 3 book cited, since this work with the current Jboss installation - but they all result is the same error.
In the meantime I spent so much time on this, that I'm a bit desperate. I'm thinking of trying once your other suggestion and try again with a newer version. Which combination of eclipse and Jboss would you recommend as being most stable?
Thanks for your help
Markus