Stateless EJB is null using TimerService

Hi,
I created a stateless ejb using TimerService to run it in weblogic 10.3. After deploying it, I could not get the ejb instantiated properly. The code is as below.
Could anyone explain what is missing?
Thanks in advance.
//=================================================
public interface ReconTimer {
public void createTimer();
//================================================
import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerService;
import javax.ejb.Local;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
@Stateless (name="ReconTimerBean")
@Local (ReconTimer.class)
@TransactionManagement(value=TransactionManagementType.BEAN )
@TransactionAttribute(value=NOT_SUPPORTED)
public class ReconTimerBean implements ReconTimer {
     private static final Log log = LogFactory.getLog(ReconTimerBean.class);
@Resource
TimerService timerService;
public void createTimer() {
     log.info("Crating timer");
     log.info("timerService [" + timerService + "]");
Timer timer = timerService.createTimer(20000,
"Created new timer");
@Timeout
public void timeout(Timer timer) {
log.info("Timeout occurred !!!");
========================================
client code:
@EJB(beanName="ReconTimerBean")
ReconTimer timerBean
if (timerBean != null)
timerBean.createTimer();
else log.error ("Timer Bean is null !!!");
Error is always logged when the bean is deployed.
======================================
weblogic-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar"
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
     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/ejb-jar_3_0.xsd http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>ReconTimerBean</ejb-name>
     <stateless-session-descriptor>
          <pool>          
               <max-beans-in-free-pool>1</max-beans-in-free-pool>          
               <initial-beans-in-free-pool>1</initial-beans-in-free-pool>     
          </pool>
     </stateless-session-descriptor>
<jndi-name>app-recon-bean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

Hi Ashley,
The Dependency injection has some limitations as well…Please referto the following link: (Web Component Classes That Support Annotations)
http://download.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/annotateservlet.html
…Which says that DI is not possible from every web component.
Thanks
Jay SenSharma
http://jaysensharma.wordpress.com/ejbs_weblogic/#comment-165  (Dependency Injection Issues)

Similar Messages

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • Stateless EJB using Threads

    Helo Everyone !
    Recently I developed a Stateless EJB where I used a Thread to receive asynchronously client calls. After that I read some Bea articles describing the MDB (Message Drive Beans) and I discovered another way to resolve asynchronously calls. By the way I'd like to know if I can have some problems in the future using threads instead MDB. Do you know some articles where bea doesn't approve the threads usage.
    Thank you
    Regards

    If you're using WLS 9.x, then I'd suggest you have a look at the WorkManager API. It allows you to start asynchronous work (in a BEA-approved way) and have it just invoke a java.lang.Runnable.
    I would use a MDB if you want transactions or you want the scheduled work to be persistent or highly-available.
    While many customers do it, we attempt to discourage users creating threads in the server.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Transaction problems in Stateless EJB

    I have problems as follows. my client is a servlet which call method B in stateless ejb, In side of method B, there is a loop from which antoher method C in this same ejb is called repeatedly. I want each call of method C being a separate transaction. I can not make this work. the final result will always be one transaction from for loop. I set the transaction attribute as Requires for method B, and Requires New for method C. Please offer some help.
    Thanks.
    void ejbMethodB(){
    where(mycondition)
    ejbMethodC()
    I like to make each call of ejbMethodC be a standalone transaction instaed of the running results from the whole loop being a transaction

    First of all, thank you so much for your time.
    I also doubt the problem is Resin. But "Required" attribut works fine. The following is the coding:
    EJB implementation:
    //mehtodB
    public RequestResult getDailyCreateUpdateInfo(Request request)
    throws RemoteException, ProcessException
    boolean testFlag = false;
    List resultList = null;
    ClaimsDAO dao = null;
    Map mapRequestData = getRequestData(request);
    int num = 0;
    InterfacePushProcess push_process = (InterfacePushProcessRemote)(mySessionCtx.getEJBLocalObject());
    try {
    //Call DAO and get Student, ExchangeVisitor and their dependent information
    dao = (ClaimsDAO) getEntityObject(ClaimsDAO.class.getName());
    dataPushBO = new ClaimsDataImpl(mapRequestData);
    //get the list of categories for DOS or US-VISIT
    interdataList = dataPushBO.createCategoryList();
    Iterator iterator = interdataList.iterator();
    System.out.println("before invokeTransacprocess. ");
    //testing
    this.invokeTransacProcess();
    //process all the categories for DOS or US-VISIT
    while(iterator.hasNext())
    interconfigData = (InterfaceDataConfig) iterator.next();
    processOneCategory(mapRequestData, interconfigData, dao);
    } catch (Exception e) {
    mySessionCtx.setRollbackOnly();
    log.logp(Level.SEVERE, classname, "getDailyCreateUpdateInfo", e.getMessage());
    Object[] args = createExceptionArgs();
    args[0] = request.getName();
    throw new ProcessException(IMessage.ENTITY_POPULATION_FAILED, args, e);
    return new RequestResult(request, resultList);
    //mehtodC
    public void processOneCategory(Map reqmap, InterfaceDataConfig interconfigData, ClaimsDAO dao)
    throws ProcessException
    List pageList = null;
    String fileType = interconfigData.getGroupName(); //student, dep etc
    String countKey = interconfigData.getCountKey();
    String logKey = interconfigData.getIDKey();
    UserTransaction trans = null;
    int count = 0;
    boolean process = false;
    String groupname = interconfigData.getGroupName();
    log.logp(Level.INFO, classname, "processOneCategory() ", "group name = " + groupname);
    try
    Context ct = new InitialContext();
    trans = (UserTransaction) ct.lookup("java:comp/UserTransaction");
    trans.begin();
    String startTime = convert.getTimestamp();
    log.logp( Level.INFO, classname, "processOneCategory() ", "processing start time: "+startTime);
    pageList = processOnePage(interconfigData, dao);
    if (pageList.isEmpty())
    log.info("There are no records which need be processed.");
    else
    do
    try
    this.displayResult(pageList);
    process = pageOutputProcessor(reqmap, interconfigData, pageList);
    pageList.clear();
    pageList = this.processOnePage(interconfigData, dao);
    } catch (Exception ex) {
    mySessionCtx.setRollbackOnly();
    String msg = "Error while processing one page : " + ex.getMessage();
    log.logp(Level.SEVERE, classname, "processOneCategory() ", msg);
    throw new ProcessException(msg);
    } while (!pageList.isEmpty());
    //testing separate transaction
    if(groupname.equalsIgnoreCase("STUDENT"))
    trans.commit();
    else
    trans.rollback();
    } catch (Exception t) {
    mySessionCtx.setRollbackOnly();
    String m = "Error when processing results from ClaimsDAO's : " + t.getMessage();
    log.logp(Level.SEVERE, classname, "processOneCategory() ", m);
    throw new ProcessException(m);
    } finally {
    I put both methods: getDailyCreateUpdateInfo and processOneCategory in remote interface so I can use your suggested method to reference the EJB instance.
    Servlet Client call "getDailyCreateUpdateInfo" method (the transaction attribute is Required) in which call processOneCategory(,,) method (transaction attribute is RequiresNew).
    I put some testing code to see if I can achieve the separate transaction in each call of mehtod processOneCategory(,,) , it does not work. If I use Bean Managed Transaction, it works right away. My app. server is Resin 2.1.4.
    Again, Thank you.
    Mark

  • EJB 3.0 @Stateless @EJB @Resource and JNDI clarity..

    Hi,
    I am trying to configure an EJB 3.0 but not able to do so properly.
    I have a single business interface and 2 bean implementation class of the same business interface doing different things. How do I access the EJB's if I have the same business interface class.I am getting JNDI error while trying to lookup.
    Also what does the "name" and "mappedName" in @Stateless(name ="...",mappedName="") signify.
    Then in case of Dependency injection,how should I look for the EJB? What would be it's JNDI name in this case?
    @EJB(name="",beanName="",mappedName="")
    private HelloEJB hello;
    What does the name,benaName and mappedName in case of an @EJB annotation signify??
    Please clear me with these attributes of @Stateless and @EJB and @Resource. I am getting toatlly confused with what should be the logic name and what is the JNDI name????
    Thanks

    In @Stateless, @name() is the annotation equivalent of <ejb-name> in ejb-jar.xml. It gives a unique bean name identifier to the component within the ejb-jar. It is completely independent of mappedName. If no @Stateless name() is specified, it defaults to the unqualified bean class name.
    In @Stateless, mappedName() is used to assign a global JNDI name to the bean's remote interface. This can be used to explicitly lookup the EJB reference to that interface or as one way to resolve a caller's EJB dependency.
    In @EJB, if the target of the dependency lives within the same application, you can always fully resolve it using only beanName(). beanName() takes the value specified in @Stateless name(), or the default as described above.
    @EJB name() assigns a name to the client dependency within the caller's component environment. It is optional. In most cases that value doesn't matter since if the dependency is being injected you never have to refer to the name() attribute anywhere else.
    @EJB mappedName() is used to resolve an EJB dependency that spans applications. It holds a global JNDI name, e.g. the one specified in @Stateless mappedName(). mappedName() is not required to be supported by all vendors.
    So, to sum it all up, it's fine to have two different beans that expose the same interface. E.g. :
    @Stateless(name="A1", mappedName="A1Global")
    public class A1 implements A { ... }
    @Stateless(mappedName="A2Global") // name() defaults to "A2"
    public class A2 implements A { ... }
    In a caller within the same application :
    @EJB(beanName="A1")
    private A a;
    @EJB(beanName="A2")
    private A a;
    In a caller within a different application :
    @EJB(mappedName="A1Global")
    private A a;
    @EJB(mappedName="A2Global")
    private A a;
    You can find additional information in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref

  • Stateless EJB 3.0 to webservice

    Hello,
    I'm using EJB 3.0 deployed on weblogic server 10. I can deploy Stateless EJB without any problem.
    If I add a @WebService tag above my stateless bean, my deployment fails with the following error:
    Exception activating module: EJBModule(EfanetTA_EJB.jar) Unable to deploy EJB: ProfilesFacade from EfanetTA_EJB.jar: Unable to deploy EJB: EfanetTA_EJB.jar from EfanetTA_EJB.jar: [HTTP:101216]Servlet: "WSEE_SERVLET" failed to preload on startup in Web application: "/BusinessManager". class: lu.efa.ejb.jaxws.FindProfilesById could not be found at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:272) at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:566) at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:513) at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:358) at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:245) at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:229) at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:161) at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:291) at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:315) at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:125) at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:64) at javax.servlet.GenericServlet.init(GenericServlet.java:241) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:282) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:63) at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1830) at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1807) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1727) at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2890) at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:948) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:353) at weblogic.wsee.deploy.WseeWebappModule.activate(WseeWebappModule.java:139) at weblogic.wsee.deploy.WSEEEjbModule.activate(WSEEEjbModule.java:371) at weblogic.wsee.deploy.WsEJBDeployListener.activate(WsEJBDeployListener.java:52) at weblogic.ejb.container.deployer.EJBDeployer.activate(EJBDeployer.java:1414) at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:423) at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107) at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:381) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:71) at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:63) at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154) at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104) at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139) at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320) at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:816) at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1223) at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:434) at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200) at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    Thank's for your help.
    Thomas

    I am facing a new problem, i tried to create the folowing build script:
    <project default="build_artefacts">
         <taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
              <classpath refid="jaxws.classpath" />
         </taskdef>
         <target name="compile-server">
              <echo message="Compiling server classes" />
              <javac destdir="target/classes" includes="**/com/**">
                   <src path="com/b2winc/controlpanel/business/facade/customer" />
                   <classpath refid="project.classpath" />
              </javac>
         </target>
         <target name="apt" depends="compile-server">
              <apt destdir="${build}" sourcedestdir="${generated}" sourcepath="${src}">
                   <classpath refid="jaxws.classpath" />
                   <source dir="${src}">
                        <include name="**com/b2winc/controlpanel/business/*.java" />
                   </source>
              </apt>
         </target>
         <target name="build_artefacts" depends="apt">
              <echo message="${src}"></echo>
              <taskdef name="antwsgen" classname="com.sun.tools.ws.ant.WsGen"
                   classpath="${src}jaxws/lib/jaxws-tools.jar" />
              <antwsgen
                   sei="CustomerFacade" verbose="true"
                   destdir="target/classes" sourcedestdir="target/temp" >
                   <classpath path="jaxws.classpath"/>
              </antwsgen>
         </target>
         <path id="jaxws.classpath">
              <pathelement path="jaxws-ri-121/lib/jaxws-tools.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxb-api.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxb-impl.jar" />
              <pathelement path="jaxws-ri-121/lib/jaxws-api.jar" />
         </path>
    </project>     I used this guideline: http://today.java.net/pub/a/today/2006/06/13/web-services-with-jax-ws-2.0.html
    And i get the following error:
          [apt] An exception has occurred in apt (1.5.0_11). Please file a bug at th
    e Java Developer Connection (http://java.sun.com/webapps/bugreport)  after check
    ing the Bug Parade for duplicates. Include your program and the following diagno
    stic in your report.  Thank you.
          [apt] java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactoryThe strange thing, that this class belongs to the tools.jar inside my JDK 5.
    Thanks
    Carlos

  • Javax.ejb.EJBException: Null primary key returned by ejbCreate method

    Hi all,
    I'm using SunOne 7.1 and I got this error when I call the create on the CMP bean.
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: Null primary key returned by ejbCreate method
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: javax.ejb.EJBException: Null primary key returned by ejbCreate method
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.ejb.containers.EntityContainer.postCreate(EntityContainer.java:801)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at uk.co.upco.workflow.applicationAdmin.ejb.ApplicationAdminBean_854379388_ConcreteImpl_LocalHomeImpl.createNewApplication(ApplicationAdminBean_854379388_ConcreteImpl_LocalHomeImpl.java:64)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at uk.co.upco.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean.insertNewApplicationName(SFApplicationAdminBean.java:64)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at uk.co.upco.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean_EJBObjectImpl.insertNewApplicationName(SFApplicationAdminBean_EJBObjectImpl.java:31)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at uk.co.upco.workflow.sessionFacedeApplicationAdmin._SFApplicationAdminBean_EJBObjectImpl_Tie._invoke(Unknown Source)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:569)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:211)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:113)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:275)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:83)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.iplanet.ias.corba.ee.internal.iiop.ServicableWrapper.service(ServicableWrapper.java:25)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at com.iplanet.ias.util.threadpool.FastThreadPool$ThreadPoolThread.run(FastThreadPool.java:283)
    [14/Aug/2004:01:15:34] WARNING ( 4044): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    cmp:
    public java.lang.Integer ejbCreateNewApplication(java.lang.String application) throws javax.ejb.CreateException {
    setApplication(application);
    return null;
    The key is auto_increment and is an integer.
    I'm usin MySQL and it is already set up as ANSI. (running as mysqld --ansi)
    Any Idea?
    Thanks in advance

    What happend when two concourrent user try to get the same key on the table? If for example I have 30 users at same time do I have lock table?
    Any way here the finest log using sunone 8. The error is the same, so I think I missing something:
    [#|2004-08-14T12:11:19.296+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.util|_ThreadID=11;|IM: preInvokeorg.apache.catalina.servlets.DefaultServlet@1acecf3|#]
    [#|2004-08-14T12:11:19.296+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.util|_ThreadID=11;|IM: postInvokeorg.apache.catalina.servlets.DefaultServlet@1acecf3|#]
    [#|2004-08-14T12:11:26.166+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: returning cached ProtectionDomain - CodeSource: ((file:/Test <no certificates>)) PrincipalSet: null|#]
    [#|2004-08-14T12:11:26.166+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: Changing Policy Context ID: oldV = null newV = Test|#]
    [#|2004-08-14T12:11:26.166+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: Access Control Decision Result: true EJBMethodPermission (Name) = SFApplicationAdmin (Action) = create,Home, (Codesource) = (file:/Test <no certificates>)|#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: returning cached ProtectionDomain - CodeSource: ((file:/Test <no certificates>)) PrincipalSet: null|#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: Access Control Decision Result: true EJBMethodPermission (Name) = SFApplicationAdmin (Action) = insertNewApplicationName,Remote,java.util.Hashtable (Codesource) = (file:/Test <no certificates>)|#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.util|_ThreadID=22;|IM: preInvokeuk.co.myDomain.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean@1fa487f|#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: doAsPrivileged contextId(Test)|#]
    [#|2004-08-14T12:11:26.186+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.stream.out|_ThreadID=22;|
    new|#]
    [#|2004-08-14T12:11:26.186+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.stream.out|_ThreadID=22;|
    mgmt: com.sun.enterprise.naming.TransientContext:com.sun.enterprise.naming.TransientContext@ad00b2|#]
    [#|2004-08-14T12:11:26.186+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.stream.out|_ThreadID=22;|
    new|#]
    [#|2004-08-14T12:11:26.186+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.stream.out|_ThreadID=22;|
    SFApplicationAdmin: javax.naming.Reference:Reference Class Name: reference
    Type: url
    Content: ejb/SFApplicationAdmin
    |#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: returning cached ProtectionDomain - CodeSource: ((file:/Test <no certificates>)) PrincipalSet: null|#]
    [#|2004-08-14T12:11:26.186+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.core.security|_ThreadID=22;|JACC: Access Control Decision Result: true EJBMethodPermission (Name) = ApplicationAdmin (Action) = createNewApplication,LocalHome,java.lang.String (Codesource) = (file:/Test <no certificates>)|#]
    [#|2004-08-14T12:11:26.196+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.container.ejb|_ThreadID=22;|[Pool-ApplicationAdmin]: Added PoolResizeTimerTask...|#]
    [#|2004-08-14T12:11:26.196+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.util|_ThreadID=22;|IM: preInvokeuk.co.myDomain.workflow.applicationAdmin.ejb.ApplicationAdminBean_1421299025_ConcreteImpl@7ae165|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|:Thread[Worker: 16,5,org.apache.commons.launcher.ChildMain] -->SQLPersistenceManagerFactory.getPersistenceManager().|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|Thread[Worker: 16,5,org.apache.commons.launcher.ChildMain] <->SQLPersistenceManagerFactory.getPersistenceManager() FOUND javax.transaction.Transaction: com.sun.ejb.containers.PMTransactionImpl@5.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|<--SQLPersistenceManagerFactory.getFromPool().|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|PersistenceManagerImpl cache properties: _txCacheInitialCapacity=20, _flushedCacheInitialCapacity=20, _flushedCacheLoadFactor=0.75, _weakCacheInitialCapacity=20, _weakCacheLoadFactor=0.75.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.utility|_ThreadID=22;|NullSemaphore constructor() for PersistenceManagerImpl.cacheLock.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.utility|_ThreadID=22;|NullSemaphore constructor() for PersistenceManagerImpl.fieldUpdateLock.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|<--SQLPersistenceManagerFactory.getFromPool() PM: com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl@8d18c for JTA com.sun.ejb.containers.PMTransactionImpl@5.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|<->SQLPersistenceManagerFactory.getPersistenceManager() JDO Transaction:   Transaction:
    status = STATUS_NO_TRANSACTION
    Transaction Object = Transaction@16077795
    threads = 0
    .|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.transaction|_ThreadID=22;|Thread[Worker: 16,5,org.apache.commons.launcher.ChildMain] Tran[   Transaction:
    status = STATUS_NO_TRANSACTION
    Transaction Object = Transaction@16077795
    threads = 0
    ].begin:status = STATUS_NO_TRANSACTION ,txType: UNKNOWN for com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl@8d18c.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.transaction|_ThreadID=22;|Thread[Worker: 16,5,org.apache.commons.launcher.ChildMain] Tran[   Transaction:
    status = STATUS_NO_TRANSACTION
    Transaction Object = Transaction@16077795
    threads = 0
    ].setStatus: STATUS_NO_TRANSACTION => STATUS_ACTIVE for com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl@8d18c.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|Thread[Worker: 16,5,org.apache.commons.launcher.ChildMain] <->SQLPersistenceManagerFactory.getPersistenceManager() : com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerImpl@8d18c for JTA: com.sun.ejb.containers.PMTransactionImpl@5.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|---PersistenceManagerImpl.getCurrentWrapper() > current: null.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|---PersistenceManagerImpl.pushCurrentWrapper() > current: null  new: com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper@567117.|#]
    [#|2004-08-14T12:11:26.196+0100|FINEST|sun-appserver-pe8.0|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=22;|---PersistenceManagerImpl.popCurrentWrapper() > current: com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerWrapper@567117  prev: null.|#]
    [#|2004-08-14T12:11:26.196+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.util|_ThreadID=22;|IM: postInvokeuk.co.myDomain.workflow.applicationAdmin.ejb.ApplicationAdminBean_1421299025_ConcreteImpl@7ae165|#]
    [#|2004-08-14T12:11:26.196+0100|FINE|sun-appserver-pe8.0|javax.enterprise.system.container.ejb|_ThreadID=22;|Exception in forceDestroyBean()
    java.lang.IllegalStateException: Primary key not available
         at com.sun.ejb.containers.EntityContextImpl.getPrimaryKey(EntityContextImpl.java:114)
         at com.sun.ejb.containers.EntityContainer.forceDestroyBean(EntityContainer.java:1232)
         at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:2559)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2416)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:763)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:197)
         at $Proxy10.createNewApplication(Unknown Source)
         at uk.co.myDomain.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean.insertNewApplicationName(SFApplicationAdminBean.java:64)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.insertNewApplicationName(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:651)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
         at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    |#]
    [#|2004-08-14T12:11:26.196+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.container.ejb|_ThreadID=22;|EJB5018: An exception was thrown during an ejb invocation on [ApplicationAdmin]|#]
    [#|2004-08-14T12:11:26.196+0100|INFO|sun-appserver-pe8.0|javax.enterprise.system.container.ejb|_ThreadID=22;|
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: java.lang.IllegalArgumentException: JDO73013: Primary Key field applicationId for bean 'ApplicationAdmin' cannot be null.
    java.lang.IllegalArgumentException: JDO73013: Primary Key field applicationId for bean 'ApplicationAdmin' cannot be null.
         at com.sun.jdo.spi.persistence.support.ejb.cmp.JDOEJB11HelperImpl.assertPrimaryKeyFieldNotNull(JDOEJB11HelperImpl.java:446)
         at uk.co.myDomain.workflow.applicationAdmin.ejb.ApplicationAdminBean_1421299025_ConcreteImpl.setApplicationId(ApplicationAdminBean_1421299025_ConcreteImpl.java:102)
         at uk.co.myDomain.workflow.applicationAdmin.ejb.ApplicationAdminBean.ejbCreateNewApplication(ApplicationAdminBean.java:93)
         at uk.co.myDomain.workflow.applicationAdmin.ejb.ApplicationAdminBean_1421299025_ConcreteImpl.ejbCreateNewApplication(ApplicationAdminBean_1421299025_ConcreteImpl.java:334)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:140)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:168)
         at $Proxy10.createNewApplication(Unknown Source)
         at uk.co.myDomain.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean.insertNewApplicationName(SFApplicationAdminBean.java:64)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.insertNewApplicationName(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:651)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
         at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: java.lang.IllegalArgumentException: JDO73013: Primary Key field applicationId for bean 'ApplicationAdmin' cannot be null.
         at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:2564)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2416)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:763)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:197)
         at $Proxy10.createNewApplication(Unknown Source)
         at uk.co.myDomain.workflow.sessionFacedeApplicationAdmin.SFApplicationAdminBean.insertNewApplicationName(SFApplicationAdminBean.java:64)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.insertNewApplicationName(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:651)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
         at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    |#]
    Any Idea?
    Thanks in advance for any help

  • EJB is null

    Hello,
    I have a problem whit the EJB injection. The @EJB returns null and I dont know why :(. I'm using JBoss 7.1.0.Final-Snapshot-2, maven and arquillian.
    In the surfire reports it shows:
    SubscriptionSaveTest(com.project.scr.prj.service.SubscriptionServiceTest) Time elapsed: 0.015 sec <<< FAILURE!
    java.lang.NullPointerException
    at com.project.scr.prj.service.SubscriptionServiceTest.SubscriptionSaveTest(SubscriptionServiceTest.java:98)
    public class SubscriptionServiceTest {
    private final String TEST_VALUE = "test";
    @Deployment
    public static WebArchive createTestArchive() {
    return ShrinkWrap.create( WebArchive.class,"test.war").addPackages(true,"org.joda.time").addPackages(true, "javax.jcr").addClasses(com.mysql.jdbc.log.Log.class,com.project.scr.prj.model.Subscription.class).addPackage("org.slf4j").addPackage("org.slf4j.spi").addPackage("org.slf4j.helpers").addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml").addAsWebInfResource("beans.xml", "META-INF/beans.xml");
    @EJB(name ="subscriptionService")
    private SubscriptionService subscriptionService;
    @BeforeTest
    @UsingScript("import.sql")
    public void setUp()
    public Subscription FillSubscription(){
    System.out.println("TEST"+subscriptionService); // in the console shows null
    //persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Persistence deployment descriptor for dev profile -->
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://java.sun.com/xml/ns/persistence
    http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
         <persistence-unit name="prj-unit">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <jta-data-source>java:jboss/datasources/prjtest</jta-data-source>
              <properties>
                   <property name="hibernate.hbm2ddl.auto" value="update" />
                   <property name="hibernate.show_sql" value="false" />
              </properties>
         </persistence-unit>
    </persistence>
    Best Regards

    Hi Ashley,
    The Dependency injection has some limitations as well…Please referto the following link: (Web Component Classes That Support Annotations)
    http://download.oracle.com/docs/cd/E13222_01/wls/docs100/webapp/annotateservlet.html
    …Which says that DI is not possible from every web component.
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/ejbs_weblogic/#comment-165  (Dependency Injection Issues)

  • Stateless EJB blocks

    Hi.
    I've an stateless ejb that calls another stateless ejb. The two EJB's use Entity Beans though the database schema is different.
    Here's the snippet of code:
        public Libro insertarLibro( String codigo,
                                    Long ejemplar,
                                    Calendar dataPublicacion,
                                    String isdn,
                                    String titulo,
                                    String cifEditorial,
                                    String nifAutor) throws SGLException,
                                                           StockException,
                                                           Exception {
            ServiceFacade01EJBClient externalSystemProxy = new ServiceFacade01EJBClient();                                                      
            StockFacadeEJB stockFacade = SglServiceLocator.getInstance().getStockFacadeEjb();
            stockFacade.addBook(getLibroDto(libro));
            em.persist(libro);
            em.getTransaction().commit();
            return libro;
        }The problem is that the blocking is random. Sometimes it blocks in this line:
    stockFacade.addBook(getLibroDto(libro));
    Other times it returns normally but then blocks (I use JDeveloper).
    The odd thing is that sometimes the data is written in the database. Other times not.
    On the called ejb the data is always written. But on the caller the data is not written.
    I'm using same database instance but different users/schemas for the two stateless EJB's.

    Or is it becoz the two methods that it objected to were returning user-defined objects and not String, void, Integer ... that a web service can recognize !
    But still ... why cannot it just ignore the methods that are not exposed ?
    Can someone throw some light on this.
    Thanks,
    Krishna

  • Error with stateless EJB

    Hi,
    I am new to WebLogic and I trying to learn it. I was doing an exercise with a stateless EJB I got from a book and get this error:
    javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory. Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory
         at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    That class is already in my class path and still does not work. I am using WLS 8.1 on a Linux Suse 9.0 OS, and my IDE is Eclipse. The code seems to be fine seems it is deployed flawlessly by the server. No errors, no warnings. I can post if some one needs to see it. Any ideas?
    Thanks!

    If anyone is interested, and since it seems to be a common anoying problem, the solution is to put the weblogic.jar files in the classpath, and all of the client ones as well.

  • Ignored contextPath of a JAX-WS web service as a stateless EJB.

    Hello,
    I have a JAX-WS web service implemented as a stateless session EJB and I use the jwsc ANT task to build the JAR file. I need to set a specific context root of the web service. How can I do that?
    I have tried setting the contextPath attribute in the jwsc ANT task (on module, jws, WLHttpTransport) but it is ignored. When I remove the EJB-specific annotations from the JWS file the jwsc ANT task generates a WAR file with the proper contextPath set but when EJB JAR is generated contextPath is ignored.
    Thank you for your help.
    JBoris

    I found an example in the WLS 10.3 documentation. Here is the link: http://edocs.bea.com/wls/docs103/webserv/webservTOC.html
    The documentation provides examples for from WSDL and from Java.
    Happy reading :-)

  • Stateless ejb stats VIA SNMP?

    Using WL 8.1 SP3(ish) and I'm trying to retrieve stateless EJB stats via SNMP.
    However, a snmpwalk of 1.3.6.1.4.1.140.625.170 reveals nothing.
    The MIB states this is ejbStatelessHomeRuntimeTable.
    Ideas?
    Thanks
    Bob

    Bob,
    Sorry, this looks like a bug, please contact support, [email protected]
    Thanks,
    -satya
    Bob Cotton wrote:
    Using WL 8.1 SP3(ish) and I'm trying to retrieve stateless EJB stats via SNMP.
    However, a snmpwalk of 1.3.6.1.4.1.140.625.170 reveals nothing.
    The MIB states this is ejbStatelessHomeRuntimeTable.
    Ideas?
    Thanks
    Bob

  • Javax ejb CreateException: Could not create stateless EJB

    Hi,
    I have a JavaEE (EJB3.0) project deployed on glassfish2.1 as -.ear (exported from eclipse3.4 to the autodeploy-folder) with -.ejb.jar, -.webui.war, general-lib-base.jar (some other...)
    The session bean is invoked by a jsf-managed bean. Have a pure annotation +@ejb+ in managed bean (identifiing the ejb-interface (+@Remote+) ...the ejb is annotated with +@stateless+
    get the following error message:
    *...nested exception is: javax.ejb.CreateException: Could not create stateless EJB*
    as beginner in the JavaEE-field I'm looking for some help concerning the possible causes.
    thank's for any comment...
    (also posted in the Enterprise JavaBeans-forum possibly better there)

    problem fixed: in the deployment-descriptor ejb-jar.xml a spezification of the session-bean hung around ...very annoying!

  • Parsing ejb-jar.xml using jaxb

    hi all,
    how to parse the ejb-jar.xml using jaxb? can anybody send the information about the API which we have to use to parse the ejb-jar.xml? (ejb2.0)
    i need the details about all ejbs in an application, (like jndi name, Home and Remote name). so, how can i parse the ejb descriptors?
    regards,
    panneer

    Hi Panneer,
    Well, parsing the EJB descriptors is, in principle, a task for the EJB container where they are deployed. From what you wrote I assume that you need to gather that kind of info to visualize in some (monitoring?) tool. Is that correct?
    If so, the question would be whether you have access to the EJB jar on the file system (before it's deployed) or you can only connect to the server with the already deployed EJBs. In the latter case, this information is shown in the [NWA plugins|http://help.sap.com/saphelp_nwce10/helpdata/en/0b/5b5a42ea221153e10000000a155106/frameset.htm]. There are also some [telnet commands|http://help.sap.com/saphelp_nw04/helpdata/en/79/3cf82ade038d45a21fbfdaee349b22/frameset.htm] in NW 04 and 7.0 (04s).
    If you have access to the EJB jar file, you can parse the descriptors using DOM or SAX, but I'm not aware of any pre-defined JAXB API for this purpose. Probably you can also generate the mapped classes yourself and use them, however I'm not sure how that works with DTD (because of EJB 2.0).
    HTH!
    \-- Vladimir

  • Stateless EJB (exposed only one fn) as a web service - Error illegal public

    I have a stateless EJB which has 3 methods.
    I expose one of them only as a web service.
    But when I test my web service I receive an error...
    500 Internal Server Error
    Servlet error: The class blah.blah.I_EmpRemote contains illegal public methods.
    These methods do not conform to the
    restrictions imposed by the web service implementation
    Offending methods:
    public abstract blah.blah.Employee blah.blah.I_EmpRemote.GetEmployee(java.lang.String) throws java.rmi.RemoteException
    public abstract blah.blah.Operator blah.blah.I_EmpRemote.GetOperator(java.lang.String,int) throws java.rmi.RemoteException
    So does this mean .. I should make sure all or none of my methods of an EJB are exposed in the Web Service ?
    Or I can resolve this in any other way ?
    Thanks,
    Krishna

    Or is it becoz the two methods that it objected to were returning user-defined objects and not String, void, Integer ... that a web service can recognize !
    But still ... why cannot it just ignore the methods that are not exposed ?
    Can someone throw some light on this.
    Thanks,
    Krishna

Maybe you are looking for