Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > EJB3 and JBoss 4.0.4 GA

Reply
Thread Tools

EJB3 and JBoss 4.0.4 GA

 
 
Kimba
Guest
Posts: n/a
 
      06-08-2006
Hi all,

I have a slight problem, I try to create a reference Stateless
SessionBean but for some reason each time my client tries to access the
Bean after looking it up on JNDI I end up getting the following
exception:

Code:

Exception in thread "main" java.lang.NoClassDefFoundError:
[Lorg/jboss/aop/advice/Interceptor;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.jav a:2232)
at java.lang.Class.getDeclaredField(Class.java:1852)
at
java.io.ObjectStreamClass.getDeclaredSUID(ObjectSt reamClass.java:1555)
at java.io.ObjectStreamClass.access$600(ObjectStreamC lass.java:47)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass. java:381)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass .java:373)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass .java:26
at java.io.ObjectStreamClass.initNonProxy(ObjectStrea mClass.java:504)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
at
java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
at
java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
at
java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
at
java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
at
java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1912)
at
java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1836)
at
java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1713)
at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:339)
at java.rmi.MarshalledObject.get(MarshalledObject.jav a:135)
at
org.jnp.interfaces.MarshalledValuePair.get(Marshal ledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingCont ext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingCont ext.java:587)
at javax.naming.InitialContext.lookup(InitialContext. java:351)
at com.kimbasoft.reference.ejb.client.MyClient.main(M yClient.java:2
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main (AppMain.java:90)






Here is my source:

Remote Interface:
Code:

package com.kimbasoft.reference.ejb.session;

public interface TestRemote {

public String sayHelloRemote();

}




Local Interface:
Code:

package com.kimbasoft.reference.ejb.session;

public interface TestLocal {

public String sayHelloLocal();

}





Bean Implementation:
Code:

package com.kimbasoft.reference.ejb.session;

import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.Local;

@Stateless
@Local({TestLocal.class })
@Remote({TestRemote.class})
public class TestBean implements TestRemote {

public String sayHelloRemote() {
return "Hello Remote World!!!";
}

public String sayHelloLocal() {
return "Hello Local World!!!";
}

}




Client Implementation:
Code:

package com.kimbasoft.reference.ejb.client;

import com.kimbasoft.reference.ejb.session.TestRemote;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class MyClient {

public static void main(String[] args) {

Context ctx;

try {
ctx = new InitialContext();
TestRemote obj = (TestRemote) ctx.lookup("TestBean/remote");
System.out.println(">>" + obj.sayHelloRemote());
} catch (NamingException e) {
System.out.println("ERROR");
e.printStackTrace();
}
}
}





First I compile everything and package it into a JAR file. Then I
deploy it on JBoss. After deploying I check the JNDI content and can
see my TestBean and it's remote and local interface. Now I start the
client (I have the client JARs of JBoss in the path) on my local pc out
of a local copy of the JAR file I deployed on the server and then I get
the above mentioned exception. Can anybody help me and tell me what I'm
doing wrong???

Thanks,

Kimba


Configuration:
JBoss 4.0.4 GA
jboss-EJB-3.0_RC8-FD
JDK 1.5.0

 
Reply With Quote
 
 
 
 
jlp
Guest
Posts: n/a
 
      06-08-2006
JBoss 4.0.4 comes with EJB3, there is no need to install other thing.
Perhaps that is your problem...
"Kimba" <> a écrit dans le message de
news: ups.com...
> Hi all,
>
> I have a slight problem, I try to create a reference Stateless
> SessionBean but for some reason each time my client tries to access the
> Bean after looking it up on JNDI I end up getting the following
> exception:
>
> Code:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> [Lorg/jboss/aop/advice/Interceptor;
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.jav a:2232)
> at java.lang.Class.getDeclaredField(Class.java:1852)
> at
> java.io.ObjectStreamClass.getDeclaredSUID(ObjectSt reamClass.java:1555)
> at java.io.ObjectStreamClass.access$600(ObjectStreamC lass.java:47)
> at java.io.ObjectStreamClass$2.run(ObjectStreamClass. java:381)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.io.ObjectStreamClass.<init>(ObjectStreamClass .java:373)
> at java.io.ObjectStreamClass.lookup(ObjectStreamClass .java:26
> at java.io.ObjectStreamClass.initNonProxy(ObjectStrea mClass.java:504)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
> at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1546)
> at
> java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1460)
> at
> java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1693)
> at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
> at
> java.io.ObjectInputStream.defaultReadFields(Object InputStream.java:1912)
> at
> java.io.ObjectInputStream.readSerialData(ObjectInp utStream.java:1836)
> at
> java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1713)
> at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1299)
> at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:339)
> at java.rmi.MarshalledObject.get(MarshalledObject.jav a:135)
> at
> org.jnp.interfaces.MarshalledValuePair.get(Marshal ledValuePair.java:72)
> at org.jnp.interfaces.NamingContext.lookup(NamingCont ext.java:652)
> at org.jnp.interfaces.NamingContext.lookup(NamingCont ext.java:587)
> at javax.naming.InitialContext.lookup(InitialContext. java:351)
> at com.kimbasoft.reference.ejb.client.MyClient.main(M yClient.java:2
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
> at
>

sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39
)
> at
>

sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl
..java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.intellij.rt.execution.application.AppMain.main (AppMain.java:90)
>
>
>
>
>
>
> Here is my source:
>
> Remote Interface:
> Code:
>
> package com.kimbasoft.reference.ejb.session;
>
> public interface TestRemote {
>
> public String sayHelloRemote();
>
> }
>
>
>
>
> Local Interface:
> Code:
>
> package com.kimbasoft.reference.ejb.session;
>
> public interface TestLocal {
>
> public String sayHelloLocal();
>
> }
>
>
>
>
>
> Bean Implementation:
> Code:
>
> package com.kimbasoft.reference.ejb.session;
>
> import javax.ejb.Remote;
> import javax.ejb.Stateless;
> import javax.ejb.Local;
>
> @Stateless
> @Local({TestLocal.class })
> @Remote({TestRemote.class})
> public class TestBean implements TestRemote {
>
> public String sayHelloRemote() {
> return "Hello Remote World!!!";
> }
>
> public String sayHelloLocal() {
> return "Hello Local World!!!";
> }
>
> }
>
>
>
>
> Client Implementation:
> Code:
>
> package com.kimbasoft.reference.ejb.client;
>
> import com.kimbasoft.reference.ejb.session.TestRemote;
>
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NamingException;
>
> public class MyClient {
>
> public static void main(String[] args) {
>
> Context ctx;
>
> try {
> ctx = new InitialContext();
> TestRemote obj = (TestRemote) ctx.lookup("TestBean/remote");
> System.out.println(">>" + obj.sayHelloRemote());
> } catch (NamingException e) {
> System.out.println("ERROR");
> e.printStackTrace();
> }
> }
> }
>
>
>
>
>
> First I compile everything and package it into a JAR file. Then I
> deploy it on JBoss. After deploying I check the JNDI content and can
> see my TestBean and it's remote and local interface. Now I start the
> client (I have the client JARs of JBoss in the path) on my local pc out
> of a local copy of the JAR file I deployed on the server and then I get
> the above mentioned exception. Can anybody help me and tell me what I'm
> doing wrong???
>
> Thanks,
>
> Kimba
>
>
> Configuration:
> JBoss 4.0.4 GA
> jboss-EJB-3.0_RC8-FD
> JDK 1.5.0
>



 
Reply With Quote
 
Kimba
Guest
Posts: n/a
 
      06-08-2006
JBoss 4.0.4 ONLY comes with EJB3 when you use the installer and only
when you select it to be installed. When you use the ZIP file as I did
you have to manually install EJB3 afterwards. JBoss 5 will come with
EJB3 preinstalled!

jlp wrote:
> JBoss 4.0.4 comes with EJB3, there is no need to install other thing.
> Perhaps that is your problem...


 
Reply With Quote
 
JScoobyCed
Guest
Posts: n/a
 
      06-09-2006
Kimba wrote:
> Hi all,
> Exception in thread "main" java.lang.NoClassDefFoundError:
> [Lorg/jboss/aop/advice/Interceptor;
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.jav a:2232)
> at java.lang.Class.getDeclaredField(Class.java:1852)
> at


Do you need the AOP interceptor? If you don't you can eventually remove
the ejb3-interceptors-aop.xml from the deployment folder
(<jboss-folder>/server/<server-config>/deploy/ )


--
JSC
 
Reply With Quote
 
Kimba
Guest
Posts: n/a
 
      06-11-2006
Hi JScoobyCed,

I tried that but JBoss doesn't like it at all when I take away that
XML. It throws an exception when bringing the server up. Besides, it
shouldn't matter if I need them or not, right? I mean I should be able
to leave them in and still access the SessionBean or am I mistaken?

> Do you need the AOP interceptor? If you don't you can eventually remove
> the ejb3-interceptors-aop.xml from the deployment folder
> (<jboss-folder>/server/<server-config>/deploy/ )


Thanks,

Kimba

 
Reply With Quote
 
Danno
Guest
Posts: n/a
 
      06-12-2006
Hey Kimba, where did the exception occur on the client or on the server?

 
Reply With Quote
 
Kimba
Guest
Posts: n/a
 
      06-12-2006
Hi Danno,

it occured at the client side.


Danno wrote:
> Hey Kimba, where did the exception occur on the client or on the server?


 
Reply With Quote
 
Danno
Guest
Posts: n/a
 
      06-12-2006

Kimba wrote:
> Hi Danno,
>
> it occured at the client side.
>
>
> Danno wrote:
> > Hey Kimba, where did the exception occur on the client or on the server?


OK. Do a me a favor and copy
[JBOSS_HOME]\client\jboss-aop-jdk50-client.jar where [JBOSS_HOME] is
your jboss directory and make sure that that jar is available in your
application clients classpath. That should get you past this error
message.

 
Reply With Quote
 
Kimba
Guest
Posts: n/a
 
      06-12-2006
Hi Danno,

Thanks!! That was it, now it is working fine!! Can't believe that JBoss
doesn't mention that in their install guide for the EJB3 container.
Another problem is, they did not include ANY client jar into the EJB3
zip file so you have no other option than using their installer.

But thanks again for your help. I should have figured out myself that
there is a client JAR missing but I just didn't think about it!!

Kimba.

Danno wrote:
> Kimba wrote:
> > Hi Danno,
> >
> > it occured at the client side.
> >
> >
> > Danno wrote:
> > > Hey Kimba, where did the exception occur on the client or on the server?

>
> OK. Do a me a favor and copy
> [JBOSS_HOME]\client\jboss-aop-jdk50-client.jar where [JBOSS_HOME] is
> your jboss directory and make sure that that jar is available in your
> application clients classpath. That should get you past this error
> message.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Application in JBoss Portal on Liferay JBoss LprzemekL Java 0 04-10-2008 12:03 PM
Jboss 4.0.5, ejb3, remote client natG Java 5 05-08-2007 08:26 PM
BLOBS and EJB3 Java and Swing Java 2 08-17-2006 04:08 AM
Unclear on either EJB3 or JBoss or both Owen Jacobson Java 0 07-21-2006 07:32 AM
QuerySyntaxException on JBoss 4.0.2CR2 and EJB3 sushrut Java 1 05-06-2006 09:36 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57