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.
Similar Messages
-
Issue when accessing standard LM transactions via ITS
Hi,
We are implementing WM using ITS Mobile.
We have developed certain custom screens and also used standard transactions such as LM02 and LM04.We have created a internet service for transaction LM01 and published all our custom and standard screens within the service.
When testing the transactions in R/3 using LM01 transaction..there were no issue...
But when testing the same in ITS....once we enter into a standard transaction like LM02(By clicking the corresponding menu entry) and click on Back button...it must bring me back to my menu( transaction LM01)...instead...my ITS session gets logged off...displaying message...'You have been logged off from SAP NetWeaver Application Server'.
We are facing the same issue when we try to access standard LM transactions via ITS...
I tried to analyze by debugging from ITS....but the flow of R/3 and ITS remains the same...
These are my service parameters..
~THEME 99
~SINGLETRANSACTION 1
~ITSMOBILE 1
~TRANSACTION LM01
~SOURCES ZWM_MENU,itsmobile
~GENERATEDYNPRO 1
~POPUPS 1
Did any of you face a similar kind of issue when accessing standard LM transactions in ITS ?
Kindly Suggest.
Regards,
Thyagu.
Edited by: Thyagu Natarajan on Jan 25, 2011 1:00 PMHello,
I am also trying to implement WM using ISTMobile, but i have a little problem... when i am in my local network the service works and calls the page in the browser, but when i am in other network it gives me "Could not connect to remote server" (off course).
I undertand that i can´t access my server through other networks... but can anyone tell me if i it is possible to access SAP ITSMobile transactions through the internet?? Is the solution create a VPN network to my local network or something like that?
Thanks a lot. -
How to use same transaction when calling CMP entity beans and DAO (JDBC)
We are currently using Weblogic 8.1 SP2 with an Oracle 10g database (using XA thin and non-XA drivers).
We have a session bean that invokes an entity bean and a DAO (data access object pattern) in order to add data in 2 separate tables (account and history). Rows are added to the first (account) table using a CMP Entity bean while inserts are done in the 2nd (history) table using a DAO. Here is some pseudo code:
addHistorySessionBean (trans-attribute="Required")
begin
Step #1 - call addAccountEntityBean (trans- attribute="Required")
Step #2 - call addHistoryDAO (get datasource, connection)
end
The 2nd table (history) has a foreign key constraint to ensure that the corresponding key exists in the first (account) table. Unfortunately, DAO inserts on the 2nd (history) table fail with a foreign key constraint violation (INTEGRITY CONSTRAINT VIOLATION - PARENT KEY NOT FOUND!) since they cannot see the row added to the 1st (account) table in step #1 by the CMP entity bean.
How does one ensure that all this is done in a single transaction ? It appears that the app server creates two seperate transactions (one for the session bean facade and the entity bean and a 2nd transaction (when we retrieve a connection using the same data source JNDI name) for the DAO.
A post on server side suggested using a "<resource-ref>" in the session bean to tie the two potentially separate transactions together, but that does not work for us. However, I am not sure if we are doing that correctly. After we define the resource ref in the session facade bean, do we use the resource ref "name" attribute to lookup the datasource or do we still lookup the datasource by JNDI name ? Do we need to define the resource-ref tag in the entity bean also ?
Does Weblogic allow using a single transaction for this type of a scenario ? How does one specify within Weblogic that the same transaction should be utilized by the entity bean and any subsequent DAOs?
People have also suggested that we defer constraint checking until the transaction(s) are committed but that sounds like a work acount without addressing this issue. Would postponing the constraint checking in Oracle cause any additional overhead ?
Any suggestions with specific examples or documentation on how to address this issue will be gratefully appreciated.Thanks for your suggestion. Unfortunately, this does not work since it appears that there are 2 separate transactions going on here. One, the original one initiated by the session bean and used by the entity bean and the other initiated by the DAO. Any other ideas appreciated.
Hi,
Try setting the delay-database-inserts tag to
ejbCreate in RDBMS descriptor file.
http://bernal/stage/wls/docs81/ejb/DDreference-cmp-jar
.html#1113981
vasanthi ramesh -
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 2302hi 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 -
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 SeetharamHi,
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!!!
-DanThe 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 -
Ejbc outofmemory error in weblogic 8.1 sp2 when compiling cmp entity beans
I have a set of entity beans which compiled [ejbc step]fine under weblogic7.0 sp4. But when i try to to the same thing under weblogic 8.1 i get an outofmemory error. Any pointers
I am using 81 sp4
-
Recurring CacheFullException when creating new Entity Bean
Normally I can create new instances of my Entity Bean just fine. However, at some point (whether it's after a rollback or not, I don't yet know), I get a CacheFullException when trying to create a new Entity Bean.
The CacheFullException exception shows a size that increments by one each time this error occurs. The reported size in the exception continually increases way past the max-beans-in-cache amount of 1000. Yet, the Administrator console reports the "Cached beans current count" as zero. So, the cache appears empty, yet every attempt to create a new entity bean fails with a CacheFullException!
I am using Weblogic Server 8.1 SP3, database concurrency strategy, BMP, and Oracle 9i. The Entity Bean's primary key class was generated by EJBGen (primary key is a java long).
Stopping and restarting the Weblogic server fixes the problem temporarily.
Any help would be greatly appreciated.
JimYes, but if objects are equal they should have same
hashCode. If it is not happening, you have a problem.Yes, and equal objects do have the same hash code. Please see below for primary key class implementation as generated by EJBGen 2.16.
There can be a bug in reporting number of beans.OK, are you saying there is a bug that sometimes shows 0 beans in the cache when the cache is actually full? And even if the cache were full, all the beans would have to be involved in transactions for there not to be room for one more new bean in the cache. And I know that there are no other transactions going on, because this is an isolated system that only I am using. Again, Weblogic Server 8.1 SP3.
It is possible if your PKs don't implement
equals/hashCode correctly.They look correct to me. Here is the primary key class implementation as generated by EJBGen 2.16. The primary key is a java long, and I am using CMP (not BMP as I mistakenly reported earlier).
public class StatusPK implements Serializable {
public long statusID;
public StatusPK() {}
public StatusPK(long statusID) {
this.statusID = statusID;
private int m_hashCode = 0;
public int hashCode() {
if(0==m_hashCode) {
m_hashCode = ((int) statusID);
return m_hashCode;
public boolean equals(Object other) {
if(other==this) return true;
if(null==other) return false;
if(other.hashCode() != hashCode()) return false;
try {
StatusPK other2 = (StatusPK) other;
return (this.statusID==other2.statusID)
catch(ClassCastException ex) {
return false;
The only problem I see with this class is if the default constructor (no args) would be called, then the primary key and hashCode would always be zero. However, I'm assuming here that EJBGen knows what it is doing and that the default constructor is never actually used. In addition, I know that all of the beans in the database have valid primary keys, and they were created the same way that eventually continually fails later on.
Thanks...
jereitz -
Issue when inserting Child Entity (Notes) with Contact
Hi,
I am getting the following error message when inserting Contacts with a child entity i.e. Notes which is quite misleading
SOAP fault from Item: OnDemandServicesObjMgr_eng_44477.log(SBL-DAT-00542)Method 'SetFieldValue' of business component 'Contact Note' (integration component 'Contact_Contact Note') returned the following error: "Access denied.(SBL-DAT-00542)"(SBL-EAI-04376
As suggested in earlier post I have tried providing values for fields NotesID and ContactID as well and even though it gives this error message.
Thanks
ArifHi, From the error message it looks like the access profile settings for the WS user doesn't have required privileges to create a note for contact. You make have to check access profile settings first and then try it
-- Venky CRMIT -
Performance issue when accessing a CRL file
Hi,
In an application we receive sign and verify files(ordinary information files) as seperate processes. When signing files we do a check on the CRL of the signing certificate. Below are the steps in which the check is done:
1- Receive a file. Get its signing certificate from a repository.
2-save/cache the CRL file in a directory(we do check if the file already exists when creating). We have configured a time out period with which the CRL will be updated in case of modifications.
File file = new File(cacheDirSystem.getProperty("file.separator")+crlUrl(url));+
fs = new FileOutputStream(file);
X509CRL crl.writeTo(fs);
3-Get the CRL Distribution Point from the signing certificate and load the file that was saved to check with the Certificate Revocation Lists.
String as[] = getDistributionPointNameURIs((GeneralNames)dpName);
File file = new File(cacheDirSystem.getProperty("file.separator")+modifyUrl(as));+
lastModified=file.lastModified();
fstream = new FileInputStream(file);
crlObject.crl=new X509CRL(fstream);
When running signing processes with more than 150 files(the file size can go upto 2MB) over a period of time, the CRL is sometimes not found and InvalidCRLException is thrown. I think its some problem with accessing the CRL file concurrently since it could also be updated at some point.
Im trying to figure out if a file lock or some other way would help to reslove this. I need help/suggestions on this.
Thanks in advanceI think its some problem with accessing the CRL file concurrentlyUndoubtedly. You should write the new data to a new file and do a delete/rename operation. All clients should cope with not finding the CRL file by retrying a couple of times in case they tried between the delete and the rename.
This is a file handling question, or concurrency question, not really a security question. -
Authentification issue when accessing by web
hi,
i am trying to publish by planning folder on BSP interface
after having generated the pages, i tried to see my page and i get the following message : "please activate single sign on service"
could someone tell me hot to activate this service ?
thanks,
Chea-LieHi,
Activate Single Sign On (SSO) with the following profile parameters: (On (SSO) with following profile parameters necessary)
- login/accept_sso2_ticket=1
- login/create_sso2_ticket=1 or 2
- icm/server_port_...=PROT=HTTPS ...
To change these profile parameters, you need to reboot the server.
Also refer OSS note 817529 and check out the link https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sso overview.pdf
Hope it helps.
Regards,
Nataraj.
Message was edited by: Natarajan Radhakrishnan -
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!!
Isidrogetter 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 -
How to specify JDBC Oracle url using deployment tool - Entity Bean
Hello I'am new to EJB.
When creating a entity bean-managed persistence and you need to specify the jdbc url with user name
and password to establish a connection object, how does one specify that in the deployment
tool?
Heres an example of what has in the J2EE tutorial has in AccountEJB to get an connection object
private String dbName = "java:comp/env/jdbc/AccountDB";
private void makeConnection() throws NamingException, SQLException {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
con = ds.getConnection();
Now if my oracle jdbc url is to be jdbc:oracle:thin:@Abe:1521:dev
ie My host is Abe, port number 1521 and database name of dev and username/password will be system/manager.
what would my dbName be at the top?
Would my JNDI lookup of a DataSource resource "java:comp/env/jdbc/AccountDB" become "java:comp/env/jdbc/dev" for starters?
In the Resource Factories Reference Code I've add a reference of
Coded Name: jdbc/dev
Type: javax.sql.DataSource
Authentication: Container
and down the bottom of the I've put JNDI Name: MyAccount
according to the AccountClient code of:
Context initial = new InitialContext();
Object objref = initial.lookup("MyAccount");
and put User Name of "system" and Password of "manager"
I'am sure in the source code I have to put
Class.forName("oracle.jdbc.driver.OracleDriver")
else you would get that no sutitable driver error, maybe you don't have to if ejb server is smart enough?
What I'am confuse about is where to specify the jdbc url of "jdbc:oracle:thin:@Abe:1521:dev" ??
Know it won't work because of this vital part. Do you have to put that somewhere else in the deployment tool or properties file, or some other tool??
Please help
Thanks
Abraham KhalilWhen running the client after successful deployment with jdbc, I'am getting
javax.naming.CommunicationException: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : minor code: 1398079699 completed: Maybe
at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:923)
at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:281)
at com.sun.corba.ee.internal.corba.TCUtility.unmarshalIn(TCUtility.java:274)
at com.sun.corba.ee.internal.corba.AnyImpl.read_value(AnyImpl.java:554)
at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:605)
at com.sun.corba.ee.internal.iiop.CDRInputStream.read_any(CDRInputStream.java:252)
at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.readAny(Util.java:203)
at javax.rmi.CORBA.Util.readAny(Unknown Source)
at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.lookup(Unknown Source)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:133)
at javax.naming.InitialContext.lookup(Unknown Source)
at AccountClient.main(AccountClient.java:21)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:151)
at javax.naming.InitialContext.lookup(Unknown Source)
at AccountClient.main(AccountClient.java:21)
One thing I don't like about EJB is that everything is transparent which is good! But its much
harder to debug! :( Tried to see if I can figure it out. Hope someone has seen this problem before? -
Problems accessing tables in oracle database with ejb entity bean
I have created a simple server application that uses an entity bean (version 2.0) for an existing table in oracle database, and a session bean that is used as an outside interface for performing operations on that table.
after deploying the server and client application the client attempts to perform an operation with the session bean remote interface it obtained.
The session bean uses a locale interface to communicate with the entity bean, but when it tries to use its methods (create, findByXXX) it always get the following Exception: java.sql.SQLException: ORA-00942: table or view does not exist.
the table of course exists, and the username password I'm using has all the permissions needed for this table.
note - I'm using the Forte enterprise edition 4.0 as developer tool.
I'll be glad to get some help.
Here is the full stack trace of the exception:
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; nested exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
javax.ejb.EJBException: nested exception is: java.sql.SQLException: ORA-00942: table or view does not exist
java.sql.SQLException: ORA-00942: table or view does not exist
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at com.sun.ejb.persistence.SQLEngine.ejb20Finder(SQLEngine.java:226)
at com.sun.ejb.persistence.PartitionImpl.ejbFinder(PartitionImpl.java:736)
at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM.ejbFindByEmail(UserInfoEJB_PM.java:393)
at com.cti2.telco.core.ejb.entity.userInfo.UserInfoEJB_PM_LocalHomeImpl.findByEmail(UserInfoEJB_PM_LocalHomeImpl.java:64)
at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:77)
at com.cti2.telco.core.ejb.UserManagerEJB.authenticate(UserManagerEJB.java:68)
at com.cti2.telco.core.ejb.UserManagerEJB_EJBLocalObjectImpl.authenticate(UserManagerEJB_EJB
LocalObjectImpl.java:63)
at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB.userLogin(TelcoFacadeEJB.java:80)
at com.cti2.telco.core.ejb.dispatch.TelcoFacadeEJB_EJBObjectImpl.userLogin(TelcoFacadeEJB_EJBObjectImpl.java:24)
at com.cti2.telco.core.ejb.dispatch._TelcoFacadeEJB_EJBObjectImpl_Tie._invoke(Unknown Source)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatchToServant(GenericPOAServerSC.java:519)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.internalDispatch(GenericPOAServerSC.java:204)
at com.sun.corba.ee.internal.POA.GenericPOAServerSC.dispatch(GenericPOAServerSC.java:112)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:273)
at com.sun.corba.ee.internal.iiop.RequestProcessor.process(RequestProcessor.java:84)
at com.sun.corba.ee.internal.orbutil.ThreadPool$PooledThread.run(ThreadPool.java:99)
...Well it seems like the problems has a simple explanation. The Forte assigns a default table name (<entityName>EJBTable) when creating an entity bean from an existsing table in DB (which is not the same as the one it was created from !!!). Also, for reason unknown, when you deploy these entity beans, it doesn't even create the new table under its new name (even if instructed to).
So using the Forte we managed to use successfuly only entity beans that were created "from scretch" (when deployed their tables are created).
Does anyone know how to change the default name the Forte uses, and make it work properly with entity beans created from an existsing table (without going over the xml's) ? -
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
Maybe you are looking for
-
TS1363 how can i restart my 2004 ipod click wheel?
How can i restart my 2004 model ipod (click wheel) on my computer and on my itunes?
-
How can I set multiple videos to "TV Show"?
I'm importing an entire season and they all default to "Movie". So, I know that I can set the video type to "TV Show", but if I select more than one video, there is no "Video" tab. Does anyone know how to set the types of multiple videos at once?
-
Clarification relating to BDC for MD61 transaction
Hi, Did any one made any development for MD61 transaction. I am planning to do an BDC for upload of planning data for the different periods and for different materials. DId any one found any complexities in this development and how it is suggest
-
HT5887 Can I use Airdrop between my iPad Mini and my Mac desktop? If so how?
I am trying to use Airdrop to share files between my iPad and my Mac desktop. I can back up my iPad to the pc over the wireless network but I cannot get Airdrop to work. Any suggestions appreciated.
-
Question about characteristics
Hi there: What does document mean in additional data tab when creating characteristic? What does it be used for?