Ejbc error in entity bean
I am making a entity bean.It is giving a ejbc error >>
Error processing 'META-INF/weblogic-ejb-jar.xml': In weblogic
-ejb-jar.xml, an entity-descriptor element was found for EJB 'sachinBeanEntity'.
This EJB was not declared as an Entity bean in ejb-jar.xml.
[java] ERROR: ejbc found errors
Here 'sachinBeanEntity' is my Entity bean.
The corresponding contents of ejb-jar.xml is >>
<entity>
<ejb-name>sachinBeanEntity</ejb-name>
<home>com.niit.oem.mst.ejb.sachinHomeEntity</home>
<remote>com.niit.oem.mst.ejb.sachinEntity</remote>
<ejb-class>com.niit.oem.mst.ejb.sachinBeanEntity</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>sachinBeanEntity</abstract-schema-name>
<cmp-field>
<field-name>Name</field-name>
</cmp-field>
<cmp-field>
<field-name>Id</field-name>
</cmp-field>
<primkey-field>Id</primkey-field>
<security-identity><use-caller-identity/></security-identity>
</entity>
The corresponding contents of weblogic-ejb-jar.xml is >>
<ejb-name>sachinBeanEntity</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<local-jndi-name>sachinBeanLookUpEntity</local-jndi-name>
Pl suggest how to remove the error from ejbc.
Thanx
robby
ejbc uses classloader.getResourceAsStream to find the ejb-jar.xml. Is it possible
that it's finding another copy of the file. I would change something in your
ejb-jar.xml (ie make it so the parser will fail.) and make sure that ejbc hits that
error.
If you're still having problems, can you post your ejb-jar.xml and
weblogic-ejb-jar.xml?
-- Rob
robby wrote:
I am making a entity bean.It is giving a ejbc error >>
Error processing 'META-INF/weblogic-ejb-jar.xml': In weblogic
-ejb-jar.xml, an entity-descriptor element was found for EJB 'sachinBeanEntity'.
This EJB was not declared as an Entity bean in ejb-jar.xml.
[java] ERROR: ejbc found errors
Here 'sachinBeanEntity' is my Entity bean.
The corresponding contents of ejb-jar.xml is >>
<entity>
<ejb-name>sachinBeanEntity</ejb-name>
<home>com.niit.oem.mst.ejb.sachinHomeEntity</home>
<remote>com.niit.oem.mst.ejb.sachinEntity</remote>
<ejb-class>com.niit.oem.mst.ejb.sachinBeanEntity</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>sachinBeanEntity</abstract-schema-name>
<cmp-field>
<field-name>Name</field-name>
</cmp-field>
<cmp-field>
<field-name>Id</field-name>
</cmp-field>
<primkey-field>Id</primkey-field>
<security-identity><use-caller-identity/></security-identity>
</entity>
The corresponding contents of weblogic-ejb-jar.xml is >>
<ejb-name>sachinBeanEntity</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<local-jndi-name>sachinBeanLookUpEntity</local-jndi-name>
Pl suggest how to remove the error from ejbc.
Thanx
robby
Similar Messages
-
Error deploying entity bean on web logic server
i am trying to deploy a container managed persistence entity bean on web logic server when i run the command ejbc which generates the final jar file ready to deploy having its stub and skeleton it gives me the error that the return type of create(int) method should have a type of bean home interface while in accordance with ejb1.1 specicication it should be the type of primary key and a null value should be returned.
plz let me know where i am doing it wrong.thanks for ur quick response sir i am using this services provided by sun microsystem first time and
am really thankful to Sun Microsystem for this great deal of help to the new commers but sir my problem is still there.
following is the method which i have written in the code
public InvoicePK ejbCreate(int id)
this.id=id;
return null;
and here it is the error generated by the server deployment tool.
[9.2.8] In EJB Invoice, the return type for the create method create(int) must be the bean's remote interface type.
[9.2.8] In EJB Invoice, the findByPrimaryKey method must return the Entity bean's remote interface type.
[9.2.8] In EJB Invoice, the return type for the method findByPrimaryKey(com.swi.InvoicePK) must be the entity bean's remote interface type (for a single-object finder) or a collection thereof (for a mult-object finder).
the detail of files created by me are as follows.
1. Invoice (Entity Bean)
2. InvoicePK (Primary Key file)
3. MyRemoteInterface (remote interface for entity bean)
4. MyHomeInterface (home interface for entity bean)
plz let me know where i am doing wrong and oblige. -
Help me to remove this Error in Entity Beans
this is the Error i am getting along with this Error i have also put my ds xml file and other related file , please help me to remove this error
at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(Re
flectedDispatcher.java:91)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:64)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:884)
at $Proxy18.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:414)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy71.start(Unknown Source)
at org.jboss.ejb.EjbModule.startService(EjbModule.java:367)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:884)
at $Proxy18.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:414)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy15.start(Unknown Source)
at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:570)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:304)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:460)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:201)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
loop(AbstractDeploymentScanner.java:212)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
run(AbstractDeploymentScanner.java:191)
Caused by: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml
: datasource-mapping MySql not found
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDB
CEntityMetaData.java:483)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init
(JDBCApplicationMetaData.java:312)at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
lFileLoader.java:67)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
a(JDBCStoreManager.java:721)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
StoreManager.java:409)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
r.java:353)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
er.java:155)
at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
... 65 more
11:37:34,679 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.6/server/default/d
eploy/ProductBean.jar
11:37:34,679 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
MBeans waiting for other MBeans:
ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
state: FAILED
I Depend On:
Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
in jbosscmp-jdbc.xml : datasource-mapping MySql not found
Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
tasource-mapping MySql not found
MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.j2ee:jndiName=FaqMstLocal,plugin=pool,service=EJB
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=FaqMstLocal,service=EJB
state: FAILED
I Depend On:
Depends On Me: MBeanException: org.jboss.deployment.DeploymentException: Error
in jbosscmp-jdbc.xml : datasource-mapping MySql not found
Cause: org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : da
tasource-mapping MySql not found
1 ) Contain of mysql-ds.xml File
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mysql-ds.xml,v 1.1.2.1 2003/12/12 19:19:56 starksm Exp $ -->
<!-- Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->
<datasources>
<local-tx-datasource>
<jndi-name>MySql</jndi-name>
<connection-url>jdbc:mysql://192.168.111.44:3306/temp</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>new_temp</user-name>
<password>temp</password>
</local-tx-datasource>
</datasources>
2) i have also add datasource mappping in standardjaws.xml and standardjbosscmp-jdbc.xml file
File :standardjaws.xml
<datasource>java:/MySql</datasource>
<type-mapping>MySql</type-mapping>
File : standardjbosscmp-jdbc.xml
<datasource>java:/MySql</datasource>
<datasource-mapping>MySql</datasource-mapping>have a look at http://www.onjava.com/pub/a/onjava/2004/02/25/jbossjdbc.html
-
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 -
Error in weblogic.ejbc while deploying the CMP entity bean.!!!
Tried to deploy the entity bean[CMP] with the following folder structure.
examples [package]
Product.class
productBean.class
etc.
META-INF
ejb-jar.xml
weblogic-ejb-jar.xml.
weblogic-cmp-rdbms-jar.xml
created a jar..with the following command
1.jar cvf rgegcmp.jar examples META-INF
tried to create the stubs and skeletons using weblogic.ejbc command.
2. java weblogic.ejbc rgegcmp.jar rgegcmp1.jar
C:\btcomprj\BTCOMPRJ\classes>java weblogic.ejbc rgegcmp.jar rgegcmp1.jar
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.ProductBean which is in
the classpath. This class should only be located in the ejb-jar file.>
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.ProductHome which is in
the classpath. This class should only be located in the ejb-jar file.>
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.Product which is in the
classpath. This class should only be located in the ejb-jar file.>
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.ProductLocalHome which i
s in the classpath. This class should only be located in the ejb-jar file.>
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.ProductLocal which is in
the classpath. This class should only be located in the ejb-jar file.>
<Oct 11, 2004 4:29:29 PM IST> <Warning> <EJB> <010054> <EJB Deployment: Product has a
class examples.ProductPK which is in th
e classpath. This class should only be located in the ejb-jar file.>
ERROR: Error from ejbc: null
java.lang.NullPointerException
at
weblogic.ejb20.deployer.CompositeMBeanDescriptor.getPersistenceUseIdentifier(Composite
MBeanDescriptor.java:1484)
at weblogic.ejb20.deployer.CMPInfoImpl.<init>(CMPInfoImpl.java:104)
at
weblogic.ejb20.deployer.EntityBeanInfoImpl.<init>(EntityBeanInfoImpl.java:135)
at
weblogic.ejb20.deployer.BeanInfoImpl.createBeanInfoImpl(BeanInfoImpl.java:349)
at
weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDeploymentInf
oImpl.java:438)
at
weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:16
5)
at weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:151)
at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:332)
at weblogic.ejbc20.runBody(ejbc20.java:479)
at weblogic.utils.compiler.Tool.run(Tool.java:126)
at weblogic.ejbc.main(ejbc.java:29)
ERROR: ejbc found errors
1. want to know why Null pointer exception is thrown by 'weblogic.ejbc'...
is it indicating an error in my code(bean); .....
i dont know how to fix the error.
find the deployments descriptors which i have written for deployment.
weblogic-ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Product</ejb-name>
<jndi-name>rgexample</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>Product</ejb-name>
<home>examples.ProductHome</home>
<remote>examples.Product</remote>
<local-home>examples.ProductLocalHome</local-home>
<local>examples.ProductLocal</local>
<ejb-class>examples.ProductBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>examples.ProductPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>ProductBean</abstract-schema-name>
<cmp-field>
<field-name>productID</field-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<cmp-field>
<field-name>basePrice</field-name>
</cmp-field>
<query>
<query-method>
<method-name>findByName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE name =
?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findByDescription</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE description
= ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findByBasePrice</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE basePrice =
?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findExpensiveProducts</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE basePrice >
?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findCheapProducts</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE basePrice < ?1]]>
</ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllProducts</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM ProductBean AS a WHERE productID
IS NOT NULL]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Product</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
weblogic-cmp-rdbms-jar.xml
<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls700/dtd/weblogic-rdbms20-persistence-700.dtd'>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>Product</ejb-name>
<data-source-name>examples-dataSource-demoPool</data-source-name>
<table-map>
<table-name>TORDER</table-name>
<field-map>
<cmp-field>productID</cmp-field>
<dbms-column>PRODUCTID</dbms-column>
</field-map>
<field-map>
<cmp-field>name</cmp-field>
<dbms-column>NAME</dbms-column>
</field-map>
<field-map>
<cmp-field>description</cmp-field>
<dbms-column>DESCRIPTION</dbms-column>
</field-map>
<field-map>
<cmp-field>basePrice</cmp-field>
<dbms-column>BASEPRICE</dbms-column>
</field-map>
</table-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>True</create-default-dbms-tables>
</weblogic-rdbms-jar>If you can have a look at a cmp example in the samples that ship with the server. My guess is that the weblogic-ejb-jar.xml file is missing the <persistence-use> element which for 810 would look like:
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
I seem to recall that the elements might be slightly different in structure for the wls700 version of the DTD, so please check that (I cannot, I'm at home and don't have everything here).
Give that a try and see if it doesn't solve your compilation failure.
Also, the compilation should not be throwing a null pointer exception in a case like that, I consider that to be a bug.
-thorick -
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
-
Error while deploying an entity bean
Hi,
I am trying to deploy an entity bean in weblogic 7.0 .
My weblogic-ejb-jar.xml has the entry as :
<weblogic-enterprise-bean>
<ejb-name>enroleejb.ManagedObjectImplHome</ejb-name>
<stateless-session-descriptor>
<pool>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
<initial-beans-in-free-pool>0</initial-beans-in-free-pool>
</pool>
<stateless-clustering>
<stateless-bean-is-clusterable>True</stateless-bean-is-clusterable>
<stateless-bean-methods-are-idempotent>False</stateless-bean-methods-are-ide
mpotent>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>60</trans-timeout-seconds>
</transaction-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>enroleejb.ManagedObjectImplHome</jndi-name>
</weblogic-enterprise-bean>
When I run ejbc it gives the following error.
[java] The file /meta-inf/weblogic-cmp-rdbms-jar.xml, specified in a
type-storage element
of your weblogic-ejb-jar.xml descriptor, does not exist in the jar
file.
[java] at
weblogic.ejb20.persistence.PersistenceType.setTypeSpecificFile(PersistenceTy
pe.java:475)
[java] at
weblogic.ejb20.persistence.PersistenceType.setupDeployer(PersistenceType.jav
a:407)
[java] at
weblogic.ejb20.deployer.CMPInfoImpl.setup(CMPInfoImpl.java:114)
[java] at
weblogic.ejb20.ejbc.EJB20CMPCompiler.generatePersistenceSources(EJB20CMPComp
iler.java:64)
[java] at
weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:223)
[java] at
weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:344)
[java] at weblogic.ejbc20.runBody(ejbc20.java:470)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:126)
[java] at weblogic.ejbc.main(ejbc.java:29)
In the generated jar file I have meta-inf\weblogic-cmp-rdbms.jar file.
Still it gives the error.
What could be the problem?
Any help would be appreciated.
Thanks,
NamrataEjb jar file should have META-INF/weblogic-cmp-rdbms-jar.xml
"Sarita Satoor" <[email protected]> wrote:
Hi,
I am trying to deploy an entity bean in weblogic 7.0 .
My weblogic-ejb-jar.xml has the entry as :
<weblogic-enterprise-bean>
<ejb-name>enroleejb.ManagedObjectImplHome</ejb-name>
<stateless-session-descriptor>
<pool>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
<initial-beans-in-free-pool>0</initial-beans-in-free-pool>
</pool>
<stateless-clustering>
<stateless-bean-is-clusterable>True</stateless-bean-is-clusterable>
<stateless-bean-methods-are-idempotent>False</stateless-bean-methods-are-ide
mpotent>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>60</trans-timeout-seconds>
</transaction-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>enroleejb.ManagedObjectImplHome</jndi-name>
</weblogic-enterprise-bean>
When I run ejbc it gives the following error.
[java] The file /meta-inf/weblogic-cmp-rdbms-jar.xml, specified
in a
type-storage element
of your weblogic-ejb-jar.xml descriptor, does not exist in the jar
file.
[java] at
weblogic.ejb20.persistence.PersistenceType.setTypeSpecificFile(PersistenceTy
pe.java:475)
[java] at
weblogic.ejb20.persistence.PersistenceType.setupDeployer(PersistenceType.jav
a:407)
[java] at
weblogic.ejb20.deployer.CMPInfoImpl.setup(CMPInfoImpl.java:114)
[java] at
weblogic.ejb20.ejbc.EJB20CMPCompiler.generatePersistenceSources(EJB20CMPComp
iler.java:64)
[java] at
weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:223)
[java] at
weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:344)
[java] at weblogic.ejbc20.runBody(ejbc20.java:470)
[java] at weblogic.utils.compiler.Tool.run(Tool.java:126)
[java] at weblogic.ejbc.main(ejbc.java:29)
In the generated jar file I have meta-inf\weblogic-cmp-rdbms.jar file.
Still it gives the error.
What could be the problem?
Any help would be appreciated.
Thanks,
Namrata -
WLS 5.1.0 SP 12 ejbc throws NoSuchMethodError on entity beans
Greetings all,
Due to a trashed hard disk, I'm in the middle of getting WebLogic
server reinstalled. Because of some problems with Oracle 8.1.6 and
WLS 5.1.0 SP9, I've been trying to get SP12 to run, with little luck.
I suspect an installation / configuration problem, but I don't know
what it is.
The symptom is that I can't compile entity beans - ejbc throws a
NoSuchMethodError exception. For the sake of simplicity, and to prove
to myself it wasn't our code, I tried building one of the examples,
and it has the same problem. Does anyone see anything I've done
wrong in the configuration?
Below is the captured output from build & wlconfig:
C:\weblogic\examples\ejb\basic\containerManaged>build
C:\weblogic\examples\ejb\basic\containerManaged>if "" == "c:\jdk1.3.1\jre"
set JAVA_HOME=\java
C:\weblogic\examples\ejb\basic\containerManaged>if "" == "c:\weblogic" set
WL_HOME=\weblogic
C:\weblogic\examples\ejb\basic\containerManaged>set
MYSERVER=c:\weblogic\myserver
C:\weblogic\examples\ejb\basic\containerManaged>set
MYCLASSPATH=c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogi
c\lib\weblogicaux.jar;c:\weblogic\
myserver\clientclasses
C:\weblogic\examples\ejb\basic\containerManaged>mkdir build build\META-INF
A subdirectory or file build already exists.
Error occurred while processing: build.
A subdirectory or file build\META-INF already exists.
Error occurred while processing: build\META-INF.
C:\weblogic\examples\ejb\basic\containerManaged>copy *.xml build\META-INF
ejb-jar.xml
weblogic-cmp-rdbms-jar.xml
weblogic-ejb-jar.xml
3 file(s) copied.
C:\weblogic\examples\ejb\basic\containerManaged>javac -d build -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\weblog
icaux.jar;c:\weblogic\myserver\clientclasses Account.java AccountHome.java
ProcessingErrorException.java AccountBean.java
C:\weblogic\examples\ejb\basic\containerManaged>cd build
C:\weblogic\examples\ejb\basic\containerManaged\build>jar cv0f
std_ejb_basic_containerManaged.jar META-INF examples
added manifest
ignoring entry META-INF/
adding: META-INF/ejb-jar.xml(in = 1210) (out= 1210)(stored 0%)
adding: META-INF/weblogic-cmp-rdbms-jar.xml(in = 1472) (out= 1472)(stored
0%)
adding: META-INF/weblogic-ejb-jar.xml(in = 975) (out= 975)(stored 0%)
adding: examples/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/containerManaged/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/containerManaged/Account.class(in = 422) (out=
422)(stored 0%)
adding: examples/ejb/basic/containerManaged/AccountBean.class(in = 3884)
(out= 3884)(stored 0%)
adding: examples/ejb/basic/containerManaged/AccountHome.class(in = 711)
(out= 711)(stored 0%)
adding:
examples/ejb/basic/containerManaged/ProcessingErrorException.class(in
=339) (out= 339)(stored 0%)
C:\weblogic\examples\ejb\basic\containerManaged\build>cd ..
C:\weblogic\examples\ejb\basic\containerManaged>java -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\weblog
icaux.jar;c:\weblogic\myserver\clientclasses -Dweblogic.home=c:\weblogic
weblogic.ejbc -compiler javac build\std_ejb_basic_containerManaged.jar
c:\weblogic\myserver\ejb_basic_containerManaged.jar
java.lang.NoSuchMethodError
at
weblogic.cmp.rdbms.codegen.StoreGenerator.addPreparedStatementBinding(Stor
eGenerator.java:839)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.preparedStatementBindings(StoreG
enerator.java:805)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.setPrimaryKeyParams(StoreGenerat
or.java:194)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:619)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
ERROR: Error from ejbc: java.lang.reflect.InvocationTargetException:
java.lang.NoSuchMethodError
at
weblogic.cmp.rdbms.codegen.StoreGenerator.addPreparedStatementBinding(Stor
eGenerator.java:839)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.preparedStatementBindings(StoreG
enerator.java:805)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.setPrimaryKeyParams(StoreGenerat
or.java:194)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:619)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target
exception:[java.lang.NoSuchMethodError]]
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:628)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target exception:
[java.lang.NoSuchMethodError]]]
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:585)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target exception:
[java.lang.NoSuchMethodError]]]]
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:585)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
ERROR: ejbc found errors
C:\weblogic\examples\ejb\basic\containerManaged>javac -d
c:\weblogic\myserver\cl
ientclasses -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\we
blogic\lib\weblogicaux.jar;c:\weblogic\myserver\clientclasses Account.java
Accou
ntHome.java ProcessingErrorException.java Client.java
C:\weblogic\examples\ejb\basic\containerManaged>wlconfig
WebLogic startup settings are presently:
CLASSPATH Prefix C:\weblogic\myserver\serverclasses
CLASSPATH
C:\weblogic\myserver\serverclasses;c:\jdk1.3.1\jre\lib\tools
.jar;c:\jdk1.3.1\jre\lib\rt.jar;c:\jdk1.3.1\jre\lib\i18n.jar;C:\weblogic\l
icense
;C:\weblogic\lib\weblogic510sp11.jar;C:\weblogic\classes;C:\weblogic\lib\w
eblogi
caux.jar;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
JAVA_HOME c:\jdk1.3.1\jre
WEBLOGIC_LICENSEDIR C:\weblogic\license
WEBLOGIC_HOME C:\weblogic
system properties:
java.security.manager
java.security.policy==C:\weblogic\weblogic.policy
weblogic.system.home=C:\weblogic
java.compiler=symcjit
weblogic.class.path=C:\weblogic\license;C:\weblogic\lib\webl
ogic510sp11.jar;C:\weblogic\classes;C:\weblogic\myserver\serverclasses;C:\
weblog
ic\lib\weblogicaux.jar
INITIAL_HEAP 64 MB
MAX_HEAP 64 MB
SERVERCLASSPATH
C:\weblogic\myserver\serverclasses;c:\jdk1.3.1\jre\lib\rt.ja
r;c:\jdk1.3.1\jre\lib\i18n.jar;C:\weblogic\lib\weblogic510sp11boot.jar;C:\
weblog
ic\classes\boot;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
Type "wlconfig -help" for program usage.Do all the examples fail to build, or just the EJB CMP examples? I ask
because in 5.1, there's a separate WebLogic_CMP_RDBMS.jar that's part of
the install process, but it's only used for CMP. If the other examples
work, then that's likely to be your problem.
-- Rob
Erik Horstkotte wrote:
Greetings all,
Due to a trashed hard disk, I'm in the middle of getting WebLogic
server reinstalled. Because of some problems with Oracle 8.1.6 and
WLS 5.1.0 SP9, I've been trying to get SP12 to run, with little luck.
I suspect an installation / configuration problem, but I don't know
what it is.
The symptom is that I can't compile entity beans - ejbc throws a
NoSuchMethodError exception. For the sake of simplicity, and to prove
to myself it wasn't our code, I tried building one of the examples,
and it has the same problem. Does anyone see anything I've done
wrong in the configuration?
Below is the captured output from build & wlconfig:
C:\weblogic\examples\ejb\basic\containerManaged>build
C:\weblogic\examples\ejb\basic\containerManaged>if "" == "c:\jdk1.3.1\jre"
set JAVA_HOME=\java
C:\weblogic\examples\ejb\basic\containerManaged>if "" == "c:\weblogic" set
WL_HOME=\weblogic
C:\weblogic\examples\ejb\basic\containerManaged>set
MYSERVER=c:\weblogic\myserver
C:\weblogic\examples\ejb\basic\containerManaged>set
MYCLASSPATH=c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogi
c\lib\weblogicaux.jar;c:\weblogic\
myserver\clientclasses
C:\weblogic\examples\ejb\basic\containerManaged>mkdir build build\META-INF
A subdirectory or file build already exists.
Error occurred while processing: build.
A subdirectory or file build\META-INF already exists.
Error occurred while processing: build\META-INF.
C:\weblogic\examples\ejb\basic\containerManaged>copy *.xml build\META-INF
ejb-jar.xml
weblogic-cmp-rdbms-jar.xml
weblogic-ejb-jar.xml
3 file(s) copied.
C:\weblogic\examples\ejb\basic\containerManaged>javac -d build -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\weblog
icaux.jar;c:\weblogic\myserver\clientclasses Account.java AccountHome.java
ProcessingErrorException.java AccountBean.java
C:\weblogic\examples\ejb\basic\containerManaged>cd build
C:\weblogic\examples\ejb\basic\containerManaged\build>jar cv0f
std_ejb_basic_containerManaged.jar META-INF examples
added manifest
ignoring entry META-INF/
adding: META-INF/ejb-jar.xml(in = 1210) (out= 1210)(stored 0%)
adding: META-INF/weblogic-cmp-rdbms-jar.xml(in = 1472) (out= 1472)(stored
0%)
adding: META-INF/weblogic-ejb-jar.xml(in = 975) (out= 975)(stored 0%)
adding: examples/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/containerManaged/(in = 0) (out= 0)(stored 0%)
adding: examples/ejb/basic/containerManaged/Account.class(in = 422) (out=
422)(stored 0%)
adding: examples/ejb/basic/containerManaged/AccountBean.class(in = 3884)
(out= 3884)(stored 0%)
adding: examples/ejb/basic/containerManaged/AccountHome.class(in = 711)
(out= 711)(stored 0%)
adding:
examples/ejb/basic/containerManaged/ProcessingErrorException.class(in
=339) (out= 339)(stored 0%)
C:\weblogic\examples\ejb\basic\containerManaged\build>cd ..
C:\weblogic\examples\ejb\basic\containerManaged>java -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\weblogic\lib\weblog
icaux.jar;c:\weblogic\myserver\clientclasses -Dweblogic.home=c:\weblogic
weblogic.ejbc -compiler javac build\std_ejb_basic_containerManaged.jar
c:\weblogic\myserver\ejb_basic_containerManaged.jar
java.lang.NoSuchMethodError
at
weblogic.cmp.rdbms.codegen.StoreGenerator.addPreparedStatementBinding(Stor
eGenerator.java:839)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.preparedStatementBindings(StoreG
enerator.java:805)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.setPrimaryKeyParams(StoreGenerat
or.java:194)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:619)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
ERROR: Error from ejbc: java.lang.reflect.InvocationTargetException:
java.lang.NoSuchMethodError
at
weblogic.cmp.rdbms.codegen.StoreGenerator.addPreparedStatementBinding(Stor
eGenerator.java:839)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.preparedStatementBindings(StoreG
enerator.java:805)
at
weblogic.cmp.rdbms.codegen.StoreGenerator.setPrimaryKeyParams(StoreGenerat
or.java:194)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:619)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target
exception:[java.lang.NoSuchMethodError]]
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:628)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target exception:
[java.lang.NoSuchMethodError]]]
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:585)
at
weblogic.utils.compiler.CodeGenerator.processAt(CodeGenerator.java:607)
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:533)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
--------------- nested within: ------------------
weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException - with nested exception:
[weblogic.utils.compiler.CodeGenerationException: Exception:
'java.lang.NoSuchMethodError' while trying to invoke: setPrimaryKeyParams
at line 22 - with nested exception:
[java.lang.reflect.InvocationTargetException - with target exception:
[java.lang.NoSuchMethodError]]]]
at
weblogic.utils.compiler.CodeGenerator.parse(CodeGenerator.java:585)
at
weblogic.utils.compiler.CodeGenerator.generateCode(CodeGenerator.java:312)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:223)
at
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:182)
at
weblogic.ejb.ejbc.EJBCompiler.generatePersistenceSources(EJBCompiler.java:
403)
at weblogic.ejb.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:180)
at weblogic.ejbc.runBody(ejbc.java:307)
at weblogic.utils.compiler.Tool.run(Tool.java:80)
at weblogic.ejbc.main(ejbc.java:353)
ERROR: ejbc found errors
C:\weblogic\examples\ejb\basic\containerManaged>javac -d
c:\weblogic\myserver\cl
ientclasses -classpath
c:\jdk1.3.1\jre\lib\classes.zip;c:\weblogic\classes;c:\we
blogic\lib\weblogicaux.jar;c:\weblogic\myserver\clientclasses Account.java
Accou
ntHome.java ProcessingErrorException.java Client.java
C:\weblogic\examples\ejb\basic\containerManaged>wlconfig
WebLogic startup settings are presently:
CLASSPATH Prefix C:\weblogic\myserver\serverclasses
CLASSPATH
C:\weblogic\myserver\serverclasses;c:\jdk1.3.1\jre\lib\tools
.jar;c:\jdk1.3.1\jre\lib\rt.jar;c:\jdk1.3.1\jre\lib\i18n.jar;C:\weblogic\l
icense
;C:\weblogic\lib\weblogic510sp11.jar;C:\weblogic\classes;C:\weblogic\lib\w
eblogi
caux.jar;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
JAVA_HOME c:\jdk1.3.1\jre
WEBLOGIC_LICENSEDIR C:\weblogic\license
WEBLOGIC_HOME C:\weblogic
system properties:
java.security.manager
java.security.policy==C:\weblogic\weblogic.policy
weblogic.system.home=C:\weblogic
java.compiler=symcjit
weblogic.class.path=C:\weblogic\license;C:\weblogic\lib\webl
ogic510sp11.jar;C:\weblogic\classes;C:\weblogic\myserver\serverclasses;C:\
weblog
ic\lib\weblogicaux.jar
INITIAL_HEAP 64 MB
MAX_HEAP 64 MB
SERVERCLASSPATH
C:\weblogic\myserver\serverclasses;c:\jdk1.3.1\jre\lib\rt.ja
r;c:\jdk1.3.1\jre\lib\i18n.jar;C:\weblogic\lib\weblogic510sp11boot.jar;C:\
weblog
ic\classes\boot;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
Type "wlconfig -help" for program usage. -
Error While Deploying A CMP Entity Bean With A Composite Primary Key
Hello all,
I have a problem deploying CMP Entity beans with composite primary keys. I have a CMP Entity Bean, which contains a composite primary key composed of two local stubs. If you know more about this please respond to my post on the EJB forum (subject: CMP Bean Local Stub as a Field of a Primary Key Class).
In the mean time, can you please tell me what following error message means and how to resolve it? From what I understand it might be a problem with Sun ONE AS 7, but I would like to make sure it's not me doing something wrong.
[05/Jan/2005:12:49:03] WARNING ( 1896): Validation error in bean CustomerSubscription: The type of non-static field customer of the key class
test.subscription.CustomerSubscriptionCMP_1530383317_JDOState$Oid must be primitive or must implement java.io.Serializable.
Update the type of the key class field.
Warning: All primary key columns in primary table CustomerSubscription of the bean corresponding to the generated class test.subscription.CustomerSubscriptionCMP_1530383317_JDOState must be mapped to key fields.
Map the following primary key columns to key fields: CustomerSubscription.CustomerEmail,CustomerSubscription.SubscriptionType. If you already have fields mapped to these columns, verify that they are key fields.Is it enough that a primary key class be serializable or all fields have to implement Serializable or be a primitive?
Please let me know if you need more information to answer my question.
Thanks.
NikolaHi Nikola,
There are several problems with your CMP bean.
1. Fields of a Primary Key Class must be a subset of CMP fields, so yes, they must be either a primitive or a Serializable type.
2. Sun Application Server does not support Primary Key fields of an arbitrary Serializable type (i.e. those that will be stored
as BLOB in the database), but only primitives, Java wrappers, String, and Date/Time types.
Do you try to use stubs instead of relationships or for some other reason?
If it's the former - look at the CMR fields.
If it's the latter, I suggest to store these fields as regular CMP fields and use some other value as the PK. If you prefer that
the CMP container generates the PK values, use the Unknown
PrimaryKey feature.
Regards,
-marina -
Hi
when i tested my first session bean by IBM websphere Universal Test Client , i got the following error when execute getBookForPlatform(String workPlatform) saying error in locating entity bean Book_catalog and i tried to test Book_catalog entity bean and it's working successfuly but i do not know why seesion bean could not locate it ? :
========== the Error ===========
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: ; nested exception is:
javax.ejb.EJBException: Error getting TechLibBook_catalogLocalHome from findByPlatform method:Error locating TechLibBook_catalogLocalHome: Context: localhost/nodes/localhost/servers/server1, name: ejb/Book_catalog: First component in name Book_catalog not found.
at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException(UtilDelegateImpl.java:156)
at com.ibm.CORBA.iiop.UtilDelegateImpl.wrapException(UtilDelegateImpl.java:684)
at javax.rmi.CORBA.Util.wrapException(Util.java:295)
at apress.wsad.techlib._TechLibFacade_Stub.getBookForPlatform(_TechLibFacade_Stub.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:555)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
Caused by: java.rmi.RemoteException: ; nested exception is:
javax.ejb.EJBException: Error getting TechLibBook_catalogLocalHome from findByPlatform method:Error locating TechLibBook_catalogLocalHome: Context: localhost/nodes/localhost/servers/server1, name: ejb/Book_catalog: First component in name Book_catalog not found.
at com.ibm.ejs.container.RemoteExceptionMappingStrategy.mapEJBException(RemoteExceptionMappingStrategy.java:379)
at com.ibm.ejs.container.RemoteExceptionMappingStrategy.mapException(RemoteExceptionMappingStrategy.java:112)
at com.ibm.ejs.container.RemoteExceptionMappingStrategy.setUncheckedException(RemoteExceptionMappingStrategy.java:202)
at com.ibm.ejs.container.EJSDeployedSupport.setUncheckedException(EJSDeployedSupport.java:296)
at apress.wsad.techlib.EJSRemoteStatelessTechLibFacade_3526fe64.getBookForPlatform(EJSRemoteStatelessTechLibFacade_3526fe64.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at com.ibm.rmi.util.ProxyUtil$4.run(ProxyUtil.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.rmi.util.ProxyUtil.invokeWithClassLoaders(ProxyUtil.java:701)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1084)
at $Proxy1.getBookForPlatform(Unknown Source)
at apress.wsad.techlib._TechLibFacade_Stub.getBookForPlatform(_TechLibFacade_Stub.java:260)
... 29 more
Caused by: javax.ejb.EJBException: Error getting TechLibBook_catalogLocalHome from findByPlatform method:Error locating TechLibBook_catalogLocalHome: Context: localhost/nodes/localhost/servers/server1, name: ejb/Book_catalog: First component in name Book_catalog not found.
at apress.wsad.techlib.TechLibFacadeBean.getBookForPlatform(TechLibFacadeBean.java:92)
at apress.wsad.techlib.EJSRemoteStatelessTechLibFacade_3526fe64.getBookForPlatform(EJSRemoteStatelessTechLibFacade_3526fe64.java:22)
... 39 more
===== End of Error ======
====== the source code of session bean=======
package apress.wsad.techlib;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.*;
import java.rmi.*;
import java.lang.*;
import java.util.*;
public class TechLibFacadeBean implements javax.ejb.SessionBean
private javax.ejb.SessionContext mySessionCtx;
// Variable to keep the Home Local refernce to TechLibBook_catalog object
private TechLibBook_catalogLocalHome catalogLocalHome = null ;
// Method to get the Home Interface of the Book_catalog entity bean.
private TechLibBook_catalogLocalHome getCatalogLocalHome()
throws RemoteException
try
if (catalogLocalHome == null)
InitialContext initContext = new InitialContext();
Object objRef =initContext.lookup("ejb/Book_catalog");
catalogLocalHome = (TechLibBook_catalogLocalHome) objRef;
return (TechLibBook_catalogLocalHome) objRef;
else
return catalogLocalHome;
catch (NamingException ne)
System.out.println("Error locating TechLibBook_catalogLocalHome: " +
ne.getMessage());
throw
new RemoteException("Error locating TechLibBook_catalogLocalHome: " +
ne.getMessage());
// This business method must be promoted to the remote interface
public Vector getBookForPlatform(String workPlatform)
throws FinderException
Vector bookVector = new Vector();
TransportBean transObject;
TechLibBook_catalogLocal bookCatalogLocal = null;
Collection collBookRecords;
try
collBookRecords =
getCatalogLocalHome().findByPlatform(workPlatform);
Iterator iterator = collBookRecords.iterator();
while (iterator.hasNext())
bookCatalogLocal =
(TechLibBook_catalogLocal) iterator.next();
transObject = new TransportBean();
transObject.catalogNumber = bookCatalogLocal.getCatalog_number();
transObject.author = bookCatalogLocal.getAuthor();
transObject.bookTitle = bookCatalogLocal.getBook_title();
transObject.location = bookCatalogLocal.getLocation();
transObject.platform = bookCatalogLocal.getPlatform();
transObject.txnDate = bookCatalogLocal.getLanguage();
bookVector.addElement(transObject);
} // End of while
} // End of try
catch(FinderException fe)
System.out.println("Error executing findByPlatform method: " +
fe.getMessage());
throw
new EJBException("Error executing findByPlatform method: " +
fe.getMessage());
catch(Exception e)
System.out.println("Error getting TechLibBook_catalogLocalHome from findByPlatform method:" + e.getMessage());
throw
new EJBException("Error getting TechLibBook_catalogLocalHome from findByPlatform method:" + e.getMessage());
return bookVector;
public javax.ejb.SessionContext getSessionContext()
return mySessionCtx;
public void setSessionContext(javax.ejb.SessionContext ctx)
mySessionCtx = ctx;
* ejbCreate
public void ejbCreate() throws javax.ejb.CreateException
public void ejbActivate()
public void ejbPassivate()
public void ejbRemove()
==== End if source code =========
Please tell me what's the problem ?
with regardsi found what's the problem i made the url for lookup as the following:
lookup("java:comp/env/Book_catalog")
instead of
lookup("ejb/Book_catalog")
could anyone tell me what's the difference between 'java:comp/env/' and without it
by the way i used for lookup Datasource the following and it's working
DataSource dataSource = (DataSource)jndiContext.lookup("jdbc/TECHBOOK");
thanks -
Error while deploying Entity Beans on OC4J 10.1.3
Hi,
We have 350 entity beans in our system. Recently a new table is created as per following script.
CREATE TABLE TBLSMDTATTRIBUTECATREL
MDTCATEGORYID CHAR(7),
ATTRIBUTECATEGORYID CHAR(10),
CONSTRAINT PK_MDTATTRIBUTECATREL PRIMARY KEY (MDTCATEGORYID,ATTRIBUTECATEGORYID)
Entity Bean for the same has been created. While deploying I am facing the following error.
06/06/11 13:09:23 Notification ==> Error while compiling EJB component: file:/export/home/oc4j/j2ee/home/applications/JispAppEntities/billing-entities.jar
com.evermind.compiler.CompilationException: Method public abstract java.lang.String com.elitecore.billing.ejb.system.entity.MdtattributecatrelCMP.getMdtcategoryid() can not be declared abstract for entity 'Mdtattributecatrel'
at com.evermind.server.ejb.compilation.CMPObjectCompilation.verifyMethods(CMPObjectCompilation.java:800)
at com.evermind.server.ejb.compilation.CMPObjectCompilation.<init>(CMPObjectCompilation.java:55)
at com.evermind.server.ejb.compilation.PersistenceManagerCompilation.<init>(PersistenceManagerCompilation.java:26)
at com.evermind.server.ejb.compilation.EntityBeanCompilation.<init>(EntityBeanCompilation.java:121)
at com.evermind.server.ejb.compilation.Compilation.generateAnyOldStyle(Compilation.java:1593)
at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:181)
at com.evermind.server.ejb.compilation.Compilation.doGenerateCode(Compilation.java:249)
at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:971)
at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:205)
at com.evermind.server.Application.setConfig(Application.java:387)
at com.evermind.server.Application.setConfig(Application.java:304)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1651)
at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:402)
at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:158)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
at com.evermind.server.administration.DefaultApplicationServerAdministrator.internalDeploy(DefaultApplicationServerAdministrator.java:440)
at com.evermind.server.administration.DefaultApplicationServerAdministrator.deploy(DefaultApplicationServerAdministrator.java:341)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.evermind.server.rmi.ServerRmiMessageHandler.doMethodCall(ServerRmiMessageHandler.java:560)
at com.evermind.server.rmi.ServerRmiMessageHandler.handleMethodInvocation(ServerRmiMessageHandler.java:471)
at com.evermind.server.rmi.ServerRmiMessageHandler.handleOrmiRequest(ServerRmiMessageHandler.java:262)
at com.evermind.server.rmi.ServerRmiMessageHandler.dispatchRequest(ServerRmiMessageHandler.java:231)
at com.evermind.server.rmi.RMIServerConnection.processReceivedCommand(RMIServerConnection.java:155)
at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:151)
at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:126)
at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:105)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:534)
Can anybody please suggest the solution?
Thanks in advance.
Regards,
Jinal ShahHi,
The error was coming because of the table structure. All the columns were composite keys. I alter the structured by removing composite keys and added a new column as primary key. Now it is getting deployed successfully.
Can anybody comment on such a behaviour of OC4J?
Regards,
Jinal Shah -
Deploying CMP entity bean throws compilation error.
Jdeveloper build works fine but the server deployment ( embedded) fails. I linked tools.jar to j2ee home dir, same version as jdev uses. Session beans deploy OK.
The table corr to the entity bean has a primary key and the entity bean was created by dragging-dropping table onto UML diagram.
error is >>>cmp-field of type 'java.lang.Long' does not have a no-arg constructor which is needed for properties/fields based mapping<<<, message details follow after dashed line.
Platform details - Jdeveloper 9.0.3 on mdk 9.0, JDK 1.4.1 ( JDK 1.3.1 also does the same).
[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
/usr/java/j2sdk1.4.1/bin/java -hotspot -classpath /var/jdeveloper/j2ee/home/oc4j.jar -Xverify:none -Doracle.j2ee.dont.use.memory.archive=true -Xrs com.evermind.server.OC4JServer -config /home/demo/jdevhome/system9.0.3.1035/oc4j-config/server.xml
[waiting for the server to complete its initialization...]
Embedded OC4J startup time: 9611 ms.
Copying default deployment descriptor from archive at /home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes/META-INF/orion-ejb-jar.xml to deployment directory /home/demo/jdevhome/system9.0.3.1035/oc4j-config/application-deployments/current-workspace-app/classes...
Auto-deploying file:/home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes/ (No previous deployment found)... Error compiling /home/demo/jdevhome/mywork/MyHRApplication/EJB-Tier/classes: cmp-field of type 'java.lang.Long' does not have a no-arg constructor which is needed for properties/fields based mapping
Oracle9iAS (9.0.3.0.0) Containers for J2EE initializedPlease note that the data-source has been re-architectured in 10.1.3 DP3 and you should have DataSource as follows:
<data-sources xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd' schema-major-version='10' schema-minor-version='1'>
<managed-data-source connection-pool-name='Example Connection Pool' jndi-name='jdbc/OracleDS' name='OracleManagedDS' />
<connection-pool name='Example Connection Pool' >
<connection-factory factory-class='oracle.jdbc.pool.OracleDataSource' user='scott' password='tiger' url='jdbc:oracle:thin:@localhost:1521:orcl'>
</connection-factory>
</connection-pool>
</data-sources> -
Error Deploying CMP Entity Bean
Hi,
I am new to Entity Beans and am trying to deploy a CMP Entity Bean without any success.
I did search this forum for similar issues and tried those suggestions as well but that has not helped. Was wondering if someone could help me out on this.
The Entity bean has 2 fields: name and description.
The ejb-jar.xml file for this bean is:
<enterprise-beans>
<entity>
<ejb-name>Product</ejb-name>
<home>example.cmp.ProductHome</home>
<remote>example.cmp.Product</remote>
<ejb-class>example.cmp.ProductBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>PRODUCTS</abstract-schema-name>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<primkey-field>name</primkey-field>
<query>
</query>
</entity>
</enterprise-beans>
The error that I get while deploying the bean is:
Error deploying EJB homes for: file:/C:/servers/oc4j1013/j2ee/home/applications/cmptest/cmptest.jar
java.lang.InstantiationException: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
at com.evermind.server.ApplicationState.getDataSourceContainer(ApplicationState.java:384)
Error deploying file:/C:/servers/oc4j1013/j2ee/home/applications/cmptest/cmptest.jar
homes: Error looking up cmt-datasource at jdbc/OracleDS (name not found)
[java] [TopLink Severe]: 2005.04.17 10:22:20.156--ServerSession(28816172)--
Local Exception Stack:
[java] Exception [TOPLINK-7060] (TopLink (Oracle OC4J CMP) - 10g release 3(10.1.3.0) (Build 041129)): oracle.toplink.exceptions.ValidationException
[java] Exception Description: Cannot acquire data source [jdbc/OracleDS].
[java] Internal Exception: javax.naming.NameNotFoundException: jdbc/OracleDS not found
[java] at oracle.toplink.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:208)
[java] at oracle.toplink.internal.ejb.cmp.oc4j.Oc4jNonJtaConnector.getOrCreateDataSource(Oc4jNonJtaConnector.java:62)
If anybody knows what the problem is please let me know.
Thanks in advance.
BhupenPlease note that the data-source has been re-architectured in 10.1.3 DP3 and you should have DataSource as follows:
<data-sources xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd' schema-major-version='10' schema-minor-version='1'>
<managed-data-source connection-pool-name='Example Connection Pool' jndi-name='jdbc/OracleDS' name='OracleManagedDS' />
<connection-pool name='Example Connection Pool' >
<connection-factory factory-class='oracle.jdbc.pool.OracleDataSource' user='scott' password='tiger' url='jdbc:oracle:thin:@localhost:1521:orcl'>
</connection-factory>
</connection-pool>
</data-sources> -
Bad Performance/OutOfMemory Error in CMP Entity Bean with Large DB
Hello:
I have an CMP Entity deployed on WLS 7.0
The entity bean maps to a table that has 97,480 records.
It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
I have a JSP client that invokes the findALL()
The performance is very poor ~ 150 seconds just to perform the findAll() - (Benchmark
from within the JSP code)
If more than one simultaneous call is made then I get outOfMemory Error.
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
(without max-beans-in-cache directive the performance is worse)
Is there any documentation available to help us in deploying CMP Entity Beans
with very large number of records (instances) ?
Any help is greatly appreciated.
Regards
RajanHi
You should use a Select Method, it does support cursors.
Or a Home Select Method combination.
Regards
Thomas
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>>
(without max-beans-in-cache directive the performance is worse)>
Is there any documentation available to help us in deploying CMP
Entity Beans with very large number of records (instances) ? Any help
is greatly appreciated.>
Regards>
Rajan>
>
"Rajan Jena" <[email protected]> schrieb im Newsbeitrag
news:3dadd7d1$[email protected]..
>
Hello:
I have an CMP Entity deployed on WLS 7.0
The entity bean maps to a table that has 97,480 records.
It has a finder: findAll() -- SELECT OBJECT(e) FROM Equipment e
I have a JSP client that invokes the findALL()
The performance is very poor ~ 150 seconds just to perform the findAll() -(Benchmark
from within the JSP code)
If more than one simultaneous call is made then I get outOfMemory Error.
WLS is started with max memory of 512MB
EJB is deployed with <max-beans-in-cache>100000</max-beans-in-cache>
(without max-beans-in-cache directive the performance is worse)
Is there any documentation available to help us in deploying CMP EntityBeans
with very large number of records (instances) ?
Any help is greatly appreciated.
Regards
Rajan -
Error when deploying a simple Entity bean (EJB3) on Glassfich or Sun AS
Hi,
After some problems when deploying complex EJB3 Entity bean on GlassFich with a MySQL connector, I have made a simple entity.
(test with Glassfish and Sun AS with same result)
With netbean 5.5 => New EJB Module
File->New->Persistence Unit (and use default values)
Persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="test" transaction-type="JTA">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<jta-data-source>jdbc/sample</jta-data-source>
<properties>
<property name="toplink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>File->New->Entity Class
EntityTest.java
package test;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class EntityTest implements Serializable
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
/** Creates a new instance of EntityTest */
public EntityTest()
public Long getId()
return id;
public void setId(Long id)
this.id = id;
public String toString()
//TODO change toString() implementation to return a better display name
return "" + this.id;
}Build of project work fine but when I try to deploy (with the 2 servers), I have the error :
Exception occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error -- null
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:790)
at java.util.HashMap$KeyIterator.next(HashMap.java:823)
at com.sun.enterprise.deployment.backend.EjbModuleDeployer.generatePolicy(EjbModuleDeployer.java:203)
at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.java:171)
at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)Yes, the problem is that the ejb-jar must contain at least one ejb component. It's a common misconception that Java Persistence API Entity classes are ejb components but they are NOT. The Java Persistence API was developed within the EJB 3.0 JSR and works very well with EJB but the entity classes themselves are not full-fledged ejb components.
--ken
Maybe you are looking for
-
Site's security certificate is not trusted - in fiori launchpad url
Hi , we are using HTTPS protocol in fiori launchpad , when the URL is opened in browser an error or warning comes up , it can be ignored by clicking proceeding anyway button. in Fiori client for mobile ( android or iOS ) its not showing the page due
-
Why can I sign in to Imessage on my mac
When I sign in to Imessageson my mac it loads for about ten seconds and then it comes up with an error saying "Could not sign in to Imessage" then under it it says "An error occurred during activation. Try again." I press ok and it just keeps on happ
-
Music Library Deleted when upgraded to 7.4.1
Can it be restored?
-
Is there a way to change the tab order in a table so that it goes down a column instead of across? Likewise, I would like cells to build in down the column by cell instead of across, i.e. all of the first column comes in one cell at a time and then t
-
Hi All, I have a Map and I want to add entries - Key and Value. Now the Key is an Object (Some Object Key which has some instance variables). When I try to add the Key and Value only one entry gets stored. I know I am doing something Wrong. class Key