trans-attribute in ejb-jar.xml
Dear All,
To improve performance of my EJB's, I wish to set trans-attribute as "Supports"
for all my get methods and rest of the methods as "Required".
Heres the snippet from my ejb-jar.xml which I'm using to achieve the same:
======== start ejb-jar.xml =========
<container-transaction>
<method>
<ejb-name>com.test.beans.TestBean</ejb-name>
<method-name>get*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>com.test.beans.TestBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
======== end ejb-jar.xml ===========
My doubt is:
- Is this the right way to achieve the same?
- Is there any possibility that 1st container would set the trans-attribute for
all methods start with get to "Supports" and then set the trans-attribute as "Required"
for all method[since I've used * afterwards], i.e overwrite the changes for get*
methods?
- Or Should I do it other way around? i.e 1st set trans-aatribute of all methods[*]
and then overwrite for get* methods?
Comments plz !!!
Thanx
~Puneet Maini
"Puneet Maini" <[email protected]> wrote in message
news:[email protected]..
>
Dear All,
To improve performance of my EJB's, I wish to set trans-attribute as"Supports"
for all my get methods and rest of the methods as "Required".
Heres the snippet from my ejb-jar.xml which I'm using to achieve the same:
======== start ejb-jar.xml =========
<container-transaction>
<method>
<ejb-name>com.test.beans.TestBean</ejb-name>
<method-name>get*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>com.test.beans.TestBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
======== end ejb-jar.xml ===========
My doubt is:
- Is this the right way to achieve the same?
- Is there any possibility that 1st container would set thetrans-attribute for
all methods start with get to "Supports" and then set the trans-attributeas "Required"
for all method[since I've used * afterwards], i.e overwrite the changesfor get*
methods?
- Or Should I do it other way around? i.e 1st set trans-aatribute of allmethods[*]
and then overwrite for get* methods?The order does not matter. You can specify the transaction settings in any
order you want. Note that the "get*" is more specific than the "*" for the
method-name element.
Also with supports, if this bean is invoked in a transaction then the
caller's transaction will whatever settings it has would take precedence.
>
Comments plz !!!
Thanx
~Puneet Maini
Similar Messages
-
Assignment of transaction attributes in ejb-jar.xml
Hi all,
I'm going through the employee example from the book "Java programming in SAP web application server". I have followed the instrucstions to the letter and have triple checked that i did not miss anything.
During the part "Defining Transaction Control", when i go to the "Assembly" tab, choose "Container-transaction" and click add; i get the following error message.
You have to create and reference EJBs first. Afterwards you can choose them here.
Newly created EJBs are referenced automatically in the ejb-jar.xml, in special cases you might have to reference them manually.
Below is a copy of the ejb-jar. Both beans are referenced in the file so i don't really understand the error message!
Thanks for your help.
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>EmployeeServicesBean</ejb-name>
<home>com.sap.demo.EmployeeServicesHome</home>
<remote>com.sap.demo.EmployeeServices</remote>
<local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
<local>com.sap.demo.EmployeeServicesLocal</local>
<ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Employee</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
</ejb-local-ref>
</session>
<entity>
<ejb-name>EmployeeBean</ejb-name>
<home>com.sap.demo.EmployeeHome</home>
<remote>com.sap.demo.Employee</remote>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-class>com.sap.demo.EmployeeBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>EmployeeBean</abstract-schema-name>
<cmp-field>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>department</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<description>Query for getting all employee objects.</description>
<query-method>
<method-name>findAllEmployees</method-name>
<method-params/>
</query-method>
<ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor/>
</ejb-jar>I was able to add the transaction attributes manually to the ejb-jar.xml file. below is what the file looks like now for those interested.
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>EmployeeServicesBean</ejb-name>
<home>com.sap.demo.EmployeeServicesHome</home>
<remote>com.sap.demo.EmployeeServices</remote>
<local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
<local>com.sap.demo.EmployeeServicesLocal</local>
<ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Employee</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
</ejb-local-ref>
</session>
<entity>
<ejb-name>EmployeeBean</ejb-name>
<home>com.sap.demo.EmployeeHome</home>
<remote>com.sap.demo.Employee</remote>
<local-home>com.sap.demo.EmployeeLocalHome</local-home>
<local>com.sap.demo.EmployeeLocal</local>
<ejb-class>com.sap.demo.EmployeeBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>EmployeeBean</abstract-schema-name>
<cmp-field>
<description>
</description>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<description>
</description>
<field-name>department</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<description>Query to get all employee objects.</description>
<query-method>
<method-name>findAllEmployees</method-name>
<method-params/>
</query-method>
<ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<description>container-transaction</description>
<method>
<ejb-name>EmployeeBean</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>EmployeeServicesBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Thanks -
Missing listener-threads attribute in orion-ejb-jar.xml !!
Hi All,
I was trying to do some performance tuning as given in BPEL admin guide. For one of the BPEL property namely 'dspMaxThreads', guide says "Sum of dspMaxThreads of ALL domains should be <= the number of mdb listener threads on the workerbean". Now when i open <SOA_HOME>/j2ee/oc4j_soa/application-deployments/orabpel/orion-ejb-jar.xml and navigate to workerbean, i can not find any listener-threads attribute in message-driven-deployment tag.
<message-driven-deployment name="WorkerBean" min-instances="100" resource-adapter="BPELjms">
However there is a ReceiverThreads property set to 40.
<message-driven-deployment name="WorkerBean" min-instances="100" resource-adapter="BPELjms">
<config-property-name>ReceiverThreads</config-property-name>
<config-property-value>40</config-property-value>
</config-property>
</message-driven-deployment>
Now my question is that can i add listener-threads attribute to message-driven-deployment tag and then tune dspmaxthreads accordingly, Or
i can make use of ReceiverThreads property to match with dspmaxthreads property. I am really confused b/w listener-threads and ReceiverThreads.
Can anyone clarify the same ?
I have ORACLE SOA Suite ver 10.1.3.1 (with 10.1.3.3 patch) installed.
Thanks in advance.Jingzhi -- If you define the correct EJB-QL you should get the correct SQL generated for the finder. If that's not happening can you verify it against the OC4J v903 production release and see if it is still happening. I don't know if this helps with the JDeveloper problem specifically but if you don't need to create your own finders then that I hope should help.
Thanks -- Jeff -
Weblogic 10.3.0 Deployment error when using ejb-jar.xml
Hi,
I am getting the following error while deploying my EJB3 application on Weblogic 10.3.0. This is happening only if I include ejb-jar.xml.
As per the EJB3 descriptor spec, Remote Home or Local home are not exists.
Is this a issue in Weblogic 10.3.0 or am I missing any special setup ?
Please help.
weblogic.application.ModuleException: Exception preparing module: EJBModule(egm-poc.jar)
Unable to deploy EJB: C:\appsrv\domains\WeblogicRS1.1-domain\servers\admin\tmp\_WL_user\_appsdir_egmear_ear\ot2591\egm-poc.
jar from egm-poc.jar:
In EJB JPATestBean, both the remote home and remote component interface must be specified. Currently, only one of them is spec
ified.
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:452)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:387)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:58)
My ejb-jar.xml is
- <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<description>JPA Test Application</description>
<display-name>JPATest</display-name>
- <enterprise-beans>
- <session>
<ejb-name>JPATestBean</ejb-name>
<remote>egm.poc.jpa.JPATestBeanRemote</remote>
<local>egm.poc.jpa.JPATestBeanLocal</local>
<ejb-class>egm.poc.jpa.JPATestBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
- <session>
<ejb-name>AuditInfoDAOH</ejb-name>
<local>egm.poc.jpa.Audit</local>
<ejb-class>egm.poc.jpa.AuditInfoDAOH</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
- <assembly-descriptor>
- <container-transaction>
- <method>
<ejb-name>JPATestBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>RequiresNew</trans-attribute>
</container-transaction>
- <container-transaction>
- <method>
<ejb-name>AuditInfoDAOH</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Regards
SajiHi,
Seems the issue is not common. Can anyone throw some light on this ?
Regards
Saji -
ejb-local-ref where to put this tag in ejb-jar.xml ??
I have an ejb-jar.xml that looks like this. I have had no problem with remote interfaces. Now I want the bean to have a local interface too.
Just let me know where the tag I have mentioned for the <ejb-local-ref> has to be put into.
When I compile this file it throws me an error which i have shown below the output of the ejb-jar.xml file
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>IDMaster</ejb-name>
<home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
<remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
<ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
<persistence-type>Container</persistence-type>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>IDMaster</abstract-schema-name>
<cmp-field>
<field-name>idPrefix</field-name>
</cmp-field>
<cmp-field>
<field-name>idValue</field-name>
</cmp-field>
<primkey-field>idPrefix</primkey-field>
<query>
<query-method>
<method-name>findAllIDMasters</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>IDMaster</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
I have also added the following tag in the weblogic-jar.xml
<local-jndi-name>IDMasterEJB.IDMasterLocalHome</local-jndi-name>
Just let me know whether I am correct
On compilation (using ant utility) the error thrown is like this :
ejbc:
[java] ERROR: Error parsing 'ejb-jar.xml' line 47: The content of element type "entity" must ma
tch "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,e
jb-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-schema-name?,cmp-field*,pri
mkey-field?,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,r
esource-env-ref*,query*)".
[java] ERROR: ejbc found errors
[java] Java Result: 1
Kindly Help !!!
Thanks n regards
SajivThis should take care of it
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>IDMaster</ejb-name>
<home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
<remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
<ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
<persistence-type>Container</persistence-type>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>IDMaster</abstract-schema-name>
<cmp-field>
<field-name>idPrefix</field-name>
</cmp-field>
<cmp-field>
<field-name>idValue</field-name>
</cmp-field>
<primkey-field>idPrefix</primkey-field>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<query>
<query-method>
<method-name>findAllIDMasters</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>IDMaster</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
JNDI and env. vars. in ejb-jar.xml
I have been trying for several days now to have my EJB session bean access
its env. vars. stored in the ejb-jar.xml document. I have been unsuccessful.
The only place I have been able to store my env. vars. is in the web.xml
document outside my .jar file. Although workable, it would be preferable to
store them in the ejb-jar.xml document in my .jar file.
I am hoping some one can help me. I am using the following code in my ejb:
Context init = new InitialContext();
Context env = (Context)init.lookup("java:comp/env");
m_bTruncCorporate =
((Boolean)env.lookup(MICRworks.MICR_ENV_TRUNCORP)).booleanValue();
m_strOptPath = (String)env.lookup(MICRworks.MICR_ENV_OPFLPATH);
m_strOptAccount = (String)env.lookup(MICRworks.MICR_ENV_OPFLACCT);
m_strOptRouting = (String)env.lookup(MICRworks.MICR_ENV_OPFLROUT);
My ejb-jar.xml follows:
<!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>
<session>
<ejb-name>MICRworksBean</ejb-name>
<home>USDataworks.MICRworks.MICRworksHome</home>
<remote>USDataworks.MICRworks.MICRworks</remote>
<ejb-class>USDataworks.MICRworks.MICRworksBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>Flag indicating whether to convert corporate
checks</description>
<env-entry-name>TruncateCorporate</env-entry-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
</env-entry>
<env-entry>
<description>Location of the 1For1 exclusion files</description>
<env-entry-name>OptionFilePath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:7001/MICRworksLite/files/</env-entry-value
>
</env-entry>
<env-entry>
<description>Name of the 1For1 account exclusions file</description>
<env-entry-name>OptionFileAccount</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>account_file.txt</env-entry-value>
</env-entry>
<env-entry>
<description>Name of the 1For1 routing exclusion file</description>
<env-entry-name>OptionFileRouting</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>routing_file.txt</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MICRworksBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and my weblogic-ejb-jar.xml:
<!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>MICRworksBean</ejb-name>
<stateless-session-descriptor>
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>MICRworksBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
My feeling is that I am missing some sort of reference in the
weblogic-ejb-jar.xml that points to the ejb-jar.xml but I have tried several
things without success.
I would appreciate any help I can get...especially if it contains specific
code I can use as I am rather new to writing and deploying ejbs!
Thanx in advance. Marek :-)Thanks for the reference. I was using another book as a reference (Using
Java 2 Enterprise Edition by Mark Wutka) which had the same sort of example
and as you can see below, I coded my bean as they suggest...I'm still unable
to access the env. vars.!
I deployed by bean using WebLogic's Builder and but didn't create any sort
of application. I let WebLogic do what it would on its own. The WebLogic
documentation seemed to indicate for simple testing this would work
fine...is it wrong?
btw. MICRworks.MICR_ENV_TRUNCORP equates to "TruncateCorporate" as you
probably guessed.
The WebLogic Admin Console shows the environment variables in the EJB
Descriptors for my EJB but they do not show up when I view the JNDI tree for
my server. I have taken this to mean that the deployment tool is not
binding my env. vars. for some reason which would explain why my bean can't
find them.
I know it must be something stupid I am doing (or not doing) but I just
can't see it. Please help!
"Ryan LeCompte" <[email protected]> wrote in message
news:[email protected]...
>
Hello Marek,
I would suggest that you download the free book "Mastering EJB 2ndEdition" by
Ed Roman, Scott Ambler, and Tyler Jewell. The source code for the book isalso
freely available and is meant to be deployed specifically on WebLogic.Look for
a sample application called "Jasmine", which shows how to use environmententries.
You will see a concrete example of how they are defined and later accessedfrom
within EJBs. The book and source code are available at the followingaddress:
>
http://www.theserverside.com/books/masteringEJB/index.jsp
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
"Marek Kossak" <[email protected]> wrote:
I have been trying for several days now to have my EJB session bean
access
its env. vars. stored in the ejb-jar.xml document. I have beenunsuccessful.
The only place I have been able to store my env. vars. is in the web.xml
document outside my .jar file. Although workable, it would be preferable
to
store them in the ejb-jar.xml document in my .jar file.
I am hoping some one can help me. I am using the following code in my
ejb:
Context init = new InitialContext();
Context env = (Context)init.lookup("java:comp/env");
m_bTruncCorporate =
((Boolean)env.lookup(MICRworks.MICR_ENV_TRUNCORP)).booleanValue();
m_strOptPath = (String)env.lookup(MICRworks.MICR_ENV_OPFLPATH);
m_strOptAccount = (String)env.lookup(MICRworks.MICR_ENV_OPFLACCT);
m_strOptRouting = (String)env.lookup(MICRworks.MICR_ENV_OPFLROUT);
My ejb-jar.xml follows:
<!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>
<session>
<ejb-name>MICRworksBean</ejb-name>
<home>USDataworks.MICRworks.MICRworksHome</home>
<remote>USDataworks.MICRworks.MICRworks</remote>
<ejb-class>USDataworks.MICRworks.MICRworksBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<description>Flag indicating whether to convert corporate
checks</description>
<env-entry-name>TruncateCorporate</env-entry-name>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
</env-entry>
<env-entry>
<description>Location of the 1For1 exclusion files</description>
<env-entry-name>OptionFilePath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://localhost:7001/MICRworksLite/files/</env-entry-valu
e
>>>
</env-entry>
<env-entry>
<description>Name of the 1For1 account exclusions file</description>
<env-entry-name>OptionFileAccount</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>account_file.txt</env-entry-value>
</env-entry>
<env-entry>
<description>Name of the 1For1 routing exclusion file</description>
<env-entry-name>OptionFileRouting</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>routing_file.txt</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MICRworksBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and my weblogic-ejb-jar.xml:
<!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>MICRworksBean</ejb-name>
<stateless-session-descriptor>
<pool>
</pool>
<stateless-clustering>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
</transaction-descriptor>
<jndi-name>MICRworksBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
My feeling is that I am missing some sort of reference in the
weblogic-ejb-jar.xml that points to the ejb-jar.xml but I have tried
several
things without success.
I would appreciate any help I can get...especially if it containsspecific
code I can use as I am rather new to writing and deploying ejbs!
Thanx in advance. Marek :-) -
Deployment issues, how is weblogic-ejb-jar.xml linked to ejb-jar.xml
Hey guys,
I'm getting the following error I think because i have something configured incorrectly in my xml files. Instead of yousing activationConfig properties in my MDB I wanted to set them in the ejb-jar.xml file manually. The following error I'm getting is...
Unable to deploy EJB: MyMDB from MDBtest2:
[EJB:011026]The EJB container failed while creating the java:/comp/env namespace for this EJB deployment.
weblogic.deployment.EnvironmentException: [EJB:010176]The resource-env-ref 'inQueue' declared in the ejb-jar.xml descriptor has no JNDI name mapped to it. The resource-ref must be mapped to a JNDI name using the resource-description element of the weblogic-ejb-jar.xml descriptor.
at weblogic.ejb.container.deployer.EnvironmentBuilder.addResourceEnvReferences(EnvironmentBuilder.java:641)
at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentContext(EJBDeployer.java:330)
at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentFor(EJBDeployer.java:1097)
at weblogic.ejb.container.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:991)
at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1273)
at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:372)
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_ID" version="2.1" 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">
<display-name>MDBtest2</display-name>
<enterprise-beans>
<message-driven>
<ejb-name>MyMDB</ejb-name>
<ejb-class>cms.crown.mdb.MyMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-destination-link>omg</message-destination-link>
<resource-ref>
<res-ref-name>weblogic.jms.XAConnectionFactory</res-ref-name>
<res-type>javax.jms.XAConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>inQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MyMDB</ejb-name>
<method-name>onMessage</method-name>
<method-params>
<method-param>javax.jms.Message</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
weblogic-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-ejb-jar xmlns:wls="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
<!--weblogic-version:10.0-->
<wls:message-destination-descriptor>
<!--lookup-method:JNDI-->
<wls:message-destination-name>omg</wls:message-destination-name>
<wls:destination-jndi-name>inQueue</wls:destination-jndi-name>
<wls:initial-context-factory>weblogic.jms.XAConnectionFactory</wls:initial-context-factory>
<wls:provider-url>http://localhost:8010</wls:provider-url>
</wls:message-destination-descriptor>
</wls:weblogic-ejb-jar>
Hope this is readable, thanks for any assistanceHi,
It looks like first thing you are using EJB3 but your XML files are still pointing to version="2.1" and very old.
<font color=red>
<ejb-jar id="ejb-jar_ID" version="2.1" 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">
</font><br>
*try this: In below "ejb-jar.xml" file*
QCF = your Connection factory JNDI Name
TestQ = your Queue JNDI Name
Transaction Attribute is ByDefault = Required ...so no need to add it here.
<?xml version='1.0' encoding='UTF-8'?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" metadata-complete="true">
<enterprise-beans>
<message-driven>
<ejb-name>MyMDB</ejb-name>
<mapped-name>TestQ</mapped-name>
<ejb-class>cms.crown.mdb.MyMDB</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value><b><font color=maroon>javax.jms.Queue</font></b></activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>connectionFactoryJndiName</activation-config-property-name>
<activation-config-property-value><b><font color=maroon>QCF</font></b></activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destinationJndiName</activation-config-property-name>
<activation-config-property-value><b><font color=maroon>TestQ</font></b></activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
<assembly-descriptor></assembly-descriptor>
</ejb-jar>
"weblogic-ejb-jar.xml":
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
<font color=maroon><b> Now u need to Just define the Provider URL here...if you want a remote provider...else not required<BR> JNDI names are already defined in the ejb-jar.xml file</b></font><BR>
</weblogic-ejb-jar>
Some Links which you can refer:
To Generate the Deployment Descriptors ...in case of EJB3 Applications: *http://jaysensharma.wordpress.com/2010/04/02/generating-ejb3-clientjar/*
MDB3.0 Sample: *http://jaysensharma.wordpress.com/2009/08/17/mdb3-0-sample-for-weblogic-application-server/*
Thanks
Jay SenSharma -
Webllogic8to10migration-SAXValidationExc Couldnot locate bean ejb-jar.xml
Please help me out here..
Failed to parse descriptor at 'META-INF/weblogic-ejb-jar.xml' for module 'PAMaintenanceBean.jar': javax.xml.stream.XMLStreamException: weblogic.xml.process.SAXValidationException: Could not locate bean with ejb-name "PAMaintenance" in ejb-jar.xml
ejb-jar.xml
==========
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>PAMaintenance</ejb-name>
<home>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceHome</home>
<remote>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</remote>
<ejb-class>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>PAMaintenance</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Supports</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>PAFeatures</ejb-name>
<home>com.bear.coreapps.pa.ejb.features.PAFeaturesHome</home>
<remote>com.bear.coreapps.pa.ejb.features.PAFeatures</remote>
<ejb-class>com.bear.coreapps.pa.ejb.features.PAFeaturesBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>myString</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>anything at all</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>PAFeatures</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
weblogic-ejb-jar.xml
===============
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>PAMaintenance</ejb-name>
<caching-descriptor>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
</caching-descriptor>
<enable-call-by-reference>false</enable-call-by-reference>
<jndi-name>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>PAFeatures</ejb-name>
<caching-descriptor>
<max-beans-in-free-pool>100</max-beans-in-free-pool>
</caching-descriptor>
<jndi-name>statelessSession.PAFeaturesHome</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
my web.xml
========
<ejb-ref>
<ejb-ref-name>PAFeatures</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.bear.coreapps.pa.ejb.features.PAFeaturesHome</home>
<remote>com.bear.coreapps.pa.ejb.features.PAFeatures</remote>
<ejb-link>../PAFeaturesBean.jar#PAFeatures</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>PAMaintenance</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.bear.coreapps.pa.ejb.maintenance.PAMaintenanceHome</home>
<remote>com.bear.coreapps.pa.ejb.maintenance.PAMaintenance</remote>
<ejb-link>../PAMaintenanceBean.jar#PAMaintenance</ejb-link>
</ejb-ref>
Application.xml
===========
<module>
<ejb>PAFeaturesBean.jar</ejb>
</module>
<module>
<ejb>PAMaintenanceBean.jar</ejb>
</module>
config.xml
===========
<app-deployment>
<name>emsApp</name>
<target>mngCTK_dbctkapp01</target>
<module-type>ear</module-type>
<source-path>applications/emsApp</source-path>
<sub-deployment>
<name>/</name>
<target>mngCTK_dbctkapp01</target>
</sub-deployment>
<sub-deployment>
<name>PAMaintenanceBean.jar</name>
<target>mngCTK_dbctkapp01</target>
</sub-deployment>
<sub-deployment>
<name>PAFeaturesBean.jar</name>
<target>mngCTK_dbctkapp01</target>
</sub-deployment>
<security-dd-model>DDOnly</security-dd-model>
<staging-mode>nostage</staging-mode>
</app-deployment>Hi,
Nothing stands out as being configured incorrectly. I copy and pasted the descriptors below, put them in a jar file and ran weblogic.appc on it. The descriptors loaded properly and appc only complained that the EJB classes couldn't be found (as expected). Are you sure the weblogic-ejb-jar.xml containing the 'PAMaintenance' reference is in the same ejb-jar file as the ejb-jar.xml containing the 'PAMaintenance' definition? That's the only thing I can think of.
- Matt -
hi,
I just want to know if it's possible to declare many ejb in the ejb-jar.xml file.
Thanks
Augustin LapralineYes, I did this before as long as you follow ejb-jar.xml rule.
<enterprise-beans>
add one this:
<session>
<ejb-name>Soprano</ejb-name>
<home>csc.io.soprano.SopranoHome</home>
<remote>csc.io.soprano.Soprano</remote>
<ejb-class>csc.io.soprano.SopranoBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
add one this:
<container-transaction>
<method>
<ejb-name>SopranoExtension</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
Augustin Lapraline <[email protected]> wrote:
hi,
I just want to know if it's possible to declare many ejb in the ejb-jar.xml
file.
Thanks
Augustin Lapraline -
ERROR: Error parsing 'ejb-jar.xml'
Hello ppls,
i am getting the following error while compiling using ejbc :
ERROR: Error parsing 'ejb-jar.xml' line 25: The content of element
type "entity"
must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,
my ejb-jar.xml looks like this
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 2.0//EN' 'http://www.java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'
>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>Account</ejb-name>
<home>wlEntityBeanexample.AccountHome</home>
<remote>wlEntityBeanexample.Account</remote>
<ejb-class>wlEntityBeanexample.HelloBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<transaction-type>Container</transaction-type>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<resource-ref>
<res-ref-name>mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Account</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>AccountClient<ejb-client-jar>
</ejb-jar>
I compared the file with other ejb-jar.xml file coming as an Example
in Weblogic, i didn't find any difference.
Thanks in Advance,
PrashantThanks Deepak, i got it running at last.
Prashant
"Deepak Vohra" <[email protected]> wrote in message news:<[email protected]>...
The entity element in ejb-jar.xml should be of the
format:
<!ELEMENT entity (description?, display-name?, small-icon?,
large-icon?, ejb-name, home?, remote?, local-home?,
local?, ejb-class, persistence-type, prim-key-class,
reentrant, cmp-version?, abstract-schema-name?,
cmp-field*, primkey-field?, env-entry*, ejb-ref*,
ejb-local-ref*, security-role-ref*, security-identity?,
resource-ref*, resource-env-ref*, query*)>
transaction-type is not defined for a entity ejb.
<entity> <ejb-name>Account</ejb-name> <home>wlEntityBeanexample.AccountHome</home>
<remote>wlEntityBeanexample.Account</remote> <ejb-class>wlEntityBeanexample.HelloBean</ejb-class>
<persistence-type>Bean</persistence-type> <prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant> <cmp-version>2.x</cmp-version>
<resource-ref> <res-ref-name>mysql</res-ref-name> <res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth> </resource-ref>
</entity>
[email protected] (prashant) wrote:
Hello ppls,
i am getting the following error while compiling using ejbc :
ERROR: Error parsing 'ejb-jar.xml' line 25: The content of element
type "entity"
must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,
my ejb-jar.xml looks like this
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
JavaBeans 2.0//EN' 'http://www.java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd'
>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>Account</ejb-name>
<home>wlEntityBeanexample.AccountHome</home>
<remote>wlEntityBeanexample.Account</remote>
<ejb-class>wlEntityBeanexample.HelloBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<transaction-type>Container</transaction-type>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<resource-ref>
<res-ref-name>mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Account</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<ejb-client-jar>AccountClient<ejb-client-jar>
</ejb-jar>
I compared the file with other ejb-jar.xml file coming as an Example
in Weblogic, i didn't find any difference.
Thanks in Advance,
Prashant -
O/R tool generates invalid ejb-jar.xml for 1-n cmp bean-to-bean relations
TopLink generates:
<ejb-relation>
<ejb-relation-name>Parent-Child</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Parent-has-childs</ejb-relationship-role-name>
<multiplicity>One</multiplicity>
<relationship-role-source>
<ejb-name>Parent</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>childs</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>child-owned-by-Parent</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<cascade-delete></cascade-delete>
<relationship-role-source>
<ejb-name>Child</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
what's wrong?
it's missing the following tag:
'<cmr-field-type>java.util.Collection</cmr-field-type>'
which should be in the <cmr-field> element after the <cmr-field-name>.
I cannot get the UI tool to add this tag, whenever I manually add it to the ejb-jar.xml it gets removed the next time I generate the ejb-jar.xml. Additionally, if I try to update the project from the ejb-jar.xml, the O/R tool loses ALL my mappings for entity beans.
Expected questions:
TopLink 9.0.3
WebLogic 7.0.1
CMP 2.0
JDK 1.3.1_03
Yes the getter/setter are defined (on the local interface and bean)
FYI,
AndrewThis should take care of it
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>IDMaster</ejb-name>
<home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
<remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
<ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
<persistence-type>Container</persistence-type>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>IDMaster</abstract-schema-name>
<cmp-field>
<field-name>idPrefix</field-name>
</cmp-field>
<cmp-field>
<field-name>idValue</field-name>
</cmp-field>
<primkey-field>idPrefix</primkey-field>
<ejb-local-ref>
<ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
<local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
</ejb-local-ref>
<query>
<query-method>
<method-name>findAllIDMasters</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>IDMaster</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
i am getting a classcast exception.My Stateless and stateful session bean works
fine .. problem only with Entity bean. Please check these xml files and let me
know if i have missed anything.
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>stores</ejb-name>
<home>Ejb.Stores.storesHome</home>
<remote>Ejb.Stores.storesRemote</remote>
<ejb-class>Ejb.Stores.storesBean</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>storesBean</abstract-schema-name>
<cmp-field>
<field-name>productId</field-name>
</cmp-field>
<cmp-field>
<field-name>descrip</field-name>
</cmp-field>
<cmp-field>
<field-name>price</field-name>
</cmp-field>
<primkey-field>productId</primkey-field>
<query>
<query-method>
<method-name>findPriceGreaterThan</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE a.price > ?1]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>stores</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
------------- end of ejb-ar.xml---------------------
weblogic-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
"http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>stores</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>
<jndi-name>storesEntity</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
------------- end of weblogic-jar.xml----------
weblogic-cmp-rdbms-jar.xml
<!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0
EJB RDBMS Persistence//EN' 'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>stores</ejb-name>
<data-source-name>sqlTX</data-source-name>
<table-name>ProductEJBTable</table-name>
<field-map>
<cmp-field>productId</cmp-field>
<dbms-column>productId</dbms-column>
</field-map>
<field-map>
<cmp-field>descrip</cmp-field>
<dbms-column>descrip</dbms-column>
</field-map>
<field-map>
<cmp-field>price</cmp-field>
<dbms-column>price</dbms-column>
</field-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>false</create-default-dbms-tables>
</weblogic-rdbms-jar>
---------------- end of weblogic-cmp-rdbms-jar.xml----------
Do i have to mention the connection Pool name anywhere .. My connection Pool name
is sql7Pool and my datasource name which i have mentioned is sqlTx. I am using
Sql server 7. I am deploying a jar file(not a war file) and accessng the EJB through
a Servlet. Please any help would definitely be appreciated.
Cheers
Ashish.I thought you were getting a class cast exception but the stack trace shows
a NullPointerException on line 38 of your servlet code. I am not sure if the
code that you have attached is the complete code or just snippets of your
complete code. Anyways, counting 38 lines in the code you attached points to
the line "mr =
mh.create(request.getParameter("login"),request.getParameter("name"));"
which could be because "mh" is null. Can you verify "mh" is not null and
also "objRef" is not null.
Attaching the stack trace for ClassCastException would be useful.
-- Anand
"Ashish Suvarna" <[email protected]> wrote in message
news:[email protected]...
>
Hey Anand,
Thanks for your reply. I have attached the StackTrace,Servlet code andmy
location and settings of my servlet .
This is the StackTrace which i get :
pl.java:265)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
before create
java.lang.NullPointerException
at trialweblogic.webServlet.doGet(webServlet.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
-------------- end of StackTrace---------------------
My Servlet Code is
package trialweblogic;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.DuplicateKeyException;
import javax.ejb.EJBException;
import java.rmi.RemoteException;
import java.rmi.Remote;
import trialweblogic.*;
public class webServlet extends HttpServlet {
masterHome mh;
masterRemote mr;
OutputStream out;
private static final String CONTENT_TYPE = "text/html";
public void init(ServletConfig config) throws ServletException {
super.init(config);
public void doGet(HttpServletRequest request, HttpServletResponseresponse)
throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
// out = response.getOutputStream();
try{
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("masterBeanJNDI");
mh =(masterHome)PortableRemoteObject.narrow(objRef,masterHome.class);
>
mr =mh.create(request.getParameter("login"),request.getParameter("name"));
out.println("after create");
}catch(Exception ex){
ex.printStackTrace();
public void destroy() {
--------- end of servlet--------------
I am using Weblogic 6.1. I have included the following in my web.xml filewhich
is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF
>
>
<servlet>
<servlet-name>webServlet</servlet-name>
<servlet-class>trialweblogic.webServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>webServlet</servlet-name>
<url-pattern>/webServlet/*</url-pattern>
</servlet-mapping>
My Servlet is located atC:\bea\wlserver6.1\config\examples\applications\examplesWebApp\WEB-INF\class
es\trialweblogic\
folder. In this folder i also have the supporting files (home,remote &bean tooo).
>
>
I call this servlet when te user submits the info from a JSP page.
Hope this info helps in solving my problem. Do i have to mention theconnection
Pool name anywhere in the xml descriptor or am i missing anything here. iguess
Connection Pool name is not required since we are mentioning the JNDI namein
the xml descriptor. Bye for now.Awaiting your reply.
Cheers
Ashish.
"Anand Byrappagari" <[email protected]> wrote:
It is unlikely that your xml descriptors can cause class cast exceptions.
How did you install the servlet? Can you attach the servlet code that
might
help. Also complete stack trace of the exceptions would be helpful.
-- Anand
"Ashish Suvarna" <[email protected]> wrote in message
news:[email protected]...
Hi Anand,
Thanks for quic reply.Hey i am using weblogic6.1. I am Not usinga WAR
and
ear file.I have created a jar file and deployed it.now i have createda
servlet
to access entity bean.Is a war file neccessary for accesing an entitybean
through
Servlet or JSP ???I am using sql server 7. The error that it givesis -----
java.lang.ClassCastException: Cannot narrow remote object<br>
"inside lookup method aaaaaaa" java.lang.NullPointerException. <br>
Hope to get ur reply soon. in another entity bean i am getting thiserror ---
java.lang.ClassCastException:
weblogic.jdbc.common.internal.RmiDataSource
.. I
can't understand wots this error. I feel i am missing something inmy xml
descriptor.
Bye for now.
Cheers
Ashish.
"Anand Byrappagari" <[email protected]> wrote:
Can you attach the stack trace for the exception? Also please describe
you
environment - are the war and jar files installed separately? Are
they
composed into a ear? Also when are you getting a classcast exception?
-- Anand
"Ashish Suvarna" <[email protected]> wrote in message
news:[email protected]...
i am getting a classcast exception.My Stateless and stateful sessionbean
works
fine .. problem only with Entity bean. Please check these xml filesand
let me
know if i have missed anything.
ejb-jar.xml
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD EnterpriseJavaBeans
2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>stores</ejb-name>
<home>Ejb.Stores.storesHome</home>
<remote>Ejb.Stores.storesRemote</remote>
<ejb-class>Ejb.Stores.storesBean</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>storesBean</abstract-schema-name>
<cmp-field>
<field-name>productId</field-name>
</cmp-field>
<cmp-field>
<field-name>descrip</field-name>
</cmp-field>
<cmp-field>
<field-name>price</field-name>
</cmp-field>
<primkey-field>productId</primkey-field>
<query>
<query-method>
<method-name>findPriceGreaterThan</method-name>
<method-params>
<method-param>double</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM storesBean AS a WHERE
a.price> >> >>> >> >?1]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>stores</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
------------- end of ejb-ar.xml---------------------
weblogic-jar.xml
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
WebLogic
6.0.0 EJB//EN"
"http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>stores</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>
<jndi-name>storesEntity</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
------------- end of weblogic-jar.xml----------
weblogic-cmp-rdbms-jar.xml
<!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD
WebLogic
6.0.0
EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dt
d
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
<ejb-name>stores</ejb-name>
<data-source-name>sqlTX</data-source-name>
<table-name>ProductEJBTable</table-name>
<field-map>
<cmp-field>productId</cmp-field>
<dbms-column>productId</dbms-column>
</field-map>
<field-map>
<cmp-field>descrip</cmp-field>
<dbms-column>descrip</dbms-column>
</field-map>
<field-map>
<cmp-field>price</cmp-field>
<dbms-column>price</dbms-column>
</field-map>
</weblogic-rdbms-bean>
<create-default-dbms-tables>false</create-default-dbms-tables>
</weblogic-rdbms-jar>
---------------- end of weblogic-cmp-rdbms-jar.xml----------
Do i have to mention the connection Pool name anywhere .. My
connection
Pool name
is sql7Pool and my datasource name which i have mentioned is sqlTx.I am
using
Sql server 7. I am deploying a jar file(not a war file) and accessngthe
EJB through
a Servlet. Please any help would definitely be appreciated.
Cheers
Ashish. -
Can't create a JAXB binding for ejb-jar.xml using xjc
Hi all,
I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
I have tried to use
xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
Any help much appreciated.
errors:
[WARNING] warning: "blockDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: "finalDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 117 of j2ee_web_services_client_1_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 115 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 129 of ejb-jar_2_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 145 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 159 of ejb-jar_2_1.xsdException initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
util.AnnotatedNoClassDefFoundError:
Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath. -
Use of externally-defined/ in weblogic-ejb-jar.xml
I am trying to use Global Roles defined via the Weblogic console to control access to EJB methods.
I am using the <externally-defined/> tag in security role assignments, however when I deploy to Weblogic I get the following error :
<8/09/2004 04:21:42 PM GMT+10:00> <Error> <Deployer> <BEA-149205> <Failed to initialize the application appsdirmars-marketdata_ear due to error weblogic.manag
ement.ApplicationException: Prepare failed. Task Id = null
Module Name: ejb-marketdata.jar, Error: [EJB:011024]The XML parser encountered an error in your deployment descriptor. Please ensure that your deployment descriptor corresponds to the format in the DTD. The error was:
Error parsing file 'META-INF/weblogic-ejb-jar.xml' at line: 51 column: 26. Element type "externally-defined" must be declared..
at weblogic.j2ee.J2EEApplicationContainer.checkForErrors(J2EEApplication
Container.java:1612)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:1207)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:1051)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContain
er.java:823)
at weblogic.management.deploy.slave.SlaveDeployer$Application.prepare(Sl
aveDeployer.java:2925)
at weblogic.management.deploy.slave.SlaveDeployer.prepareAllApplications
(SlaveDeployer.java:967)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
ava:349)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
e(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
I am running Weblogic 8.1 SP3 on Windows XP Pro.
The XML is valid for the specified DTD according to my XML editor.
The relevevant fragment from weblogic-ejb-jar.xml is included below.
Any help much appreciated.
Gavin.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
<weblogic-ejb-jar>
<security-role-assignment>
<role-name>MarsAdmin</role-name>
<externally-defined/>
</security-role-assignment>
<security-role-assignment>
<role-name>MarsViewer</role-name>
<externally-defined/>
</security-role-assignment>
</weblogic-ejb-jar>I tried using the <global-role/> tag instead - this does deploy without any errors - but when I call the secure EJB method I get the Security Violation error below.
The DTD says using the <global-role/> tag is fine, albeit deprecated, but the Weblogic 8.1 manual says this has been replaced by <externally-defined/>, so I'm not sure if this should work or not.
[EJB:010160]Security Violation: User: 'ghughes' has insufficient permission to access EJB: type=<ejb>, application=_appsdir_mars-marketdata_ear, module=ejb-marketdata.jar, ejb=marketdata.MarketDataManager, method=getEnergyOverview, methodInterface=Remote, signature={java.util.Date}.
So on the whole I'd prefer to work out why Weblogic isn't recognising <externally-defined/> - I've included the full deployment descriptor below - I'm generating it using the latest snapshot of XDoclet - is the DTD specified correct for Weblogic 8.1 SP3 ? (It matches the one specified in http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html - but I can't think of anything else that could be wrong).
Any tips much appreciated as I need to enable an administrator to customise these roles at runtime rather than hard-coding the role - group mappings into the deployment descriptors.
Thanks,
Gavin.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
<weblogic-ejb-jar>
<description><![CDATA[Generated by XDoclet]]></description>
<weblogic-enterprise-bean>
<ejb-name>marketdata.MarketDataManager</ejb-name>
<stateless-session-descriptor>
</stateless-session-descriptor>
<reference-descriptor>
</reference-descriptor>
<jndi-name>marketdata.MarketDataManager</jndi-name>
<local-jndi-name>marketdata.MarketDataManagerLocal</local-jndi-name>
</weblogic-enterprise-bean>
<weblogic-enterprise-bean>
<ejb-name>marketdata.MessageManager</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>5</max-beans-in-free-pool>
<initial-beans-in-free-pool>1</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>FileTopic</destination-jndi-name>
<connection-factory-jndi-name>JMSConnectionFactory</connection-factory-jndi-name>
<jms-polling-interval-seconds>10</jms-polling-interval-seconds>
<jms-client-id>1</jms-client-id>
</message-driven-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>10</trans-timeout-seconds>
</transaction-descriptor>
<reference-descriptor>
</reference-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
</weblogic-enterprise-bean>
<!--
To add enterprise beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called weblogic-enterprise-beans.xml that contains
the <weblogic-enterprise-bean></weblogic-enterprise-bean> markup for those beans.
-->
<!-- xdoclet merge file -> weblogic-ejb-jar.xml -->
<security-role-assignment>
<role-name>MarsAdmin</role-name>
<externally-defined/>
</security-role-assignment>
<security-role-assignment>
<role-name>MarsViewer</role-name>
<externally-defined/>
</security-role-assignment>
<idempotent-methods>
</idempotent-methods>
</weblogic-ejb-jar>
Message was edited by [email protected] at Sep 8, 2004 8:45 PM -
Sample weblogic-ejb-jar.xml for Resource-ref EJB 3.0
I am trying to create an MDB that can be re-used under different names.
@MessageDriven(description = "An MDB that transfers messages from one Queue to another", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class TransferMdb implements MessageListener {
private static final Logger LOG = Logger.getLogger(TransferMdb.class);
@Resource(name = "jms/connfactory")
private ConnectionFactory connectionFactory;
@Resource(name = "jms/targetDestination")
private Queue targetDestination;
<ejb-jar version="3.0" 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_3_0.xsd">
<enterprise-beans>
<message-driven>
<ejb-name>TransferMdb</ejb-name>
<ejb-class>TransferMdb</ejb-class>
</message-driven>
</enterprise-beans>
</ejb-jar>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>TransferMdb</ejb-name>
<message-driven-descriptor>
<pool>
<max-beans-in-free-pool>200</max-beans-in-free-pool>
<initial-beans-in-free-pool>5</initial-beans-in-free-pool>
</pool>
<destination-jndi-name>test_queue</destination-jndi-name>
<transaction-descriptor>
<trans-timeout-seconds>20</trans-timeout-seconds>
</transaction-descriptor>
</message-driven-descriptor>
<reference-descriptor>
<resource-description>
<res-ref-name>jms/connectionfactory</res-ref-name>
<jndi-name>connectionfactory</jndi-name>
</resource-description>
<resource-description>
<res-ref-name>jms/targetDestination</res-ref-name>
<jndi-name>reply_queue</jndi-name>
</resource-description>
</reference-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
However when I deploy the above, I get exceptions such as:
problem: cvc-complex-type.2.4a: Expected elements 'initial-context-factory@http://www.bea.com/ns/weblogic/weblogic-ejb-jar provider-url@http://www.bea.com/ns/weblogic/weblogic-ejb-jar connection-factory-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-polling-interval-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar generate-unique-jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar durable-subscription-deletion@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-messages-in-transaction@http://www.bea.com/ns/weblogic/weblogic-ejb-jar distributed-destination-connection@http://www.bea.com/ns/weblogic/weblogic-ejb-jar use81-style-polling@http://www.bea.com/ns/weblogic/weblogic-ejb-jar init-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar security-plugin@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element message-driven-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
problem: cvc-complex-type.2.4a: Expected elements 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar iiop-security-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-env-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar ejb-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar service-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar enable-call-by-reference@http://www.bea.com/ns/weblogic/weblogic-ejb-jar network-access-point@http://www.bea.com/ns/weblogic/weblogic-ejb-jar clients-on-same-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar run-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar create-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remove-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar passivate-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar local-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar dispatch-policy@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remote-client-timeout@http://www.bea.com/ns/weblogic/weblogic-ejb-jar stick-to-first-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'reference-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element weblogic-enterprise-bean@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
I am clearly missing items in the weblogic-ejb-jar.xml. If anyone has a sample or tips, that would be awesome as a starting point.Those tags just declare that you are using our CMP provider and that
your descriptor is in META-INF/weblogic-cmp-rdbms-jar.xml.
FWIW, you might also want to check out EJBGen. It tends to keep more up
to date with WLS than xdoclet.
-- Rob
Gen wrote:
I am using xdoclets to generate descriptor file weblogic-ejb-jar.xml
for a BMP entity bean. Xdoclet is generating the descriptor file
alright, but is putting the following extra tags. This happens even
for samples which come with the download, so my tags in java file are
not wrong.
My question is, are the extra tags below harmless, or should I
manually go to each desciptor file and remove them?
Thanks.
----------- EXTRA TAGS GENERATED START ---------
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>
----------- EXTRA TAGS GENERATED END ---------
----------- TAGS I PUT IN JAVA CLASS START --------
* @ejb:bean name="com.ejb.entity.Customer"
* jndi-name="com.ejb.entity.CustomerHome"
* view-type="remote"
* type="BMP"
* primkey-field="com.ejb.entity.CustomerPK"
* reentrant="false"
* @weblogic:cache
* max-beans-in-cache="1000"
* read-timeout-seconds="900"
* concurrency-strategy="ReadOnly"
----------- TAGS I PUT IN JAVA CLASS END --------
Maybe you are looking for
-
10g installation error... Need help
I launched the ./runInstaller comman, met all the installer requirements, and then this:... [oracle@localhost database]$ Exception in thread "main" java.lang.InteranalError: Can't connect to X11 window server using 'localhost.localdomain:0.0' as the
-
POSTDATED CHECKS SCENARIO IN case of vendor
Hi, in case of vendor if we need to issue Postdated checks any configuration i has to & tell me the detail procedure for how to go head for Postdated Checks Scenario in CaseĀ of vendor like customer Bills of exchange is there any process is there reg
-
I was trying to set up my terminal to use for my computer science class and when i used the instructions from my professor to be able to run the binaries I get this when i open terminal. -bash: export: `/Library/Frameworks/Python.framework/Versions/3
-
Seperate MVT 521/522 from 201/202 to different number range of mate. doc
The requirement is to seperate movement type 521/522 and 201/202. SAP is set both the transaction/event type: WA. (GI, Transfer Posting,Other GR) Is there any way to seperate these two kinds of movement to different material document number range? I
-
All of a sudden all the pages i opened had miniscule letters and when i tried to hit a link it opened a new tab which was also miniscule. i opened internet explorer and here i couldn't enter any data it kept opening the open file box. so i closed it