Servlet - EJB, caching home & context problem

Hello,
I just run into the following problem:
I created a thin client which accesses the EJB's via a servlet.
In this servlet I cached the InitialContext und and the reference
to the Home interface. While creating the initial context I provided
login/password to access the EJB so it can't be accessed from the guest
user.
The first method call works as expected, any further call results
in a RemoteException - Insufficent permissions.
Any hints? I'm using 5.1, SP6.
Zhanxs in advance
Marcel

The security creditials you suppplied to the IntialContext are only applied
to the thread that created the InitialContext. I have only found one
work-around - Construct an otherwise useless IntialContext each time a
thread attempts to use and EJB or its home. This is inefficient and almost
(not quite) destroys the advantage of caching the stubs.
Is there any other solution? Any thing coming down the pike?
Chuck McCorvey
"Marcel Zielinski" <[email protected]> wrote in message
news:[email protected]..
Hello,
I just run into the following problem:
I created a thin client which accesses the EJB's via a servlet.
In this servlet I cached the InitialContext und and the reference
to the Home interface. While creating the initial context I provided
login/password to access the EJB so it can't be accessed from the guest
user.
The first method call works as expected, any further call results
in a RemoteException - Insufficent permissions.
Any hints? I'm using 5.1, SP6.
Zhanxs in advance
Marcel

