Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB 3 javax.naming.Communication Exception

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi, I am trying to access a remote stateless bean from a standalone client. I am using JBOSS application server.But I am getting the following exception:

javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.ejb3.stateless.StatelessRemoteProxy; local class incompatible: stream classdesc serialVersionUID = 2583299153931800023, local class serialVersionUID = -9097306519795868]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:723)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:588)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.ejb.bean.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:20)

where FirstEJB3TutorialClient.java is my client application running on a separate machine.

The code snippets for the various classes used are as follows:

BookTestBeanRemote interface:
@Remote
public interface BookTestBeanRemote {
public void testBook();
public void testCustomer();
public void testRelation();
}

BookTestBean class:

@Stateless
@RemoteBinding(jndiBinding="testBean")

public class BookTestBean implements BookTestBeanRemote {

@PersistenceContext

EntityManager em;

FirstEJB3TutorialClient class:

public class FirstEJB3TutorialClient {
public static void main(String[] args) {
try {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming rg.jnp.interfaces");
properties.put(Context.PROVIDER_URL, "10.0.5.243:1099");
Context context = new InitialContext(properties);
BookTestBeanRemote beanRemote = (BookTestBeanRemote) context
.lookup("testBean");

beanRemote.testBook();

where 10.0.5.243 is the IP address of the server where JBOSS server is running.

Can someone please help me out??

Thanks
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Let's continue the discussion in your other thread
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not duplicate post. The EJB3 forum is the more appropriate forum, this forum is for Object Relation Mapping tools only, which does cover JPA.

Mark
 
    Bookmark Topic Watch Topic
  • New Topic