• 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:
  • 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

Problem accessing session bean return value

 
Ranch Hand
Posts: 41
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have written an EJB module that accesses a database and retrieves a record. I want to pass this record back as an object to the client, a jsp page. The ejb module session bean works fine and retrieves data. However on the client side I can't get stuff out of the object i returned by the session bean method. I get the error below

java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/jasper/servlet/JasperLoader) previously initiated loading for a different type with name "com/jjpeople/db/FlightProfile"
org.apache.jsp.client_jsp._jspService(client_jsp.java:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


What does this error mean? How do i pass a bean back to the client? I'm using jboss and ejb 2.0.

Heres how my jsp client.. the error line is highlighted

<%

FlightInfoHome home=null;

String name = "";


System.out.println("-> init()");

Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost:1099");

try {
// Obtain the JNDI initial context.
Context ctx = new InitialContext(env);
// Get a reference to the home object.
Object obj = ctx.lookup("ejb/FlightInfo");
// Cast the RMI-IIOP object.
home = (FlightInfoHome) PortableRemoteObject.narrow(obj,
FlightInfoHome.class);
} catch (Exception e) {
e.printStackTrace();
}

try {


System.out.println(" -> Creating Flight Info!");

FlightInfoRemote obj = home.create();

FlightProfile p = (FlightProfile)obj.inquiry("162");

out.println(p.toString());

if(p == null){

System.out.println("NULL OBJECT");
out.println("Null object");
}

else {System.out.println("NOT NULL");
out.println("Not null...");
}

// System.out.println("Finished invoking..");
// String to = p.getTo();
// System.out.println(to);



} catch (RemoteException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}

%>
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic