• Post Reply 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

EJB Application Client Clarification

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi EJB Guru,

I would like some clarification on accessing Remote/Local Session Bean using an Application Client. In other word, there appears to be more than one approach to the same Session bean. Let's start by declaring the Converter EJB:





I have two method to accessing this bean.

( i ) Lookup JNDI using the following set of code:



( ii ) Application Client lookup?



It is the first time I come a cross method ( ii ) and could not get it to work properly. The error message

received were:

SJSAS server side

**RemoteBusinessJndiName: converter.ejb.Converter; remoteBusIntf: converter.ejb.Converter
LDR5010: All ejb(s) of [converter] loaded successfully!
Registering ad hoc servlet: WebPathPath: context root = "/converter", path = "/converter-app-client'
Java Web Start services started for application com.sun.enterprise.appclient.jws.ApplicationContentOrigin@c91c07

registration name=converter
com.sun.enterprise.appclient.jws.NestedAppclientContentOrigin@14f3900 registration name=converter, context

root=/converter/converter-app-client, module name=
, parent=converter
WEB0100: Loading web module [converter:converter-war.war] in virtual server [server] at [/converter]Class [ Lconverter/ejb/Converter; ] not found. Error while loading [ class converter.client.ConverterClient ]
Error in annotation processing: java.lang.NoClassDefFoundError: Lconverter/ejb/Converter;
deployed with moduleid = converter-app-client


Converter-app-client side

Caught an unexpected exception! java.lang.NullPointerException
at converter.client.ConverterClient.doConversion(ConverterClient.java:59)
at converter.client.ConverterClient.main(ConverterClient.java:53)

Here is the JNDI listing in ASADMIN:



My questions are:

( a ) Why does the error occur?
( b ) what is the architecture difference in accessing the same bean? Does JNDI lookup allows one to access EJB from remote host as opposed the method ( ii ) which is only restricted to local access on the same JVM/Container?
( c ) What are the pros & cons between the two?

I am using Application Client to lookup these Session Beans on Netbeans 5.5, SJSAS 9.0, SDK 1.5.0_11 on Windows XP platform.

Any guideance/advice would be very much appreciated.

Thanks alot,

Henry
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
change bean class declaration to: public class ConverterBean implements Converter
it works like this
 
Yes, my master! Here is the tiny ad you asked for:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic