WLS10 and Stateless Session Bean

I tried to create EJB3 application example.
1. Created Stateless Session Bean that implements Remote and Local interfaces:
Session Bean code:
package com.session;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
@Stateless(mappedName="SessionBeanService")
@Remote(ISessionBeanRemote.class)
@Local(ISessionBeanLocal.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class SessionBean implements ISessionBeanLocal,
ISessionBeanRemote
public String reply(){
return "MySessionBean - success !!!";
Remote Interface code :
package com.session;
public interface ISessionBeanRemote
public String reply();
Local Interface code:
package com.session;
public interface ISessionBeanLocal
public String reply();
application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/application_5.xsd"
     version="5">
     <display-name>EJB3 Sample Application</display-name>
     <module>
     <ejb>beans.jar</ejb>
     </module>
</application>
weblogic-application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-application PUBLIC
     "-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"
     "http://www.bea.com/ns/weblogic/90/weblogic-application.xsd">
<weblogic-application>
          <classloader-structure>
               <module-ref>
                    <module-uri>beans.jar</module-uri>
               </module-ref>
          </classloader-structure>
</weblogic-application>
2. I packaged classes into EAR file and deployed to WLS10.
I didn't include any weblogic specific XML descriptors besides weblogic-application.jar.
My client code lookes as follows:
public void test(){
Context context = getMyServerContext();
// THIS JNDI NAME I SEE ON MY SERVER JNDI TREE
String jndiName = "sessionbeansbeans_jarSessionBean_ISessionBeanRemote";
Object obj;
obj = context.lookup(jndiName);
System.out.println(" obj class : " + obj.getClass().getName());
ISessionBeanRemote remote = (ISessionBeanRemote) PortableRemoteObject.narrow(
obj, ISessionBeanRemote.class );
String res = remote.reply();
System.out.println("res : "+res);
I get an Exception:
Exception occurred!
java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
     at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
     at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
     at ca.cgi.mvest.test.server.wms.GlFacadeTest.runTest(GlFacadeTest.java:91)
     at ca.cgi.mvest.test.server.wms.GlFacadeTest.<init>(GlFacadeTest.java:53)
     at ca.cgi.mvest.test.server.wms.GlFacadeTest.main(GlFacadeTest.java:151)
java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
My server console have the following output:
Root cause of ServletException.java.lang.NoClassDefFoundError: com/session/SessionBean_7pp7ls_ISessionBeanRemot
eIntf
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
ssLoader.java:338)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:291)
Truncated. see log file for complete stacktrace
Server logs a problem already on the line when I do lookup
on JNDI name even before narrow();
It looks like my EAR was missing something. But server never complained during deployment.
May be someone can direct me to a real sample of Weblogic10-ejb3.0 application, since examples that come with WLS 10 intallation combersome and do not follow
docmentation.
Thanks in advance for any suggestion.

Hello Freind
The main different b\w stateful and statless is that stateful maintain state of method conversation means it has record that which method call before this method
but in case of stateless conversation state does not saved second different we can say that create method in stateless having no parameter but statefull having parameter I think u can understand easily
With Best Regards
Rajesh Pandey
email :[email protected]
url :-- http://www.sixthquadrant.com
Mob :-- 9811903737
Delhi India

Similar Messages

  • How to get stateful and stateless session bean in second jsp

    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?

    Greetings,
    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
    second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
    that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
    stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
    stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use
    session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
    Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
    session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
    Regards,
    Tony "Vee Schade" Cook

  • Difference between stateful and stateless session beans

    can any body explain simply what is the difference between stateful and stateless session beans? also in what kind of situations we can use these.

    Hi
    This is the classificatio os Session Bean.
    (1) Statfull
    (2) Stateless
    Stateful means u will persists the state of the object.
    USESE:
    In a Banking system u can use the statful session just for maintaing the
    state.
    (2) STATELESS: that's mean u do't want to persists any state of the object. that's mean a single Request is coming ,do the desire and give the output.
    EX: A Credit Card System is the Example of Stateless.
    May it will helpfull to understands u. if any need write here
    saM

  • How to use jta in toplink and stateless session bean EJB 3.0?

    I have an application with techologies jsf,stateless session bean, adf, toplink
    generated by toplink workbench.
    In web side ı want to use two methods in stateless session bean which are updated
    different tables. I call these methods in my page backing bean.
    I also want to JTA in web side. My first methods is done correctly, but second method has an error. I wanto to rollback all transaction.
    How can ı do that? with using JTA in Toplink...

    Yuichi
    Did you manage to solve this?  I'm doing something similar and seeing the same problem, although they're up to 7.3 SP7.
    Any help greatly appreciated.
    Lewis

  • Hot delpoyment with TopLink and Stateless Session Beans

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    My current setup is as follows using WLS 7.0sp1:
    A stateless session bean is accessing toplink enabled persistent java classes via the SessionManager. I'm currently using the class loader of the stateless session bean:
    * Method in stateless session bean
    * Return the TopLink Session (based on the wls stateless session bean demo)
    public Server getSession() {
              return (Server)SessionManager.getManager().getSession("ejb_sessionbean", this.getClass().getClassLoader());
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.
    Thanks
    Henrik

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.Henrik,
    This is a recent post note I found on the same topic:
    It all hinges on whether the TopLink ServerSession class has
    been loaded by a classloader which is actually thrown away
    during the hot deployment process. If this is the case, then
    hot deployment causes the ServerSession to go out of scope
    and finalize methods take care of logging it out properly.
    If you deploy your TopLink Project on the Sytem class path then
    it definately won't work. You'd have to restart the server every time.
    But if the TopLink Project is deployed inside of an .ear file
    and if you pass the correct ClassLoader to the
    SessionManager.getSession( .... ) call then TopLink Session will
    be re-started when you hot deploy the .earBased on this, the solution might be to deploy your EJBs in an ear file. Everything else looks OK. Can you try this and let us know?
    Thanks,
    Pete Farkas

  • JCo 3.0 Server and Stateless Session Bean

    Hello,
    I use JCO (3.0) and I need to integrate SAP with JBoss.
    The SAP Module is calling EJB-Services over JCo.
    How would the architectur looks like?
    I start with using an MBean to start and stob the native JCO-Server over JMX.
    This still works.
    But it doesn't work:
    The Client(SAP) calls the JCoServer (works fine).
    But the call off the EJB failed.
    What solutions do you have to share?
    Do you use a stateless session bean?
    Best regards
    Peter

    The program ID should be with length 8 max

  • Stateless session Bean - xml and ejb-jar.xml file ???

    Dear Experts,
    Stateless-session bean
    For Creating an ear file
    we need ejb-jar.xml and weblogic-ejb-jar.xml files
    Is these files are already available
    or we have to type these files ??
    Advance Thanks
    Rengaraj.R

    My best advice: surrender to use an IDE.
    You wonder sometimes at how much productivity (read as 'time') could be wasted by doing something that could be done automatically. For a learning experience or a once only exercise is fine but as a routine thing, not worth it.
    Cheers

  • Stateless session beans and idle timeouts (weblogic 10.3.1)

    Need clarification about stateless session beans and the idle-timeout-seconds setting.
    Situation is this – we have a process that is timing out due to an API call to a very slow Authentication server.
    I am trying to resolve this with a code change, but need to further other understand what the server is actually doing.
    We have a session bean which calls another which is calling a util class that does all the work and returns the results back up to the initial session bean. I have left out the ejbName in these examples (it’s irrelevant here).
    Example:
    SessionBean1 // basically called just once a day
    @Session(defaultTransaction = Constants.TransactionAttribute.SUPPORTS,
    enableCallByReference = Constants.Bool.TRUE,
    type = Session.SessionType.STATELESS,
    transTimeoutSeconds = "0",
    initialBeansInFreePool = "0",
    maxBeansInFreePool = "20")
    Methods
    @RemoteMethod() public boolean getUserList(String adminGroup) {
    Map usrList = getUserList(adminGroup);
    Private Map getUserList(String adminGroup) {
         return SessionBean2.getUsers(adminGroup);
    SessonBean2
    @Session(defaultTransaction = Constants.TransactionAttribute.SUPPORTS,
    enableCallByReference = Constants.Bool.TRUE,
    type = Session.SessionType.STATELESS,
    transTimeoutSeconds = "0",
    initialBeansInFreePool = "3",
    maxBeansInFreePool = "20")
    Method
    @RemoteMethod() public Map getUsers(String adminGroup) throws RemoteException {
    return javaUtilClass.getUsers(adminGroup);
    JavaUtilClass
    Method
    public Map getUsers(String adminGroup) throws RemoteException {
         // This is where the work happens, calling the Authentication server to get a complete
         // list of users for an admin group. When the user list is around 1500 entries, this can
         // take an hour. Did I mention this server is very slow? It’s about this threshold of 1500
         // that causes the timeout.
         return Map of users
    First thought, just bump the idle-timeout-seconds setting for the session beans (from the default 600), but that would be a temporary solution until the user list grew larger.
    Second thought, refactor the call to the Authentication Server API to get the user list in blocks of data (say 400 at a time) and decreasing the call/response time between the method getUsers and the API call. This would still occur in the JavaUtilClass, so I am unsure this would make a difference. The session beans would still be idle and subject to timeout, correct?
    Would setting initialBeansInFreePool to 1 in SessionBean1 make any difference?
    Or should I be looking at replicating the re-factored method from the JavaUtilClass in SessionBean1 where the user list is being used so that the API calls come back to it and keep it 'active'?
    Thanks for any advice you could give me on this.

    Hi
    regarding timeouts, there are two ways:
    1.- Changing the settings in the JTA WebLogic domain , called "Timeout Seconds". This will affect globally to all EJB deployed in the domain.
    or
    2.- Specified directly in the bean with a weblogic annotation, like this:
    @TransactionTimeoutSeconds(value = 300)I hope this will help you.
    Regards.
    Felipe

  • It's a WebService and a Stateless Session bean

    Ok,
    I have a Stateless Session Bean that have annotated as a @WebService.
    @Stateless
    @WebService
    public class TravelAgentWSBean {
    I only call it as a WebService, never as a StatelessSessionBean. Do I get the exact same transactional behaviour as if it was a Stateless Session Bean?
    Thanks.

    You could try it like this
    <c:catch var="formatError">
      <fmt:formatNumber value="${row.payment}" type="currency" currencySymbol="" var="pay"/>
    </c:catch>
    <c:if test="${not empty formatError}">
      Error formatting value <c:out value="${row.payment}"/>
    </c:if>

  • Calling EJB 3.0 Stateless Session Bean

    Dear all,
    I created a stateless session bean with a hello world method on it. Now i want to call the method from a BeanDecorator class, through a getter metod. When i use the jndi lookup in my getter, i can call the helloWorld method without a problem. However, when i dont use the jndi lookup, and only use the @EJB annotation, i always get a nullpointer.
    This is working:
    InitialContext ic = new InitialContext();
                   test = (TestLocal)ic.lookup("test.be/ear~bd/LOCAL/TestBean/"+TestLocal.class.getName());
                   test.helloWorld()
    This gives nullpointer:
    @EJB
    private TestLocal test;
    test.helloWorld();
    What is the correct way to consume session beans without having to explicitly code the jndi lookup?
    Kind regards.

    Hi,
    any annotation like this can be used only in "managed classes" like Session Beans, Servlets etc. Managed classes are those classes managed by the J2EE server. Managed here means, lifetime controlled by server.
    You can find this in J2EE specification.
    Frank

  • Null Pointer Exception in Stateless Session Beans(EJB 3.0)

    I am executing a simple HelloUser example i code session bean interface and implementing session bean class in the EJB project.
    package ejb3inaction.ejb;
    import javax.ejb.Remote;
    @Remote
    public interface HelloUser {                                       
    public void sayHello(String name);
    package ejb3inaction.ejb;
    import javax.ejb.Stateless;
    @Stateless
    public class HelloUserBean implements HelloUser {                  
    public void sayHello(String name) {
    System.out.println("Hello " + name + " welcome to EJB 3 In Action!");
    And in the client project i code this class and add JAR file of the EJB project.
    package ejb3inaction.example;
    import javax.ejb.EJB;
    import ejb3inaction.ejb.*;
    public class HelloUserClient {
    @EJB
    private static HelloUser helloUser;
         public static void main(String[] args) {
    helloUser.sayHello("Curious George");
    System.out.println("Invoked EJB successfully .. see server console for output");
    I am using netbeans 6.0(10 M) and Sun Application server 9.
    it gives NullPointer Exception at the following line...
    helloUser.sayHello("Curious George");
    how i can resolve this error.
    regards,
    deemy

    Well, helloUser is just a null reference, you haven't created an instance of HelloUser to use, hence the NPE

  • Problem Deploying EJB3 Stateless session bean in Jboss4.0.3

    Hi All,
    I have developed an EJB 3 Stateless session bean and tried to deploy in JBoss 4.0.3 , But i get the following Exception.
    javax.naming.NameNotFoundException: ejb not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at org.apache.jsp.session_jsp._jspService(org.apache.jsp.session_jsp:69)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    I am sorry if the question is silly..... My Remote Interface will be one like this
    import javax.ejb.Remote;
    @Remote
    public interface CityService {
         public String getCity();
    And My Bean Class will be
    import javax.ejb.EJB;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.EntityTransaction;
    import javax.persistence.PersistenceContext;
    import javax.persistence.Query;
    @EJB
    @Remote(CityService.class)
    @Stateless(mappedName="ejb/CityService")
    public class CityServiceBean implements CityService {
    public String getCity(){
    return "Chennai Metropolitan";
    And the client which invokes the bean will be
    InitialContext ctx = new InitialContext();
    CityService c = (CityService)ctx.lookup("ejb/CityService");
    System.out.println("Msg from Bean"+c.getCity());
    please help me out of this issue....
    Thanks in advance

    ford wrote:
    If you deploy your application in a .ear, you also can use this:
    You have to set a name to your EJBBean -> @Stateless(name = "XXX")
    The client for remote interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Remote");
    The client for local interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Local");the problem with this approach is that if you version your ears, the version numbers show up in the jndi names, and your client code will be hard coded to specific server versions.

  • Call stateless session bean EJB 2.0 from Webdynpro Java UI

    Hello,
    Can someone please tell me asto how to call a stateless session bean EJB 2.0 from Webdynpro Java UI?
    The NWDS version is 7.0.
    Thanks and Regards,
    Arya

    Hi Aryadipta
    Please check this pdfs
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10&overridelayout=true
    Steps for calling stateless session bean in Webdynpro java
    Go to NWDS -> open perspective ->j2ee
    select EJB Module Project ->create a project with name
    Open the Project -->RC on ejb-jar.xml -> Select new --> EJB
    Give name to EJB Bean (First letter should be in capital letters)
    select the type of bean as Stateless session bean and give the package name to store that EJB bean.
    After that Expand ejb-jar.xml and then select the <projectEJB> 
    Double click on this on method  tab double click you will get business method where we will create the methods for business logic
    Double click on projectEJB and then RC on bean tab and write required business logic in bean window as follows(based on requirement we will design a business logic).
    After writing the business logic go to project -> rebuild
    Till now we have created one EJB jar file
    then go to File-->Enterprise Application Project -->create a project (projectEAR)
    After creating a project click on next-> here we will have ear projects and then we select specific project required for our application.(here select projectEJB)
    After that Calculate EAR project will be available on j2ee explorer.
    Right click on <Bean> here
    select New->Web Service->give a name to webservice and select Default configuration type as simple SOAP
    -->click next -> Finish.
    That webservice and related are created in ejb-jar.xml .
    Expand the ejb-jar.xml.and double click on < webservice>
    RC ProjectEJB -> Build EJB Archive RC on CalculateEAR ->Build applicationarchive.
    Expand the projectEAR->RC on CalculateEAR.ear->Deploy to J2EE Engine
    Double click on calculateEAR.ear ->Webservice navigator tab ->we eill servers expand the node
    select the specific WebService  
    Here we test the webservice by click on Test and test it.
    After that go to Web dynpro perspective ->create one webdynpro Project and one component
    RC on model> Select import Web Service model(last)>give model name and package
    and select radio button as local file system or URL
    Go to WSnavigator->copy the WSDL path and paste it in model WSDL path and click on finish.
    from here onwards steps are same as that adaptive RFC model
    Hope it helps
    Thanks
    Tulasi Palnati
    Edited by: Tulasi Palnati on Aug 26, 2009 12:15 PM
    Edited by: Tulasi Palnati on Aug 26, 2009 12:43 PM

  • How to integrate hibernate with Stateless Session bean in weblogic10.0

    Hi,
    I need to invoke hibernate(3.x) DAO from EJB Stateless Session bean(EJB2.x). I am using mysql database. Can somebody please post the configuration.
    Thanks in advance,
    Rushi.

    Hi Deepak,
    Thanks for your reply.
    Actually, our stand alone java application already using spring-hibernate feature. Now we are planning divide our application into modules and deploy each module as ejb beans. As it is already integrated with spring-hibernate we are not using entity beans as of now. My understanding is container uses some default transcation management .so, my question is what are all the configurations needs to be done to let weblogic 10.0 server uses org.springframework.orm.hibernate3.HibernateTransactionManager. I mean, is there are any .xml file in weblogic to configure all these? please reply deepak I am struck here..
    Regards,
    Rushi.

  • Calling Local Stateless session bean from Spring in weblogic 10.3

    We are in the process of upgrading to Weblogic 10.3 from OC4J (OAS). We are using Spring and Stateless Session EJB 3 Local beans (Don't ask me why, it is decided before I came to the project).
    Previously (OC4J):
    -> There is no ejb-jar.xml. EJBs are configured with annotation @Stateless. No "name" or "mappedName" are defined.
    Spring POJOs access EJBs by using "EJBMODULENAME_<<EJBBeanClass>>Local" as JNDI Name. I think this strange JNDI name is what OC4J assigns when there is no explicit JNDI name defined.
    Sample Spring Bean configuration -
    <bean name="securityEJB" class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean" lazy-init="true">
              <property name="jndiName">
                   <value>myapp-ejb_SecurityEJBImplLocal</value>
              </property>
              <property name="resourceRef">
                   <value>false</value>
              </property>
              <property name="businessInterface">
                   <value>my.package.SecurityEJB</value>
              </property>
         </bean>
    I understand that weblogic 10.x doesn't give any global JNDI name (JNDI tree is empty) and also looked at the blog, Link: [http://m-button.blogspot.com/2008/07/reminder-on-how-to-use-ejb3-with.html]
    So far I have tried,
    1. @EJB annotation works but, I don't want to add @EJB annotations in the entire application. Since we are using Spring and EJB3, I am trying to avoid mixing them -
    2. java:comp/env is supposed to work (since it is a local session bean), but it doesn't for me.
    I haven't added weblogic-ejb-jar.xml as I don't think it is going to help, as there is no global JNDI name defined. Am I missing some thing?
    Thx

    Hi,
    if you don't want to use @EJB to inject the EJB, then you'll need declare the EJB reference in deployment descriptor.
    Here is an example copied from EJB3 spec:
    <ejb-local-ref>
    <description>
    This is a reference to the local business interface
    of an EJB 3.0 session bean that provides a payroll
    service.
    </description>
    <ejb-ref-name>ejb/Payroll</ejb-ref-name>
    <local>com.aardvark.payroll.Payroll</local>
    </ejb-local-ref>
    then you can lookup the local ejb from "java:comp/env/ejb/Payroll".

Maybe you are looking for

  • I'd like to go back to Snow Leopard from Lion.What should I look out for?

    I downloaded OS X Lion from the Mac App Store back in February, and I'm getting sick of Lion so I'd like to go back to Snow Leopard. I have the install disc. Will all of my files be used in Snow Leopard, or will I have to save all of them?

  • Issue w/ param injectio and c:import

    I'm experiencing a problem injecting a param into a request scoped backing bean while performing a JSTL import on a jsf page. A example of the task I am trying to do is the following... I have a page that imports another page: <f:subview id="idForReg

  • Infopath form people picker not working in outlook 2010

    Hi, I have created custom task form which has reassign feature. If the form is opened in IE, people editor control is working but in outlook account names are not resolved and dictionary also not working. There should be some work around as OOTB  app

  • Trouble accessing tv shows

    I just purchased the Apple TV today. The wireless internet is all setup and working fine. Music syncs fine. I have 16 episodes of my favorite TV show that I purchased via iTunes and they are on my PC. The syncing function works fine but when I try to

  • Which table stores the Tax percentage rate of commercial invoice?

    Which data base table stores the tax percentage rate of the items in a commercial invoice? Or which FM can return the tax percentage rate?