Similar Messages

  • Servlet Context problem.

    have two classes, one is a servletcontextlistner implementation and another one is the actual servlet that will call the first class.
    I am trying to have a counter in a servlet that keeps track of how many users have used the servlet. I like to store that in a servletcontextlistener and then call the counters value in the servlet. and also update that counters value.
    how can I do this ? are there any good examples that you know ? please help, as i have been stuck on this for manny hours.
    ServletContextListner implementation.
    public class counterContextListener implements ServletContextListener{
    String initialValue = "0";
    public counterContextListener(){}
    public void contextDestroyed(ServletContextEvent event){}
    public void contextInitialized(ServletContextEvent event){
    ServletContext context = event.getServletContext();
    context.setAttribute("countername", initialValue);
    public static String getCounterValue(ServletContext context) {
    String value = (String)context.getAttribute("countername");
    if (value == null) {
    value ="0";
    return(value);
    }//getCounterValue
    } // end of class
    Servlet
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws
    ServletException, IOException{
    con = null;
    res.setContentType("text/plain");
    ServletInputStream sis = req.getInputStream();
    DataInputStream dis = new DataInputStream(sis);
    String username = dis.readUTF();
    dis.close();
    PrintWriter out = res.getWriter();
    System.out.println("The user has come:"+username+" " +count_users);
    //Using servlet context to get the current counter
    ServletContext context = getServletContext();
    String counter = getCounterValue(context); // passing context object.
    Error
    C:\Program Files\Apache Group\Tomcat 4.1\webapps\mudServlet>javac mudServletTTT.java
    mudServletTTT.java:36: cannot resolve symbol
    symbol : method getCounterValue (javax.servlet.ServletContext)
    location: class mudServletTTT
    String counter = getCounterValue(context);
    ^

    Why would you make the Context Listener also responsible for keeping track of the counts?
    1st of all, you are doing this inside the Servlet:
    String counter = getCounterValue(context); // passing context object.
    But the servlet does not have a mehtod called getCounterValue. You need to call the CounterContextListener's method, which means you have to create one:
      CounterContextListener ccl = new CounterContextListener();
      String counter = ccl.getCounterValue(context);Second, why give the counter context listener two jobs that it doesn't need? You should make a new object - a Counter class:
    public class Counter {
      private int count;
      public Counter() { this(0); }
      public Counter(String initialValue) {
        this(Integer.parseInt(initialValue);
      public Counter(Integer initialValue) {
        this(initialValue.intValue());
      public Counter (int initialValue) {
        count = initialValue;
      public Integer getCount() { return new Integer(count); }
      public void increment() { addCount(1); }
      public void decriment() { addCount(-1); }
      public void addCount(int amountToAdd) {
        count = count + amountToAdd;
    }Then in your context listener, all you do is add one of these to the context:
    public class CounterContextListener implement ServletContextListener {
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext context = sce.getServletContext();
            Counter counter = new Counter();
            context.setAttribute("counter", counter);
        public void contextDestroyed(ServletContextEvenet sce) {
        }In your servlet, you get the counter from the context, get the count, and increment it if you want to:
    public void MyServlet exctends HttpServlet {
        public void doPost( ... ) ... {
            ServletContext context = this.getServletContext();
            Counter counter = context.getCounter();
            int count = counter.getCount();
            counter.increment();
    }

  • Problem configuring TassieDB database to work with JBoss Servlets + EJB app

    Hi everybody
    I have been unable to get Budi Kurniawan's Tassie Onine Bookstore example (
    http://benmira.free.fr/en/j2ee/sessionEJB.htm#ch29lev1sec4) application to read anything from the database TassieDB . I am not sure what is wrong. I downloaded the database from the CD. Then since this was an older version of Access, I had to let my Access convert it to the newer form.
    I then configured the Database the way I thought I should in order for it to work. I created a Data Source Name called TassieDB, by following the procedure to create a System DSN on Windows. I selected the Microsoft Access Driver and associated my Database which I named TassieDB1, which I deposited under C:\budibookstore which also contains the package com.brainysoftware.tassie.servlet.ejb
    When I access the SearchServlet page and type in "Computer" in the search box nothing turns up. I wonder what is going on?
    The following errors are spewed out by Apache in this process:
    May 18, 2005 8:27:24 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Starting service Tomcat-Standalone
    Apache Tomcat/4.1.31
    May 18, 2005 8:27:28 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
    e
    May 18, 2005 8:27:28 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul
    l=true
    May 18, 2005 8:27:29 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', retur
    nNull=true
    May 18, 2005 8:27:33 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    May 18, 2005 8:27:33 PM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    May 18, 2005 8:27:33 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=10/150 config=C:\tomcatj\conf\jk2.properties
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
    aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
    rg.jnp.interfaces.NamingContextFactory]
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
    aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
    rg.jnp.interfaces.NamingContextFactory]
    All help is gratefully acknowledged and accepted. Thanks in advance

    Hi
    Did you notyfy the Exception ?
    class not found Exception "org.jnp.interfaces.NamingContextFactory"
    add these packages to your class path.
    Vinoth

  • Best practice for Servlet EJB integration

              I'm wondering what the best practice is for Servlet EJB integration in terms of
              caching the home and remote objects. My understanding is that the Home object
              is threadsafe and could therefore be cached as an attribute of the Servlet. This
              would remove the need for a JNDI lookup for each request. Similarly caching the
              ProxyObject would yield further savings. However, I have noticed that most examples
              don't use either of these practices. Why not?
              Thanks in advance,
              Geordie
              

    This has been answered repeatedly. WL allows you to cache JNDI context
              objects, ejb homes and remotes without any problems. (EJB remote interfaces
              must only be used by one thread at a time, but that requirement is provided
              by the EJB spec itself.)
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Geordie" <[email protected]> wrote in message
              news:3af9579f$[email protected]..
              >
              > I'm wondering what the best practice is for Servlet EJB integration in
              terms of
              > caching the home and remote objects. My understanding is that the Home
              object
              > is threadsafe and could therefore be cached as an attribute of the
              Servlet. This
              > would remove the need for a JNDI lookup for each request. Similarly
              caching the
              > ProxyObject would yield further savings. However, I have noticed that
              most examples
              > don't use either of these practices. Why not?
              >
              > Thanks in advance,
              > Geordie
              

  • Caching initial contexts

    I have read the posts about caching initial context lookups and have
    implemented the solution and seen some benefits.
    I am dealing with a third party application that I cannot change.
    When I put my InitialContextFactory in the architecture I also logged
    how many getInitialContext() calls were being made - I was absolutely
    shocked - often 4+ per user transaction. I suspect that the code gets
    one, does a call and dereferences all over the place.
    90% of InitialContexts had the same environment passed to the getIC()
    call so it struck me that what I should do is create a pool of IC, and
    in my factory just serve one from the pool.
    So, the question is, what is the best way of detecting when the IC has
    been dereferenced so I know I can serve it again from my pool?
    I presume this is a generic pool problem when you can't guarantee that
    your client's will be good citizens and call a close() method or
    similar.
    I've posted here as it is performance related; also, is there any
    reason why what I am doing is not a good idea?
    Can the client do something with the IC which means it is not suitable
    for use by another client? If so, can I detect this so I may discard?
    As always, many thanks in advance.
    Presuming I can get it to work I will post the code so that we can all
    share ;-)
    Cheers
    Ed

    Why don't you instrument your factory then to give out your own
    implementation of InitialContext that will in fact only wrap a "loaner"
    InitialContext every time a method is invoked on it and before returning
    the value to the caller will put the real InitialContext back to the
    pool to be reused by another one.
    Then your clients can do whatever they want with those ICs and still
    would not cause so big performance hits.
    It's just an idea that just came to mind and I haven't tested it so it
    might have flaws but it looks viable.
    --dejan
    Ed Barrett wrote:
    The application is a third-party product that cannot be changed.
    By introducing the factory you gave below (thanks!) we put the application
    back under the load test and saw minimal improvements (like 1% response
    time).
    I then instrumented the factory with a system.out on finalize and noticed
    that a factory instance is created for each call to getInitialContext() - is
    this the way that WLS/J2EE works? I would have hoped that factories were
    shared or something. What we did see is that for one user request a number
    (sometimes 5!) ICs were being created ;-( Obviously the lookup cache is a
    class instance and shared across the lot.
    So then I started to think about pre-creating ICs and haveing a pool for the
    default ones (environment specifies URL and no security details or the
    like). Trouble is how to implement such when you cannot change the client
    code to call a factory return method (such as returnToPool()).
    Any ideas would be appreciated
    "Dimitri I. Rakitine" <[email protected]> wrote in message
    news:[email protected]...
    I've ran into this problem while porting 5.1 application (JNDI lookups
    were
    super-cheap) to 6.1 (where they are not so cheap due to
    serialization/deserialization)
    and did this test to see if this indeed was the problem. As you saw I
    didn't bother to
    cache InitialContext's - I just cached JNDI lookups and that resulted in
    very significant
    performance improvements.
    Which application are you testing it with?
    Graham <[email protected]> wrote:
    Dimitri,
    We did this but did not see that much improvement over the default way -
    we
    are using 6.1 sp2.
    We put some messages in our factory and found that the client code often
    created over 4 ICs for one user click - aaggghhhh!! As I say we cannot
    change their code but if we could take the time to create an IC away
    from
    the online response we feel we would save some time.
    We also observed a new instance of the IC factory being created every
    time a
    new IC was created - is this what you would expect?
    I think this is what NamingManager.getInitialContext() is supposed to do.
    Cheers
    Ed
    "Dimitri I. Rakitine" <[email protected]> wrote in message
    news:[email protected]...
    Caching InitialContext's will probably not quite solve the problem,
    because lookup()'s are expensive (in 6.x), so, caching lookup results
    will result in performance improvements.
    If you cannot change the 3'rd party code and all it does is:
    ... DataSource ds = (DataSource)new InitialContext().lookup(".....");
    or similar, you can add caching by implementing your own InitialContext
    factory,
    for example: (extremely simplistic)
    Startup class :
    System.setProperty("java.naming.factory.initial",
    "myjndi.InitialContextFactory");
    where
    myjndi.InitialContextFactory is :
    public class InitialContextFactory implements
    javax.naming.spi.InitialContextFactory {
    public Context getInitialContext(Hashtable env) throws
    NamingException
    Context ctx = new
    weblogic.jndi.WLInitialContextFactory().getInitialContext(env);
    return
    (Context)Proxy.newProxyInstance(ctx.getClass().getClassLoader(),
    new Class[]
    { Context.class },
    new
    ContextHandler(ctx));
    and myjndi.ContextHandler is:
    public class ContextHandler implements InvocationHandler {
    Context ctx;
    static Hashtable cache = new Hashtable();
    public ContextHandler(Context ctx) {
    this.ctx = ctx;
    public Object invoke(Object proxy, Method method, Object[] args)
    throws Throwable {
    try {
    Object retVal;
    if("lookup".equals(method.getName()) && args[0] instanceof
    String) {
    retVal = cache.get(args[0]);
    if(retVal == null) {
    retVal = method.invoke(ctx, args);
    cache.put(args[0], retVal);
    } else {
    retVal = method.invoke(ctx, args);
    return retVal;
    } catch(InvocationTargetException oops) {
    throw oops.getTargetException();
    Ed <[email protected]> wrote:
    Adarsh,
    We agree it is a brilliant idea - now just to work out how to do it.
    As you cannot always guarantee to be able to change the client code
    you cannot use normal pooling techniques:
    getObjectFromPool()
    // do work
    returnObjectToPool()
    So, the client code needs an InitialContext. We can put in our own
    Factory and intercept the getInitialContext() calls. This method
    must
    return class javax.naming.Context - therefore the only way I can see
    to spot when the class is dereferenced is to extend the class and add
    a finalize() method that notifies the factory.
    The trouble I believe is that the class cannot be "rescued" in the
    finalize() method (i.e. "I'm dying - take me back" ;-). If it simply
    told the factory to add another one to its pool this would mean that
    the new IC create "hit" would be in garbage collection (i.e. the
    users
    will pay somewhere along the line) - is this correct?
    Anyone any ideas on a solution? I have discovered out code create
    HUNDREDS of contexts in an hour and discards them very quickly. Be
    nice to be able to cache them!
    Cheers
    Ed
    "Adarsh Dattani" <[email protected]> wrote in message
    news:<[email protected]>...
    Ed,
    This a brilliant idea. We are planning something similar too. We
    first
    want to create a pool of LDAP connections as apps make extensive
    calls
    to
    LDAP. Did you check-out the object pooling api at Jakarta Commons.
    It
    deserves a close look.
    http://jakarta.apache.org/commons/pool/index.html
    Thanks,
    Adarsh
    "Ed" <[email protected]> wrote in message
    news:[email protected]...
    I have read the posts about caching initial context lookups and
    have
    implemented the solution and seen some benefits.
    I am dealing with a third party application that I cannot change.
    When I put my InitialContextFactory in the architecture I also
    logged
    how many getInitialContext() calls were being made - I was
    absolutely
    shocked - often 4+ per user transaction. I suspect that the code
    gets
    one, does a call and dereferences all over the place.
    90% of InitialContexts had the same environment passed to the
    getIC()
    call so it struck me that what I should do is create a pool of IC,
    and
    in my factory just serve one from the pool.
    So, the question is, what is the best way of detecting when the IC
    has
    been dereferenced so I know I can serve it again from my pool?
    I presume this is a generic pool problem when you can't guarantee
    that
    your client's will be good citizens and call a close() method or
    similar.
    I've posted here as it is performance related; also, is there any
    reason why what I am doing is not a good idea?
    Can the client do something with the IC which means it is not
    suitable
    for use by another client? If so, can I detect this so I may
    discard?
    As always, many thanks in advance.
    Presuming I can get it to work I will post the code so that we can
    all
    share ;-)
    Cheers
    Ed
    Dimitri
    Dimitri

  • EJB Entity transaction rollback problem

              Hello,
              I have created 2 beans one is a Stateless Session and the other a Bean Managed Entity Bean. The SS Bean has methods to retrieve an Oracle Connection from a DataSource defined connection pool, and to close a connection. The entity bean I have created is responsible for insterting a new record into one of the tables in my database.
              I have a client app that calls the ejbCreate method on the entity bean at which point the Entity EJB takes control, gets a valid connection from the SS EJB, runs a simple working SQL SELECT statement (obtaining correct values), and then attempts to perform an insert into a table using a prepared statement. My problem is that the application runs fine without any errors and all calls are made and all calls seem to be working fine. I have checked to make sure that the Datasource I am using is AutoCommit= false and it is and there are no exceptions being thrown in my EJB's but yet it appears as though the SQL statements executeUpdate() command is not being committed as their is no rows created in the database. Does anyone know what I may be doing wrong. I have all ACL parameters set up correctly and as I stated before the entire app runs without errors and I do have a SELECT statment that is working properly within the same method as the INSERT statement which is not!!! Please send any suggestions!!
              Justin
              

              I am using CMT, it is activated by default on Entity Beans I believe. The bean itself is marked as TX_REQUIRED so I believe all the methods automatically are all TX_REQUIRED.
              Here is my Bean ejbCreate Method, My PK class, and my ejb-jar.xml file-- I've pasted them below for convenience.
              ejbCreate:
                   public CustomerPK ejbCreate(String aUserName, String aPassword, String aFirstName,
                        String aMiddleInit, String aLastName, String aEmailAddr)
                        throws javax.ejb.CreateException {
                   Connection conn=null;
                   long nextPrsnID;
                   long nextCustID;
                   if (verifyParams(aUserName, aPassword, aFirstName, aMiddleInit,
                        aLastName, aEmailAddr)) {
                   if (isUniqueUserName(aUserName)) {
                   try {
                        conn=getConnection();
                        conn.setAutoCommit(false);
                        nextPrsnID=addPerson(conn,aFirstName,aMiddleInit,aLastName); // adds a person to the person table consists of just simple SQL
                        nextCustID=addCustomer(conn,nextPrsnID, aUserName,aPassword, aEmailAddr); //adds a customer to the customer table
                        // SET THE BEAN MANAGED PUBLIC VARIABLES
                        this.userName=aUserName;
                        this.password=aPassword;
                        this.firstName=aFirstName;
                        this.middleInit=aMiddleInit;
                        this.lastName=aLastName;
                        this.emailAddr=aEmailAddr;
                        this.personID=nextPrsnID;
                        this.custID=nextCustID;
                        conn.commit(); // with this statement here the transaction goes through otherwise the DB will not be updated
                   catch (Exception e){
                        throw new javax.ejb.CreateException("Experiencing Database Problems-- Unrecoverable Error"); // rollback transaction
                   finally{
                        cleanup(conn,null); // close the connection
                   else {           // UserName already exists
                   throw new javax.ejb.CreateException("Sorry username already exists please choose another one");
                   else {          // Registration parameters were not verifiable
                   throw new javax.ejb.CreateException("Registration paramater rules were violated");
                   CustomerPK custPK=new CustomerPK(nextCustID);
                   return custPK;
              EJB CUSTOMER PRIMARY KEY CLASS:
              public class CustomerPK implements java.io.Serializable {
              // PRIMARY KEY VARIABLES
              public long CustomerID;
              public CustomerPK(long aCustomerID) {
              this.CustomerID=aCustomerID;
              public CustomerPK() {
              public String toString(){
              return ((new Long(CustomerID)).toString());
              public boolean equals(Object aComparePK){
              if (this.CustomerID==((CustomerPK)aComparePK).CustomerID){
                   return true;
              return false;
              public int hashCode(){
              return ((new Long(CustomerID).toString()).hashCode());
              } // END-CLASS
              CUSTOMER ejb-jar.xml
              <?xml version="1.0"?>
              <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
              <ejb-jar>
              <enterprise-beans>
              <entity>
                   <ejb-name>Customer</ejb-name>
                   <home>CustomerHome</home>
                   <remote>Customer</remote>
                   <ejb-class>CustomerBean</ejb-class>
                   <persistence-type>Bean</persistence-type>
                   <prim-key-class>CustomerPK</prim-key-class>
                   <reentrant>False</reentrant>
                   <resource-ref>
              <res-ref-name>jdbc/DeveloperPool</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>
              </entity>
              </enterprise-beans>
              <assembly-descriptor>
              <container-transaction>
                   <method>
                   <ejb-name>Customer</ejb-name>
                   <method-intf>Remote</method-intf>
                   <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              </ejb-jar>
              "Cameron Purdy" <[email protected]> wrote:
              >Are you using CMT? Have you marked the methods as REQUIRED?
              >
              >Peace,
              >
              >--
              >Cameron Purdy
              >Tangosol, Inc.
              >http://www.tangosol.com
              >+1.617.623.5782
              >WebLogic Consulting Available
              >
              >
              >"Justin Jose" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hello,
              >>
              >> I have created 2 beans one is a Stateless Session and the other a Bean
              >Managed Entity Bean. The SS Bean has methods to retrieve an Oracle
              >Connection from a DataSource defined connection pool, and to close a
              >connection. The entity bean I have created is responsible for insterting a
              >new record into one of the tables in my database.
              >> I have a client app that calls the ejbCreate method on the entity bean at
              >which point the Entity EJB takes control, gets a valid connection from the
              >SS EJB, runs a simple working SQL SELECT statement (obtaining correct
              >values), and then attempts to perform an insert into a table using a
              >prepared statement. My problem is that the application runs fine without
              >any errors and all calls are made and all calls seem to be working fine. I
              >have checked to make sure that the Datasource I am using is AutoCommit=
              >false and it is and there are no exceptions being thrown in my EJB's but yet
              >it appears as though the SQL statements executeUpdate() command is not being
              >committed as their is no rows created in the database. Does anyone know
              >what I may be doing wrong. I have all ACL parameters set up correctly and
              >as I stated before the entire app runs without errors and I do have a SELECT
              >statment that is working properly within the same method as the INSERT
              >statement which is not!!! Please send any suggestions!!
              >>
              >> Justin
              >
              >
              

  • Is it OK to cache home stubs in 6.1?

    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

    Regarding the remotes stubs: Remote interface is not serializable. If your app
    needs to work in clustered env then weblogic 6.1 will have problems replicating
    the remote interface. If you absolutely have to cache the remote stub in httpsession,
    get the handle of the remote interface and cache it. To get the remote interface
    from the handle use handle.getEJBObject().
    sudy
    "Bob Lee" <[email protected]> wrote:
    I heard that caching home stubs may cause hot deployment issues in WebLogic
    server. Is this the case for 6.1? What about remote stubs (i.e. for a
    stateless session bean)?
    Thanks,
    Bob

  • XML Event casuing EJB cache limit to be reached

    I am running WLS 6.1 (sp2) and WLI 2.1 (sp2). My workflows are completely XML event
    driven. After the workflow is started a number of events are created that wait
    for different state changes to be posted th the JMS queue. During testing this
    seemed to work fine. However, I have now moved to production and things are falling
    apart.
    I have 100+ active workflows at any given time. They all have the same XML event
    active, which checks a conditional field to determine if it should handle the
    event. When the number of active workflows reached 100 I start receiving CacheFullException
    whenever the workflow engine attempts to process the event.
    Is there some way to increase the default EJB cache size for the WLI beans? How
    does WLI process these events so that the cache limit comes into play? Is there
    some way to change the structure of my workflow so that this limit is no longer
    a problem?
    Any suggestions will be greatly appreciated.
    Thanks,
    Pete Giesin

    I am running WLS 6.1 (sp2) and WLI 2.1 (sp2). My workflows are completely XML event
    driven. After the workflow is started a number of events are created that wait
    for different state changes to be posted th the JMS queue. During testing this
    seemed to work fine. However, I have now moved to production and things are falling
    apart.
    I have 100+ active workflows at any given time. They all have the same XML event
    active, which checks a conditional field to determine if it should handle the
    event. When the number of active workflows reached 100 I start receiving CacheFullException
    whenever the workflow engine attempts to process the event.
    Is there some way to increase the default EJB cache size for the WLI beans? How
    does WLI process these events so that the cache limit comes into play? Is there
    some way to change the structure of my workflow so that this limit is no longer
    a problem?
    Any suggestions will be greatly appreciated.
    Thanks,
    Pete Giesin

  • Best way to see changes done to jsps/servlets/ejb/xmls in EAR

    I am using iPlanet app server with iPlanet web server. Everytime i make any change jsp/servlet/ejb i have to redeploy whole ear application again. This takes a long time. Even when i use the "iasdeploy redployapp " command to deploy, it takes same amount of time as it takes for the orignal deployment.
    So Is there any way to decrease the amount of the time it needs for me to re-deploy the applications when slight changes are made to application. I would really be thankful to anybody who can help me.

    Hi,
    I am facing this problem with a simple EAR file also. It does not contain any EJBs.
    It has just JSPs, XML, and JAVA Classes.
    The file size is about 481Kb.
    Earlier this used to get deployed using the "iasdeploy" command within 1 minute.
    Now it is taking more than 5 minutes to deploy the EAR file.
    I am using the following command :
    iasdeploy deployapp -verbose XYZ.ear
    The same holds true for the "iasdeploy removeapp -verbose XYZ.ear" also.
    Please help.
    Thanks,
    Samar

  • HT202213 Home sharing problem: I have never set up home sharing but I feel I understand it.  I recently (last 2 months or so) deauthorized, first time ever, all computers with my iTunes account. I am trying to set up home sharing but get  iTunes says "You

    Home sharing problem: I have never set up home sharing but I feel I the concept and how it works.  I recently (last 2 months or so) deauthorized, first time ever, all computers with my iTunes account. I have 3 computers authorized.  I am trying to set up home sharing but get  iTunes says:
    "Home Sharing could not be activated because this computer is not authorized for the Apple Id "#########@###.com". Would you like to authorize now?"  I click "authorize" and get the next error " You cannont authorize more than 5 computers.  You have already authorized 5 computers with this Apple ID.  To authorize this computer you must first deauthorize one of the other computers."
    Can someone help or shed more light on my problem?
    Thanks,
    Richard

    Home Sharing is designed to work on your local network not across the internet/cloud.
    Stuff is accessed under the Computers column where your local iTunes library on a local computer would appear.
    Home Sharing would share your iTunes content (i.e. stuff stored in itunes on the computer, not in the cloud) with AppleTV or an iPad etc on the SAME network.
    AppleTV2 will not be able to see itunes content on the work computer over the internet.  It's not designed to.  if the work computer was on the home network it would.
    iCloud is in it's infancy and is not a mature product - iTunes TV Show purchases appear on AppleTV, but currently music does not unless you are subscribed to iTunes Match. I find this rather odd to be honest, along with the inability to buy music on AppleTV2.  Movies purchased in iTunes are not authorised for iCloud viewing currently either.
    Maybe it has something to do with iTunes Match 'getting in the way' - i think they assume you'll use that whereas you really want to be able to access Purchased music from the cloud without subscribing to itunes Match which is overkill for some.
    AC

  • I can use Mail at home, no problem. But when I travel, I can receive mail but not send it. I get a "server can't be reached" message. Yet when I send a photo using iPhoto, it gets sent. Help!!

    I can use Mail at home, no problem. But when I travel, I can receive mail but not send it. I get a "server can't be reached" message. Yet when I send a photo using iPhoto, it gets sent. Help!!

    To diagnose problems with Thunderbird, try the following:
    *Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Servlets/JDBC vs. servlets/EJB performance comparison/benchmark

    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.

    First off, whether you use servlets + JDBC or servlets + EJB, you'll
    most likely spend much of your time in the database.
    I would strongly suggest that you avoid the servlets + JDBC
    architecture. If you want to do straight JDBC code, then it's
    preferable to use a stateless session EJB between the presentation layer
    and the persistence layer.
    So, you should definitely consider an architecture where you have:
    servlets/jsp --> stateless session ejb --> JDBC code
    Your servlet / jsp layer handles presentation.
    The stateless session EJB layer abstracts the persistence layer and
    handles transaction demarcation.
    Modularity is important here. There's no reason that your presentation
    layer should be concerned with your persistence logic. Your application
    might be re-used or later enhanced with an Entity EJB, or JCA Connector,
    or a JMS queue providing the persistence layer.
    Also, you will usually have web or graphic designers who are modifying
    the web pages. Generally, they should not be exposed to transactions
    and jdbc code.
    We optimize the RMI calls so they are just local method calls. The
    stateless session ejb instances are pooled. You won't see much if any
    performance overhead.
    -- Rob
    jms wrote:
    >
    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Configuring Servlet Result Cache

    Greetings.
    I am trying to configure the iAS servlet result cache feature under iAS 6.0 SP2. I have the following entry for a servlet in my ias-web.xml file:
    <servlet>
    <servlet-name>MessageRouter</servlet-name>
    <guid>{CAC10848-06B4-1C5F-848B-08002085745B}</guid>
    <validation-required>false</validation-required>
    <servlet-info>
    <sticky>false</sticky>
    <encrypt>false</encrypt>
    <number-of-singles>10</number-of-singles>
    <disable-reload>false</disable-reload>
    </servlet-info>
         <caching>
              <cache-timeout>300</cache-timeout>
              <cache-size>10</cache-size>
              <cache-criteria>Xml</cache-criteria>
              <cache-option>TIMEOUT_LASTACCESS</cache-option>
         </caching>
    </servlet>
    However, it does not appear to be caching the results of this servlet because my request takes about 10 seconds to run (it's a database query). I would expect that subsequent requests would return results much faster than 10 seconds if the servlet results are in fact cached.
    So, I am hoping that someone can help me with the following questions:
    1. An example ias-web.xml with a cached servlet.
    2. Any instructions on how to monitor from iASTAT or logs or something so I can see that the servlet result is read from iAS cache.
    Thanks
    Jeffery Cann

    Check out the samples included with the appserver. There is a servlet caching sample that includes four different examples of deployment descriptors.
    Here is the servlet tag from the default:
    <servlet>
    <servlet-name>ServCache</servlet-name>
    <guid>{DD6402C6-CC11-1AA1-CF6F-080020CFEAC8}</guid>
    <validation-required>false</validation-required>
    <error-handler></error-handler>
    <servlet-info>
    <sticky>true</sticky>
    <encrypt>false</encrypt>
    <number-of-singles>10</number-of-singles>
    <disable-reload>false</disable-reload>
    <caching>
    <cache-timeout>900</cache-timeout>
    <cache-size>64</cache-size>
    <cache-criteria>inputtext</cache-criteria>
    <cache-option>TIMEOUT_CREATE</cache-option>
    </caching>
    </servlet-info>
    </servlet>
    The KXS log (assuming that you have info messages) will report servlet cache hits.
    David
    Shameless plug for my iAS book : http://www.amazon.com/exec/obidos/ASIN/076454909X/
    P.S.
    I just realized that the caching sample was only added in sp3. Even if you don't upgrade your server (the functionality is unchanged) you may want to download sp3 so that you can check out the sample. The sample goes into a reasonable amount of depth about this feature.

  • Error getting the EJB Handle for context name: User

    I am getting EJB Handle for context name: User.
    1) I specified ejb's and datasource in the ejb-jar.xml in the session tags.
    <session> </session>
    and I also included ejb's and datasource in the sun-ejb-jar.xml still I am getting the above error I am new to EJB how can I resolve this?

    What is the Oracle application server version?
    JDeveloper 11g supports direct deployment to Oracle Application Server 11g
    http://www.oracle.com/technology/products/jdev/collateral/papers/11/newfeatures/index.html

  • New To Iplanet app server.Can some one help me getting started by delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with iplanet docs..didnt quite get it. thanx

     

    Hi,
    What is that you are trying to accomplish ? Is it deployment or
    trying to develop applications ? Are you getting any errors ? If so,
    please post them to help you. I think the documentation is the best place
    for you to begin with.
    Regards & Happy New Year
    Raj
    Arif Khan wrote:
    New To Iplanet app server.Can some one help me getting started by
    delpoying and calling one of each of these:JSP,Servlet,EJB.Tried with
    iplanet docs..didnt quite get it. thanx
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

Maybe you are looking for

  • Parsing Text, is automator the tool for this?

    Hi gang, I would like to create a script to convert my work schedule that shows on the company website to iCal events. I am brand new to applescript and automator, so I don't even know if this is the toolset to do this, or if it's too complicated. He

  • Need Help Pasting Key Frames from one still image to others, and Changing the duration of multiple still images.

    I'm working on a stop motion project, and I have at least a thousand still images to work with. I have adjusted several Key Frame settings on the 1st still image in my project, such as Brightness Cropping Scale Position I now want to apply these exac

  • File Channel Problem

    I have written a small method, that converts file content to CharSequence. For some reason it maintains a lock on the file. After calling CharSequenceFromFile method I cannot delete the file. Obviously there is something that I don't understand somet

  • Missing elements when exporting in After Effects CC

    Hi there, I really hope someon is able to help me with this problem. I have this animation in After Effects. It contains PSD files of lines. I animated the lines using the Stroke-tool form AE. When pre-rendering the animation does what it's supposed

  • Not showing files on DVD-R

    I burned AVI movie files onto DVD-R discs with a windows machine, and when I insert them into my Macbook, they show up as blank cds or dvds. How can I get my Macbook to show the files? They show up just fine on a windows machine in Windows Explorer.