Client Program accessing J2EE entity Bean

I have trouble find my Course J2EE bean from a client. (The client
runs on the same computer but a different VM from the bean.)
In Glassfish (Sun Application Server Nine), I set up a simple
Container-Managed Entity Bean. I tried to access it from an external
client as described in the glassfish EJB
FAQ https://glassfish.dev.java.net/javaee5/ejb/EJB-FAQ.html
Here is the client program:
package RS;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.xml.parsers.*;
import org.apache.xml.serialize.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import RS.CourseHome;
import RS.CoursePK;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import java.rmi.RemoteException;
import javax.rmi.*;
import java.util.Properties;
import Debug.*;
public class Client {
public static void main (String arg[]) throws IOException {
try {
InitialContext jndiContext = new InitialContext ();
Debug.P("jndic ongtext" + jndiContext);
Object o = jndiContext.lookup("RS.CourseHome");
Debug.P("looked up object "+o + "|"+o.getClass().getName());
RS.CourseHome home =
    (RS.CourseHome)PortableRemoteObject.narrow(o,RS.CourseHome.class);
Debug.P("got home "+home);
Course C = home.create(1);
C.setName("blah");
CoursePK PK = new CoursePK();
PK.number=1;
C = home.findByPrimaryKey(PK);
Debug.P(C.getName());
catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
}Here is the error message:
Exception in thread "main" java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow
                   (PortableRemoteObject.java:294)
  at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
  at RS.Client.main(Client.java:26)The debugging indicates that I got the Initial Context
and got the object but the PortableObject.narrow failed:
jndic ongtextjavax.naming.InitialContext@1d85f79
looked up object IOR: (huge number deleted)
com.sun.corba.ee.impl.corba.CORBAObjectImplEarlier, I tried the version below, but based on the suggestion by Mr. Ebbert
in the forum started "Error When running the Client Program" by sree_devi,
I checked
the following. I went to "Jndi Tree Browsing" from the Administrative Console
and I found a "RS.CourseHome" entry under "ejb" I found RS.CourseHome there
but did not see the "Course" tghat I expected to see
Thus, I tried the version above:
package RS;
   --- imports deleted for conciseness
import Debug.*;
public class Client {
public static void main (String arg[]) throws IOException {
try {
InitialContext jndiContext = new InitialContext ();
Object o = jndiContext.lookup("Course");
CourseHome home =
    (CourseHome)PortableRemoteObject.narrow(o,CourseHome.class);
Course C = home.create(1);
C.setName("blah");
CoursePK PK = new CoursePK();
PK.number=1;
C = home.findByPrimaryKey(PK);
Debug.P(C.getName());
catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
}When I run it, I get the following Naming Exception: Course not found
I confirmed at the administrative console, that I have "Course" listed
under Enterprise Applications:
As per the ejb FAQ, I set up my $CLASSPATH so it starts as follows:
/opt/j2ee/SUNWappserver/lib/appserv-rt.jar:
/opt/j2ee/SUNWappserver/lib/javaee.jar:I also verifed in my domain.xml that the orb-listener-1, the default
naming service port was at 3700.
Here is the info on the Bean that I have running for both of the tries
at my Client code.
ejb-jar.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
version="2.1">
  <enterprise-beans>
    <entity>
       <description>Course</description>
       <display-name>CourseBean</display-name>
       <ejb-name>CourseBean</ejb-name>
       <home>RS.CourseHome</home>
       <remote>RS.Course</remote>
       <ejb-class>RS.CourseBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>RS.CoursePK</prim-key-class>
       <reentrant>false</reentrant>
       <abstract-schema-name>Course</abstract-schema-name>
       <cmp-field><field-name>number</field-name></cmp-field>
       <cmp-field><field-name>name</field-name></cmp-field>
    </entity>
  </enterprise-beans>
  <assembly-descriptor>
     <security-role>
        <description>Everyone</description>
       <role-name>everyone</role-name>
     </security-role>
     <method-permission>
        <unchecked/>
        <method>
           <ejb-name>CourseBean</ejb-name>
           <method-name>*</method-name>
        </method>
      </method-permission>
     <container-transaction>
        <method>
           <ejb-name>CourseBean</ejb-name>
           <method-name>*</method-name>
        </method>
        <trans-attribute>Required</trans-attribute>
     </container-transaction>
  </assembly-descriptor>
</ejb-jar>
Sun-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 EJB 2.1//EN"
"http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
<sun-ejb-jar>
  <enterprise-beans>
     <name>CourseBean</name>
     <ejb>
       <ejb-name>CourseBean</ejb-name>
       <jndi-name>Course</jndi-name>
     </ejb>
  <cmp-resource>
     <jndi-name>jdbc/__default</jndi-name>
     <create-tables-at-deploy>true</create-tables-at-deploy>
     <drop-tables-at-undeploy>true</drop-tables-at-undeploy>
  </cmp-resource>
  </enterprise-beans>
</sun-ejb-jar>
Course.java
package RS;
import java.rmi.RemoteException;
public interface Course extends javax.ejb.EJBObject {
  public String getName() throws RemoteException;
  public void setName (String Str) throws RemoteException;
  public int getNumber() throws RemoteException;
  public void setNumber (int n) throws RemoteException;
CourseHome.java
package RS;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
public interface CourseHome extends javax.ejb.EJBHome {
public Course create(int id) throws
CreateException,RemoteException;
public Course findByPrimaryKey(CoursePK pk)
throws FinderException,RemoteException;
CourseBean.java
package RS;
import javax.ejb.EntityContext;
public abstract class CourseBean implements javax.ejb.EntityBean {
public CoursePK ejbCreate (int number) throws javax.ejb.CreateException{
  this.setNumber(number);
  return null;
public void ejbPostCreate (int number) {
public abstract String getName();
public abstract void setName (String str);
public abstract int getNumber ();
public abstract void setNumber (int number);
public void setEntityContext (EntityContext ctx) {}
public void unsetEntityContext() {}
public void ejbActivate () {}
public void ejbPassivate () {}
public void ejbLoad () {}
public void ejbStore () {}
public void ejbRemove() {}
}Laurence L. Leff, Ph.D. Associate Professor of Computer Science
Western Illinois University, 1 University Circle 61455, Pager: 309 367 0787
FAX 309 298 2302

hi s-mcgowan,
"some other processing" comprises of printing of debug lines and publishing to the message queue using JMS. I added more debug lines so that i could see whats really happening... here is the result
myTableHome.create(...); <----------- no exception was thrown and it returned LocalMyTable object
print out "Insert successful"
print out "publishing message"
... publish message to message queue using JMS...
print out "Publish done"
... after few milliseconds...
java.sql.BatchUpdateException: Data exception -- row already exist in index PK_MYTABLE on table MYTABLE.
From the exception it seems like its doing a batch insert. So that seems to explain why the java.sql.BatchUpdateException is thrown few milliseconds after my call to myTableHome.create(...);
Is it possible to disable batch update / insert? how?
thanks in advance,
leigh

Similar Messages

  • Example of client/servelt calling an Entity Bean(EJB 2.0)

    Hi !!
    Can somebody give any code of servlet or client calling an entity bean...please give any sample code... I am getting error while calling an entity bean in Servlet....
    It says that the Jndi name not found
    SERVLET CODE----------
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import sfms.mtk.*;
    import sfms.sec.*;
    import java.util.*;
    public class TestServletExample extends HttpServlet
         SecDbSecUserHome home;
         public void init(ServletConfig config)throws ServletException{
         //Look up home interface
              try
                   Properties props = new Properties();
                   System.out.println("Looking for Jndi ----->>");
                   InitialContext ctx = new javax.naming.InitialContext();
                   home = (SecDbSecUserHome)javax.rmi.PortableRemoteObject.narrow(ctx.lookup("SecUserJndi"), SecDbSecUserHome.class);
                   System.out.println("Lookup is over ----->>");
              catch (Exception NamingException)
                   NamingException.printStackTrace();
         public void doGet (HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
              MTKDataObject objDataObject = null;
              PrintWriter out;
              response.setContentType("text/html");
              String title = "EJB Example";
              out = response.getWriter();
              out.println("<HTML><HEAD><TITLE>");
              out.println(title);
              out.println("</TITLE></HEAD><BODY>");
              try
                   System.out.println("*************STARTING NOW*************");
                   Collection coll = home.findAllUsers();
                   Iterator i =coll.iterator();
                   while(i.hasNext())
                        SecDbSecUserRemote remote = (SecDbSecUserRemote)i.next();
                        System.out.println("User ID "+remote.getUserId());
                        System.out.println("FirstName "+remote.getFirstName());
              catch(Exception CreateException)
                        CreateException.printStackTrace();
              out.close();
         public void destroy()
              System.out.println("Destroy");
    javax.naming.NameNotFoundException: SecUserJndi not found
    <<no stack trace available>>
    *************STARTING NOW*************
    java.lang.NullPointerException
    at TestServletExample.doGet(TestServletExample.java:49)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:197)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:176)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:172)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:368)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:484)
    PLEASE DO REPLY ME BACK (ASAP)
    Bhumika

    There should be some error in looking up the Jndi..
    In weblogic server I have been using the following code:
         try
              Context ctx = getContext.getInitialContext();
              HelloHome home = (HelloHome)ctx.lookup("MyHello");
              Hello hello = home.create();
              System.out.println(hello.display());
         catch(Exception e)
              System.out.println("Error :");
              e.printStackTrace();
         static String user = null;
         static String password = null;
         static String url = "t3://localhost:7001";
         * Gets an initial context.
         * @return Context
         * @exception java.lang.Exception if there is
         * an error in getting a Context
         static public Context getInitialContext() throws Exception
              Properties p = new Properties();
              p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
              p.put(Context.PROVIDER_URL, url);
              if (user != null)
         System.out.println ("user: " + user);
         p.put(Context.SECURITY_PRINCIPAL, user);
                   if (password == null)
                        password = "";
         p.put(Context.SECURITY_CREDENTIALS, password);
    return new InitialContext(p);
    this works fine in weblogic..
    also check if ur classpath is ok..

  • Exception while accessing deployed entity bean (CMP)

    Hi
    PSB for the exception i get when i try to access a delpoyed entity bean
    (CMP).
    If any of you have got this exception and fixed it or have any idea of how
    to fix it then please reply asap.
    thanks.
    java.lang.NullPointerException
    at
    com.netscape.server.deployment.PersistenceDeploymentDescriptorImpl.getBeanPr
    operty(Unk
    n Source)
    at com.netscape.server.ejb.SQLPersistenceManager.init(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.addHome(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initMeta(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initTransport(Unknown Source)
    at com.kivasoft.eb.EBActivatorCB.getEBHomenative(Native Method)
    at com.kivasoft.eb.EBActivatorCB.getEBHome(Unknown Source)
    at com.netscape.server.ejb.EjbContext.createHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.getHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:45)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    [04/Dec/2001 11:16:51:8] error: Exception Stack Trace:
    com.netscape.server.ejb.PersistenceException
    at com.netscape.server.ejb.SQLPersistenceManager.init(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.addHome(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initMeta(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initTransport(Unknown Source)
    at com.kivasoft.eb.EBActivatorCB.getEBHomenative(Native Method)
    at com.kivasoft.eb.EBActivatorCB.getEBHome(Unknown Source)
    at com.netscape.server.ejb.EjbContext.createHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.getHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:45)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    got the Entity bean found ***************
    got the Entity bean***************
    [04/Dec/2001 11:16:51:8] error: EBFP-marshal_internal: internal exception
    caught in kcp skeleton,
    ception = java.lang.NullPointerException
    [04/Dec/2001 11:16:51:8] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unkn
    own Source
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown
    Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.find
    ByPrimaryK
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__sample
    s_test_ejb
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp
    stubTest
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_Te
    stEntityHo
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    I could not find the Entity bean
    java.rmi.RemoteException: internal error; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unkn
    own Source
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown
    Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.find
    ByPrimaryK
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__sample
    s_test_ejb
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp
    stubTest
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_Te
    stEntityHo
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Regards
    Sandhya Seetharam

    Hi,
    This seems to be the Hello world EJB application with a small
    modification(probably an addition of test directory or a java file). I would
    recomend you to go through every line of the document on deploying this
    application. There is another posting regarding the same issue in this forum.
    Regards
    Raj
    akhila wrote:
    Hi
    PSB for the exception i get when i try to access a delpoyed entity bean
    (CMP).
    If any of you have got this exception and fixed it or have any idea of how
    to fix it then please reply asap.
    thanks.
    java.lang.NullPointerException
    at
    com.netscape.server.deployment.PersistenceDeploymentDescriptorImpl.getBeanPr
    operty(Unk
    n Source)
    at com.netscape.server.ejb.SQLPersistenceManager.init(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.addHome(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initMeta(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initTransport(Unknown Source)
    at com.kivasoft.eb.EBActivatorCB.getEBHomenative(Native Method)
    at com.kivasoft.eb.EBActivatorCB.getEBHome(Unknown Source)
    at com.netscape.server.ejb.EjbContext.createHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.getHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:45)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    [04/Dec/2001 11:16:51:8] error: Exception Stack Trace:
    com.netscape.server.ejb.PersistenceException
    at com.netscape.server.ejb.SQLPersistenceManager.init(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.addHome(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initMeta(Unknown Source)
    at com.kivasoft.eb.EBHomeBase.initTransport(Unknown Source)
    at com.kivasoft.eb.EBActivatorCB.getEBHomenative(Native Method)
    at com.kivasoft.eb.EBActivatorCB.getEBHome(Unknown Source)
    at com.netscape.server.ejb.EjbContext.createHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.getHomeRef(Unknown Source)
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:45)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    got the Entity bean found ***************
    got the Entity bean***************
    [04/Dec/2001 11:16:51:8] error: EBFP-marshal_internal: internal exception
    caught in kcp skeleton,
    ception = java.lang.NullPointerException
    [04/Dec/2001 11:16:51:8] error: Exception Stack Trace:
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unkn
    own Source
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown
    Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.find
    ByPrimaryK
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__sample
    s_test_ejb
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp
    stubTest
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_Te
    stEntityHo
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    I could not find the Entity bean
    java.rmi.RemoteException: internal error; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at java.util.Hashtable.get(Hashtable.java:321)
    at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown
    Source)
    at
    com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
    Source)
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unkn
    own Source
    at
    com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
    Source)
    at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown
    Source)
    at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.find
    ByPrimaryK
    ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
    at
    samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__sample
    s_test_ejb
    tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp
    stubTest
    ityHome.java:338)
    at
    samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_Te
    stEntityHo
    java:85)
    at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
    at java.lang.reflect.Method.invoke(Native Method)
    at
    samples.test.ejb.ejb_skel_samples_test_ejb_TestEJB.getGreeting(ejb_skel_samp
    les_test_e
    TestEJB.java:80)
    at
    samples.test.ejb.ejb_kcp_skel_Test.getGreeting__indir_wstring__indir_wstring
    (ejb_kcp_s
    _Test.java:220)
    at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
    at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
    at
    samples.test.ejb.ejb_kcp_stub_Test.getGreeting(ejb_kcp_stub_Test.java:327)
    at samples.test.ejb.ejb_stub_Test.getGreeting(ejb_stub_Test.java:71)
    at samples.test.servlet.TestServlet.doGet(TestServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    Regards
    Sandhya Seetharam

  • Database access using Entity Beans

    How does it work? In the examples I've seen, there is no SQL statement
    being generated, and I no code establishing the JDBC bridge...
    What am I missing? How do I look up a record in a database using an
    entity bean?
    Thanks!!!
    -Dan

    The Entity Bean remote interface methods access the database.
    InitialContext ic=new InitialContext();
    EntityBHome eh = (EntityBHome)ic.lookup("com.ejb.EntityBHome");
    EntityB entityB=eh.findByPrimaryKey(primarykey pk);
    [email protected] (Dan M) wrote:
    How does it work? In the examples I've seen, there is no SQL statement
    being generated, and I no code establishing the JDBC bridge...
    What am I missing? How do I look up a record in a database using an
    entity bean?
    Thanks!!!
    -Dan

  • JDBC issue when accessing an Entity Bean

    Hi,
    WLCS 3.1
    WLS 5.1 sp6
    Windows NT
    Oracle 8.1.6
    I am having problems with an Entity bean, I have originaly deployed and had it
    running on cloudscape. I decided I need to deploy it to Oracle 8.1.6, on startup
    of WLCS the bean was deployed to the connection pool correctly using Weblogic
    JDriver.
    The bit I cannot understand is when I try and do a FindByPrimaryKey on the Entity
    Bean the following exception is thrown by oracle, which leads me to believe this
    must be an Oracle/Jdbc problem.
    Here you can see that the bean has been deployed on a valid connection pool.
    Tue Sep 18 15:47:39 GMT+03:00 2001:<I> <EJB JAR deployment /export/home/mccann/tester2.jar>
    EJB home interface: 'com.testerHome' deployed bound to the JNDI name
    : 'tester'
    Heres the exception raised when a findByPrimaryKey is invoked on the bean....
    Tue Sep 18 15:47:57 GMT+03:00 2001:<I> <EJB JAR deployment /export/home/mccann/t
    ester2.jar> Exception in non-transactional EJB invoke:
    java.sql.SQLException: ORA-00942: table or view does not exist
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:228)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:869)
    at weblogic.jdbc.pool.PreparedStatement.executeUpdate(PreparedStatement.
    java:65)
    at com.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
    S.java:199)
    at com.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
    S.java:162)
    at weblogic.ejb.internal.EntityEJBContext.create(EntityEJBContext.java:1
    18)
    at weblogic.ejb.internal.StatefulEJBObject.postCreate(StatefulEJBObject.
    java:268)
    at com.testerEJBEOImpl.create(testerEJBEOImpl.java:61)
    at com.testerEJBHomeImpl.create(testerEJBHomeImpl.java:32)
    at com.testerEJBHomeImpl_WLSkel.invoke(testerEJBHomeImpl_WLSkel.java:68)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
    jectAdapter.java:347)
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:69)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    .java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
    Any help here would be great, this is annoying problem because the Entity bean
    deploys fine and no issues are raised at startup time, so the table must of existed
    and the structure must of been correct. But minutes after the server started I
    ran my client which tried to invoke this bean with the above exception.
    Thanks
    Wayne.

