Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to integrate hibernate and EJB (stateless session bean)

 
Ranch Hand
Posts: 47
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am new to EJB. In my application we are using struts 2.0, EJB (2.0) stateless session bean, hibernate 3.0, Jboss(4.0.2) application server and eclipse IDE.

Can you Please tell me, how to call the hibernate from the stateless session bean. I am sure that there is no problem with the hibernate code.

1. How to integrate EJB stateless session bean and hibernate?
2. is there any need to configure jboss for this?

Previously i used to struts and hibenate, and its working fine. can you please clear my doubt. Thanks in advance.
 
vinoth subramaniam
Ranch Hand
Posts: 47
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the error i am getting



HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.rmi.ServerError: Unexpected Error; nested exception is:
java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:399)
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
org.jboss.ejb.Container.invoke(Container.java:873)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
$Proxy99.GetPLANData(Unknown Source)
com.tcs.Nulamda.action.GetPlanDataAction.execute(GetPlanDataAction.java:24)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)




I already put all the jars including common-collections3.2.1.jar, Hibernate3.jar, in the EJB project library. But still i am getting the error. What might be the reason? Please help me to solve this issue
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I already put all the jars including common-collections3.2.1.jar, Hibernate3.jar, in the EJB project library


What (or where) is the EJB project library? Have a read of the README.txt file that comes with Hibernate. It explains all the dependencies you need.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic