aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Lookup problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Lookup problem" Watch "EJB Lookup problem" New topic
Author

EJB Lookup problem

Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
Hi all,

I am a new bie in ejb 3.0 earlier i had tried to run some samples on ejb3.0.
All examples i try to run results with some error. I cant understand what that error means too.

Now related with the lookup in ejb3
say:
calculator = (CalculatorRemote) c.lookup("CalculatorBean/remote");

Where we have to specify the lookup attribute. Earlier in 2.1 we used to specify it in the ejb-jar.xml. Here i am unable to locate where the lookup to be configured in the code.

can anyone help me out of this problem


Regards,
Hari
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10207
    
166

Which server are you using? What exception stacktrace do you see? Post the entire exception stacktrace


[My Blog] [JavaRanch Journal]
Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
I am using jboss 4.2 GA.
Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
Problem i came across

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.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.<init>(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.readNonProxyDesc(ObjectInputStream.java:1546)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
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:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.kimbasoft.reference.ejb.client.MyClient.main(MyClient.java:28)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
I got the same problem as it is specified here in this example.

http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3949696#3949696
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10207
    
166

You will have to place the jbossall-client.jar (which is present in %JBOSS_HOME%\client folder) in the client's classpath.
Jetendra Ivaturi
Ranch Hand

Joined: Feb 08, 2007
Posts: 159
Are you specifying the mappedname attribute in your bean.

Its acts like jndi name here. ejb-jar.xml doesn't have any role to play with jndi name.

So use @mappedName("jndiname") Use this for lookup.

Correct me if am wrong.


SCJP 1.4 & 1.5, SCWCD 1.5. Learn and Let Learn.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Lookup problem