    Hi Wayne,
    I'd recommend you installing of latest SP for WL plus installing of Oracle
    8.1.7 thing driver.
    Regards,
    Slava Imeshev
    "Wayne Highland" <[email protected]> wrote in message
    news:[email protected]...
    >
    Hi,
    WLCS 3.1
    WLS 5.1 sp6
    Windows NT
    Oracle 8.1.6
    I am having problems with an Entity bean, I have originaly deployed andhad it
    running on cloudscape. I decided I need to deploy it to Oracle 8.1.6, onstartup
    of WLCS the bean was deployed to the connection pool correctly usingWeblogic
    JDriver.
    The bit I cannot understand is when I try and do a FindByPrimaryKey on theEntity
    Bean the following exception is thrown by oracle, which leads me tobelieve this
    must be an Oracle/Jdbc problem.
    Here you can see that the bean has been deployed on a valid connectionpool.
    >
    Tue Sep 18 15:47:39 GMT+03:00 2001:<I> <EJB JAR deployment/export/home/mccann/tester2.jar>
    EJB home interface: 'com.testerHome' deployed bound to the JNDI name
    : 'tester'
    Heres the exception raised when a findByPrimaryKey is invoked on thebean....
    >
    Tue Sep 18 15:47:57 GMT+03:00 2001:<I> <EJB JAR deployment/export/home/mccann/t
    ester2.jar> Exception in non-transactional EJB invoke:
    java.sql.SQLException: ORA-00942: table or view does not exist
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:228)
    atweblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:869)
    atweblogic.jdbc.pool.PreparedStatement.executeUpdate(PreparedStatement.
    java:65)
    atcom.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
    S.java:199)
    atcom.testerEJBPSWebLogic_CMP_RDBMS.create(testerEJBPSWebLogic_CMP_RDBM
    S.java:162)
    atweblogic.ejb.internal.EntityEJBContext.create(EntityEJBContext.java:1
    18)
    atweblogic.ejb.internal.StatefulEJBObject.postCreate(StatefulEJBObject.
    java:268)
    at com.testerEJBEOImpl.create(testerEJBEOImpl.java:61)
    at com.testerEJBHomeImpl.create(testerEJBHomeImpl.java:32)
    atcom.testerEJBHomeImpl_WLSkel.invoke(testerEJBHomeImpl_WLSkel.java:68)
    atweblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
    jectAdapter.java:347)
    atweblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:69)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
    java:15)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
    Any help here would be great, this is annoying problem because the Entitybean
    deploys fine and no issues are raised at startup time, so the table mustof existed
    and the structure must of been correct. But minutes after the serverstarted I
    ran my client which tried to invoke this bean with the above exception.
    Thanks
    Wayne.

  • Unable to compile EJB client program

    Hi, I developed a simple client program to an entity bean and I am not able to compile. Following are the few lines picked up from the code: (all my ejb,home and remote classes are under "test" package)
    import test.*;
    import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
    public static void main(String[] args) {
    try {
    Context initial = new InitialContext();
    Object objRef = initial.lookup("MyTestBean");
    TestHome home = (TestHome) PortableRemoteObject.narrow(objRef, TestHome.class);
    ... etc.
    I am getting the following compilation error
    TestClient.java:13: inconvertible types found : java.lang.Object required: TestHome
    TestHome home = (TestHome) PortableRemoteObject.narrow(objRef, TestHome.cl
    ass);
    The classpath is set to j2ee.jar and the local working directory in which the package "test" resides.
    Any help in this matter is greatly appreciated.
    Thanks.

    Greetings,
    Hi there,
    Did pengjuc's answer help you to solve this problem?
    I'd be really interested to know if it did.Unlikely, since the error reported is not with the object reference but with the specified class type. Additionally, this approach is not recommended since it assumes the underlying protocol is always (RMI-)IIOP and not vendor specific - portability is lost.
    Thanks
    Amanda
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers
    Regards,
    Tony "Vee Schade" Cook

  • Entity Bean Database Access Problem

    I have developed the CustomerBook application from the NetBeans 4.1 quick start tutorial with SJAS8.1Q2 (http://www.netbeans.org/kb/41/quickstart-j2ee.html) with MySQL. I get the following set of errors. I am new to SJAS. I've tried a lot of different things. For the life of me, I can't understand why this isn't working. I know the problem is with the entity bean accessing the database because the session bean communicates well with the client when calling the entity bean.
    Thank you in advance for any efforts made to help me on this.
    Seymour
    [#|2005-08-15T15:58:50.250-0500|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb|_ThreadID=21;|EJB5018: An exception was thrown during an ejb invocation on [CustomerFacadeBean]|#]
    [#|2005-08-15T15:58:50.251-0500|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb|_ThreadID=21;|
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
    com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:870)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681)
         at ejb.CustomersBean_2122496195_ConcreteImpl.jdoGetPersistenceManager(CustomersBean_2122496195_ConcreteImpl.java:862)
         at ejb.CustomersBean_2122496195_ConcreteImpl.ejbFindByPrimaryKey(CustomersBean_2122496195_ConcreteImpl.java:417)
         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:585)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
         at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:738)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:181)
         at $Proxy15.findByPrimaryKey(Unknown Source)
         at ejb.CustomerFacadeBean.getCompanyInfo(CustomerFacadeBean.java:73)
         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:585)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy18.getCompanyInfo(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:585)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1258)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
    NestedStackTrace:
    java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
         at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:74)
         at com.sun.jdo.spi.persistence.support.sqlstore.ejb.TransactionHelperImpl.getConnection(TransactionHelperImpl.java:181)
         at com.sun.jdo.spi.persistence.support.sqlstore.ejb.EJBHelper.getConnection(EJBHelper.java:166)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getConnection(SQLPersistenceManagerFactory.java:892)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:857)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681)
         at ejb.CustomersBean_2122496195_ConcreteImpl.jdoGetPersistenceManager(CustomersBean_2122496195_ConcreteImpl.java:862)
         at ejb.CustomersBean_2122496195_ConcreteImpl.ejbFindByPrimaryKey(CustomersBean_2122496195_ConcreteImpl.java:417)
         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:585)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
         at com.sun.ejb.containers.EntityContainer.invokeFindByPrimaryKey(EntityContainer.java:738)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:181)
         at $Proxy15.findByPrimaryKey(Unknown Source)
         at ejb.CustomerFacadeBean.getCompanyInfo(CustomerFacadeBean.java:73)
         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:585)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy18.getCompanyInfo(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:585)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1258)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)
    javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource
         at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:2674)
         at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2526)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:819)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:199)
         at $Proxy15.findByPrimaryKey(Unknown Source)
         at ejb.CustomerFacadeBean.getCompanyInfo(CustomerFacadeBean.java:73)
         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:585)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy18.getCompanyInfo(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:585)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:123)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1569)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:951)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:181)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:721)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1258)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:409)

    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSourcePlease check that you have the driver in appserver's class path.

  • Concurrent entity beans access

    I have failed to come up with a workable solution for concurrent entity bean access on the SUN reference implementation together with cloudscape.
    I have created a test case and a webpage which describes my problem. If anyone can come up with a working solution (must work on the RI) I would be very thankful.
    Please have a look at
    http://www.offermanns.de/~rolf/ejb-concurrency/
    and tell me what you think.
    -Rolf

    Hi,
    I thought that this is a problem. But this isn't just
    about this pattern. It is a general question about how
    to get concurrent access to entity beans to work on
    the RI.Entity Beans are the shared components , same instance is being shared between all the concurrent users so if the same component is a part of the longer transaction then the component can lead to the data corruption and to avoid that you have to set the ISOLATION Level for the concurrent running long transactions.Remember the Entity beans are shared components and are shared between all the cliens not like the Sessoin BEans where different clients can get different instances.
    I tried to alter the cloudscape setting to SERIAZABLE,
    but that won't help. (from the cloudscape log, it
    seems, that the container switches back to READ_COMMIT
    before every transaction.You dont have to change the setting in the Cloudscape,you require add the Isolation-level tag in the deployment descriptor.These can take the values as
    1)READ_COMMITED
    2)READ_UNCOMMITTED
    3)REPEATABLE_READ
    4)SERIALIZABLEI hope this will help.
    Regards
    Vicky

  • Problems accessing fields in a CMP entity bean from a session bean

    Hello everybody,
    I'm getting the next problem: when I try to access a field in a CMP entity bean that I have instantiated from a session bean (trhoug entitybean.getNameOfField), I get the error "the entity bean does not exist in the database".
    This entity bean is accessing a table in an external database (not the DB of the WAS), but I know that it's getting the correct data from the table, since  I check the entitybean.size() and the entitybean.findByPrimaryKey(), and I get the right information. For some reason, the only thing that it doesn't work in the entity bean are the getter/setter methods (I created them automatically after having created the entity fields).
    I access the entity bean through its local interface...
    I know it's really difficult to give an answer with so few details, but... does anybody think I forgot something important to configure??
    Thank very much in advance!!
    Isidro

    getter and setter methods for cmp-fields are abstract.
    getter and setter methods for cmr-fields are abstract.
    "John Lee" <[email protected]> wrote:
    >
    Hi:
    Which method in a CMP Entity bean should be abstract? just only SetXXX
    and
    GetXXX?
    Thanks!
    John Lee

  • Problems accessing ejb 3.0 entity bean from project

    I have written some code using ejb 3.0 and was previously accessing the entity bean without problem when both ejbs and the accessing code were in the same project. However I have moved the accessing code into a different project within the same application and now when the code tries to accessing the entity bean I get the following error:
    com.colwilson.web.ingestion.IdentifiedException: java.lang.ClassCastException: __Proxy3
         at com.colwilson.web.ingestion.IngestionHandler.recordArrived(IngestionHandler.java:140)
         at com.colwilson.web.ingestion.IngestionHandler.main(IngestionHandler.java:52)
    Caused by: java.lang.ClassCastException: __Proxy3
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.getFreshObject(StatelessSessionRemoteInvocationHandler.java:21)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.getReplacementObject(RecoverableRemoteInvocationHandler.java:64)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.handleRecovery(RecoverableRemoteInvocationHandler.java:41)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:30)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.mergeEntity(Unknown Source)
         at com.colwilson.web.ingestion.IngestionHandler.recordArrived(IngestionHandler.java:137)
         ... 1 more
    Now, of course I could move the code back into the same project, but as I understand it that is just the point of ejbs. I'm looking up the entity bean thus:
    final Context context = InitialContext();
    ingestionSessionEJB =
    (IngestionSessionEJB)context.lookup("IngestionSessionEJB");
    It may be true that I don't understand the way lookup works, but to be honest I can't find the docs that explain what I've got wrong.
    Please help.

    hi
    Double Click on the project which is goin to use the project which contains bean from the Application Navigator window. The project properties window will open. Choose the "Dependencies" item from left panel. click on the radio "User Project Settings" and select another project which contain ejb which you're goin to access...
    Best Of Luck
    Ravi A. Trivedi

  • Proxy object and entity Bean interaction

    Hello,
    I'd like to have some precisions on the interactions between the proxy object (client) and the entity bean(server):
    - does J2EE provides ways for a bean to manage clients, to define roles and permissions, lock, etc ... ? What informations an entity bean can know about the clients ?.
    - how does the context mechanism work on the entity bean side ?
    - how does an entity bean identify different clients ? how does it recognize one from another ? I mean if client c1 and client c2 use same entity bean B, how B can manage different roles for c1 and c2, and how can B returns specific values to a particular client.
    Thx.

    If you can read some tutorial, you will get all the information.
    I'll suggest a book EJB by richard manson publicvations oreilly.
    The activities you are talking about is responsibility of container and user developed bean are totally absytracted from this system level activities.
    Primary service include security which take care of activities like Authentication, access control and secure communication.
    for role based access control u have container providing the identity by Principal object. DDescriptors declare which logical roles are allowed to access even perticular method of the bean.

  • Entity Bean Pool

    Weblogic(6.1) deployment descriptor allows configuration of entity bean pool size
    and cache size. Since calls from multiple clients to the same entity bean are
    serialized what is the benefit of having multiple instances in an entity bean
    pool?
    Thanks,
    Stefan

    Anand,
    Of course I don't talk about an extreme case of a table with one row!?, but the
    same (logical) entity bean with same primary key accessed by multiple clients.
    Each client will use findByPrimaryKey method and will get a reference to same
    entity bean mapped to the same "row" in database . My surprise was that even for
    this case there are multiple entity instances created in the pool for one row
    in the database. For multiple instances mapped to multiple rows we concluded all
    makes sense.
    thanks again,
    Stefan
    "Anand Byrappagari" <[email protected]> wrote:
    Stefan,
    I am not sure I understand your question but if you are asking why
    have
    pooling, pool of instances is a feature for all types of entity beans.
    In
    the specific case that you have where the table has only one row it has
    limited application but the general case is that you lave multiple rows
    in a
    table. For example, an Address table will in all probability have hundereds
    of addresses of customers. An application accessing this table will be
    accessing multiple address instances at any given time. So each of this
    instances should be accessable independently hence the pool makes sense
    in
    this case. I point I am trying to make is that when you define a pool
    for a
    bean (AddressBean) you are not defining the pool for one instance of
    the
    bean type(like address_1). The pool specifies the number of instances
    (address_1, address_2, ...., address_n) that can exist at any given time.
    Are you asking if the pool size is for each row? That is if pool
    size is
    set to 10, are you asking if you can have atmost 10 instances of address_1
    as opposed to 10 instances of any address? The pool and cache sizes refer
    to
    the limit on any instances and not on 1 instance.
    Even in the extreme case like the one you mention where the table
    has
    only one row, there is some utility in having multiple instances as this
    would not require serializing access to the bean - in exclusive strategy,
    once a client has locked an EJB instance, other clients are blocked from
    the
    EJB's data even if they intend only to read the persistent fields. If
    you
    set the strategy to database then multiple instances can access the data
    depending on the isolation levels you have set. Read Chapter 4 of
    "Programming Weblogic Enterprise JavaBeans" for more information.
    Hope this helps.
    -- Anand
    "Stefan" <[email protected]> wrote in message
    news:[email protected]...
    Anand,
    If we established that same databse row can be mapped to multiple entitybeans
    instances we are back to my original question: Assuming "database"concurrency
    strategy, how do you see this model useful if calls from multiple clientsare
    serialized across all these instances? I cannot point out the benefitof
    the pool
    of entity bean instances for same row since they all wait for a clientcall to
    finish before replying to another client. Where is the benefit of havingmultiple
    instances if one instance would do the same job?
    thanks,
    Stefan
    "Anand Byrappagari" <[email protected]> wrote:
    The default concurrency-strategy in weblogic 6.1 is database which
    means
    that concurrency is taken care of at the database, this model allows
    you to
    have multiple ejb object instances for the same row in the database.
    If you
    want a single instance then you can set <concurrency-strategy> element
    in
    the deployment descriptor for the ejb to Exclusive.
    -- Anand
    "Stefan" <[email protected]> wrote in message
    news:[email protected]...
    Thanks Anand,
    Sure this way it makes total sense. However I used an example whereI was
    referencing
    only one row from multiple clients. For this case using the WeblogicConsole I
    saw the number of bean instances growing. This would indicate thatsame
    row is
    mapped to multiple bean instances in the pool, which prompted my
    question.
    Stefan
    "Anand Byrappagari" <[email protected]> wrote:
    Think of entity beans as mapping to a row in a database. Access
    to
    a
    single
    row is synchronized not to all the rows. So it still makes sense
    to
    have
    multiple instances possibly mapping to multiple rows in the database.
    -- Anand
    "stefan" <[email protected]> wrote in message
    news:[email protected]...
    Weblogic(6.1) deployment descriptor allows configuration of entitybean
    pool size
    and cache size. Since calls from multiple clients to the same
    entity
    bean
    are
    serialized what is the benefit of having multiple instances in
    an
    entity
    bean
    pool?
    Thanks,
    Stefan

  • Global Variable in entity beans

    Dear Friends,
    For example let us think that we have an entity bean for Customer.
    and we created an instance of that bean for customer A and then for customer B.
    So will the global variables in Customer bean be shared across Customer A and Customer B or will there be seperate instances for both Customers.
    Thanking You,
    Chamal.

    Your concepts seem to be a little messed up.
    For entity bean, remember the following:
    1. each object/instance of entity bean represents a record in a database
    2. when a client looks up an entity bean (typcially by using findByPrimaryKey method on home object), the record from database is searched and its values are stored in Entity Beans variables (this is probably what you mean by Global Variable. But thats an incorrect terminology in Java/J2EE. Class attribute is the correct word)
    3. In step 2, you fetched a record and that record is represented by a java object, which is nothing but entity bean.
    4. Now if you make changes to this java object, these changes will persist in the database. That is the essence of entity bean.
    5. If you use the home object's findByPrimaryKey method and look for the same record, no new object will be created. The 2 remote objects will point to the same entity bean on the server.
    6. If yo use the home object's findByPrimaryKey method and look for another record/customer, a new object will be created on the server. This new entity bean will map to the new record.
    Note taht the attribtues of CustomerA and customerB will never be shared.
    hope that helps

  • Error in EJB client program (javax.naming.NoInitialContextException)

    Hi folks ,
    I'm new to j2ee programming and using Netbeans 5.5 , i created a session bean program and deployed successfully in JOnAS application server but i'm not able to run the client program which invokes session bean (EJB module ).
    when i run client program i'm getting the following error .
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
            at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
            at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
            at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at SimpleSessionClient.Main.main(Main.java:33)
    BUILD SUCCESSFUL (total time: 21 seconds)
    but the same program runnig perfectly when i deploy in Java System Application Server(8.2(JSAS))
    I included j2ee.jar and appserv-rt jar in classpath of client program for JSAS i don't know what are the jar files (which does the same function as j2ee.ar,appserv-rt.jar ) which is to be included for JOnAS .
    i'm struggling with this for the past two weeks . please tell me the solution .
    Thanks in advance

    Thanks for the suggestion artntek.
    I located the jndi.properties file in the %J2EE_HOME%\lib\classes folder, and I copied it to the %J2EE_HOME%\bin directory, but nothing seems to have changed.
    does anyone know what value should be associated with Context.INITIAL_CONTEXT_FACTORY in the properties for the InitialContext object? More specifically, what value should be used for the reference install of the 1.3 j2ee release from sun?
    This error suggests to me that a class name must be specified for the initial naming context factory - but I don't know what to use.

  • CMP Entity Bean's problem with MS-SQL Server 2000

    Hi everyone!
    I have a problem regarding CMP Entity Bean on OC4J.
    I made one CMP Entity Bean and deployed it to OC4J.
    It was successful.
    I used MS-SQL Server 2000 as Datasource.
    So, I installed MS-SQL Server's JDBC Driver and add some jar files to classpath.
    And I updated 'data-sources.xml' in OC4J's config directory.
    Then, I updated also 'orion-ejb-jar.xml' in my application's directory.
    I changed data-source's name to my data-source's name which use MS-SQL Server 2000.
    Finally, I started OC4J and EJB Client program which called Enitiy Bean's create method.
    But, The error occured which was 'Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence'.
    What's wrong? I need any helps.
    Here is stack overflow message. Thank you. Best regards.
    com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: Database error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]LINE 1: '.' Wrong sentence.
         at UserHome_EntityHomeWrapper2.create(UserHome_EntityHomeWrapper2.java:1114)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:80)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    at connection to localhost/127.0.0.1 as admin
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1530)
         at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1453)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:53)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
         at __Proxy0.create(Unknown Source)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.create(UserBeanTestClient1.java:73)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.<init>(UserBeanTestClient1.java:49)
         at com.emc.ksc.ejb.user.UserBeanTestClient1.main(UserBeanTestClient1.java:1077)

    Hi Young,
    From the information you have supplied, my guess is that the SQL
    string that OC4J is sending to SQL-Server is incorrect. So it may
    help if you could see the exact SQL string. In order to see the
    SQL string, I suggest you either run OC4J in "debug" mode, or try
    using "P6 Spy".
    The following web page has details on running OC4J in "debug" mode:
    http://kb.atlassian.com/content/atlassian/howto/orionproperties.jsp
    And here is the web page for "P6 Spy"
    http://www.provision6.com/
    And these other web sites may also be of help (in general):
    http://www.orionserver.com
    http://www.orionsupport.com
    http://www.atlassian.com
    http://www.elephantwalker.com
    Good Luck,
    Avi.

Maybe you are looking for

  • 1st Generation iPod (5GB) not working with new iMac

    Hi, i have the Problem, that my 1st generation iPod is not detected by my new imac (20'' 2,4 Ghz). When i plug in the firewire cable, nothing happens. DiscUtility sees no disc at all. But when i plug in the iPod "behind" another Firewire disc (acting

  • Active Directory? Can't get it to work.

    I am not sure if my network and/or server is really misbehaving or that I am just too stupid to understand how this should work. I am preparing my macmini server to run a small (audiovisual) company network. I especially want to use the server as a m

  • Designer 9i together with Forms 6i

    Hello, supose I've got btoh Developer Suites, 6i and 9i, installed on my client (W2K)in two different ORACLE_HOMES. Is it possible to open the 6i forms when running the 9i designer? The issue is, that we don't want to upgrade to Webforms but using th

  • Project folder list not sorted!

    Hi, I've just downloaded and installed SunStudio 12 on Linux x86. Then I created a new C++ project from existing code pointing SunStudio at my project's source folder which contains many subfolders. Everything went fine except that the list of projec

  • HP Pavilion p7-1451 USB 3.0 and Bluetooth drivers for Windows Server 2008 R2

    I bought an HP Pavilion p7-1451 so I could have an affordable, yet reasonably powerful machine to put a server software development environment on (I'm a software engineer). It came with Windows 8, but I needed Windows Server 2008 R2, which I own thr