Method-permission in ejb-jar.xml
Hi,
Need understanding, whether <role-name> here is an "AND" or "OR" i.e to execute
the method
testmethod, the user has to be in both the roles or any one of the role. (Roles
are mapped
to groups in weblogic-ejb-jar.xml).
<method-permission>
<role-name>Master</role-name>
<role-name>Supervisor</role-name>
<method>
<ejb-name>TEST</ejb-name>
<method-name>testMethod</method-name>
</method>
</method-permission>
An early response will be appreciated.
Generally, in most of the descriptors(web.xml, ejb-jar.xml, weblogic.xml
etc) the iterative element values are related by AND. Same is true for
"role-name". Both roles "Master" & "Supervisor" will be allowed access to
testMethod.
- Santanu
BEA Systems.
"sanjay" <[email protected]> wrote in message
news:3ecbac80$[email protected]..
>
Hi,
Need understanding, whether <role-name> here is an "AND" or "OR" i.e toexecute
the method
testmethod, the user has to be in both the roles or any one of the role.(Roles
are mapped
to groups in weblogic-ejb-jar.xml).
<method-permission>
<role-name>Master</role-name>
<role-name>Supervisor</role-name>
<method>
<ejb-name>TEST</ejb-name>
<method-name>testMethod</method-name>
</method>
</method-permission>
An early response will be appreciated.
Similar Messages
-
Finder-method in orion-ejb-jar.xml
Hi,
Is there a way to let jdeveloper 9.0.3 preview to automatically generate finder-method descriptors for us? When I was developing a cmp-based entity bean, although I defined the ejb-ql in ejb-jar.xml, JDeveloper still just generated the first orion-ejb-jar.xml shown below. In the first orion-ejb-jar.xml, there is no definition for any finder-method. I have to manually add my own definition to it, which is shown in the second orion-ejb-jar.xml. I know that the oc4j container will generate the finder-method after deployment, but in some situation it generated incorrect finder-method descriptors. One of such situation is the between query like "between ?1 and ?2". Anyway, if JDeveloper can generate the finder-method during development, then we can know whether the descriptor is correct or not before deployment, and we can make modifications before deploying it to oc4j server.
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
<enterprise-beans>
<entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
<primkey-mapping>
<cmp-field-mapping>
<fields>
<cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
</fields>
</cmp-field-mapping>
</primkey-mapping>
<cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
<cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
<cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
<cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
</entity-deployment>
</enterprise-beans>
<assembly-descriptor>
<default-method-access>
<security-role-mapping name="<default-ejb-caller-role>" impliesAll="true"/>
</default-method-access>
</assembly-descriptor>
</orion-ejb-jar>
<?xml version = '1.0' encoding = 'windows-1252'?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" " " target="_new">http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd"> <orion-ejb-jar>
<enterprise-beans>
<entity-deployment name="BooksBean" data-source="jdbc/bookDS" table="BOOKS">
<primkey-mapping>
<cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
</primkey-mapping>
<cmp-field-mapping name="isbn" persistence-name="ISBN" persistence-type="NUMBER(10)"/>
<cmp-field-mapping name="title" persistence-name="TITLE" persistence-type="VARCHAR2(50)"/>
<cmp-field-mapping name="author" persistence-name="AUTHOR" persistence-type="VARCHAR2(50)"/>
<cmp-field-mapping name="price" persistence-name="PRICE" persistence-type="NUMBER(6,2)"/>
<finder-method query="select * from books where $author like $1">
<method>
<ejb-name>BooksBean</ejb-name>
<method-name>findByAuthor</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</method>
</finder-method>
<finder-method query="select * from books where $title like $1">
<method>
<ejb-name>BooksBean</ejb-name>
<method-name>findByTitle</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</method>
</finder-method>
<finder-method query="$price between $1 and $2">
<method>
<ejb-name>BooksBean</ejb-name>
<method-name>findByPriceRange</method-name>
<method-params>
<method-param>double</method-param>
<method-param>double</method-param>
</method-params>
</method>
</finder-method>
</entity-deployment>
</enterprise-beans>
<assembly-descriptor>
<default-method-access>
<security-role-mapping impliesAll="true" name="<default-ejb-caller-role>"/>
</default-method-access>
</assembly-descriptor>
</orion-ejb-jar>
Any one has any idea?
Thanks,
JingzhiJingzhi -- 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 -
Vendor-ejb-jar.xml to orion-ejb-jar.xml, finder methods
Hello
I want to convert a inprise based EJB 1.1 application from inprise to OC4J. The inprise based finder methods are quite different from the syntax of orion-ejb-jar.xml, regarding the finder methods. Does anyone know if this can be done more easily. Using JDev 903_pre does not help much. I dont have access to JBuilder either. It seems I have to write all the finder methods once more and it takes days.
Any hints ?
Ana MariaOC4J does not require all finder methods in the orion-ejb-jar.xml and it automatically generates all simple finder methods. The easiest thing to do is deploy the EJBs into OC4J and it will generate the finder methods in the $OC4J_HOME/j2ee/home/application-deployment/<application-name>/ejb-jar-name/ directory and then you can modify these per your requirement and package with your EJBs.
hope this helps
thanks
Debu -
Access ejb-jar.xml progrmmatically for viewing the user roles and methods
We are using Weblogic 8.1 sp 4 (jdk 1.4.2). Is there any way within our application where we can display all the methods a user can access and all the roles available within ejb-jar.xml ?
Thanks in Advance
DRGLocal interfaces are for communication between ejbs and their clients when both are in the same JVM. The clients can be normal clients, jsps, servlets, and other ejbs. If the client is not in the same JVM you cannot use local interfaces even though your client is another ejb.
Advantage of using local interface is it reduces the network overhead.
For more information you can download Mastering Enterprise Java Beans Third Edition by Ed Roman. You can go through 45
You can download pdf version from.
http://www.theserverside.com/books/wiley/masteringEJB/index.tss.
Let me know the URL of the ejb doc that you referred.
Thanks.. -
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 -
Configure security-role and method permission for EJB 3.0 using Jdev 11g
The EJB 3.0 session bean created by Jdev 11g EJB wizard does not have ejb-jar.xml. Where and how can security-role and method permission for the EJB be configured?
For example,
<assembly-descriptor>
<security-role>
<role-name>managers</role-name>
</security-role>
<method-permission>
<role-name>managers</role-name>
<method>
<ejb-name>Employees</ejb-name>
<method-name>setSalary</method-name>
<method-params>
<method-param>java.lang.Long</method-param>
</method-params>
</method>
</method-permission>
</assembly-descriptor>user516954,
By default annotations are used. However, you can create a new descriptor and that will take presidence over any declared annotation.
--Ric -
[Fwd: ACL for ejb-jar.xml?]
[email.eml]
The documentation of EJB security suffers because EJB relies half on Sun and
half on the container vendor (BEA, in this case). Sun's EJB documentation
(http://java.sun.com/products/ejb/index.html) is vague because it is a
standards specification, not a coding guide or implementation tutorial.
BEA's docs expect the reader to be adept at figuring out the details:
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_reference.html#1031011
Here is my (quick) stab at what the deployment descriptors need to look
like, starting with ejb-jar.xml:
<ejb-jar>
<enterprise-beans>
<!-- Other stuff here... -->
</enterprise-beans>
<assembly-descriptor>
<!-- Other stuff here... -->
<security-role>
<description>
This role is allowed to access the read-only methods in the
system.
</description>
<role-name>
ReadOnly
</role-name>
</security-role>
<method-permission>
<role-name>
ReadOnly
</role-name>
<method>
<ejb-name>
MyEJB
</ejb-name>
<method-name>
getName
</name-name>
</method>
<method>
<ejb-name>
MyOtherEJB
</ejb-name>
<method-name>
getOtherName
</name-name>
</method>
</method-permission>
</assembly-descriptor>
</ejb-jar>
It basically defines a security role named "ReadOnly" and maps that role to
the methods MyEJB.getName() and MyOtherEJB.getOtherName().
Here is an example weblogic-ejb-jar.xml:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<!-- Other stuff here... -->
</weblogic-enterprise-bean>
<security-role-assignment>
<role-name>
Users
</role-name>
<principal-name>
everyone
</principal-name>
</security-role-assignment>
</weblogic-ejb-jar>
"ReadOnly" the security role defined in ejb-jar.xml.
"everyone" is the principal (user or group) defined by your Weblogic realm.
Weblogic realms and ACLs are documented:
http://www.weblogic.com/docs51/classdocs/API_acl.html
ltr, Shy
"minjiang" <[email protected]> wrote in message
news:[email protected]...
>
Hi:
I try to use ACL for my beans. It needs me to write the applicaiton
role in ejb-jar.xml file. But what is the correct format for this? I
cannot find any document on this. Seems to be a problem of Sun.
Can anyone give me an example on how to write these two xml files on
this?
Thanks.
minjiang--
S H Y E L A A B E R M A N
Architect, Development
HotelTools, Inc. - http://www.hoteltools.com
100 Galleria Parkway, Suite 1020
Atlanta, Georgia 30339
v: 770.956.4080 x5359
f: 770.956.4077
c: 678.458.3458
[email protected]
A dreamer is one who can only find hisway by moonlight, and his punishment
is that he sees the dawn before the restof the world. -- Oscar Wilde
Lose as if you like it; win as if youwere used to it. -- Tommy Hitchcock -
Disable-warning statement in weblogic-ejb-jar.xml
I'm having problems with the <disable-warning> statement in the weblogic-ejb-jar.xml file. I havn't been able to find documentation on exactly where the statment is supposed to be placed, as all sites just say to include the statement in your weblogic-ejb-jar.xml file. I found a working solution where I placed the statement after declaring all the weblogic-enterprise-bean and right before the closing </weblogic-ejb-jar> statment.
Now the problem is that I have included a <transaction-isolation> block and weblogic complains about my disable warning statment.
Does anyone know the proper location for the <disable-warning> statement?
here is the format that was working before:
</weblogic-enterprise-bean>
<disable-warning>BEA-010054</disable-warning>
</weblogic-ejb-jar> now I have:
</weblogic-enterprise-bean>
<transaction-isolation>
<isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
<method>
</method>
</transaction-isolation>
<disable-warning>BEA-010054</disable-warning>
</weblogic-ejb-jar>I have tried putting the disable warning before the transaction-isolation and after and weblogic complains about both.
Any Ideas?
Thanks for your time.I have tried putting the disable warning beforethe
transaction-isolation and after and weblogic
complains about both.
Any Ideas?It would be a good idea to post the message weblogic
is displaying. There are a couple of things you could
check:
* As per the documentation, the <disable-warning> tag
was added in 8.1. Check if you are using the correct
DTD for Weblogic 8.1 (and the version of Weblogic
is 8.1 or higher
* As per the DTD, the <disable-warning> comes after
the <transaction-isolation>
<!ELEMENT weblogic-ejb-jar (description?,
weblogic-enterprise-bean*,
security-role-assignment*,
run-as-role-assignment*,
security-permission?,
transaction-isolation*,
idempotent-methods?,
enable-bean-class-redeploy?,
disable-warning*)
ke sure you maintain this order of elements within
<weblogic-ejb-jar>
Refer to
http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-j
ar.htmlYep, it was pointing to an older dtd. Thank you! -
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-jar.xml gets corrupted..at the time of deployment
Hi,
I'm Implemnting an application for Ejb's in WebDynpro.
I'm conncting my database table in java dictionary to Webdynpro Interface using EJB.
I have used the follwing link...
Link: Consuming EJBs in web dynpro Using java dictionary
But i'm facing 2 problms
First one is when i write code in command bean that is a java file, It gives error for Create maethode for argumnts..
when i try to do sme changes wid this create method a new create method gets creatd..
second problm is when i do sme changes wid coding Ejb-jar.xml file gets corruptd 7 shows Error message..
tent of element type "enterprise-beans" is incomplete, it must match "(session|entity|message-driven)".+
Can Anybody temme why is it hppning ????
All hlpfull posts will be cherished.
Regards,
Khushboo SinghalI have solved this problem via adding Beans to xml files..
-
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 -
Error compiling ejb-jar.xml. Help!!
I do not know why this xml file is giving me the errors displayed below.
Thank you in advance.
Here is my xml file:
<?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>ObjectConnectorBean</ejb-name>
<display-name>ObjectConnector</display-name>
<home>com.harris.netboss.shared.posting.ObjectConnectorHome</home>
<remote>com.harris.netboss.shared.posting.ObjectConnector</remote>
<ejb-class>com.harris.netboss.shared.posting.ObjectConnectorBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.harris.netboss.shared.posting.ObjectConnectorPK</prim-ke
y-class>
<reentrant>False</reentrant>
</entity>
</enterprise-beans>
</ejb-jar>
Here is the error message:
org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at org.xml.sax.SAXException.<init>(SAXException.java:45)
at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
at
weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008)
at
weblogic.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
ror(XMLValidator.java:1280)
at
weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(Compile
d Code)
at
weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
ch(Compiled Code)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
Code)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:128)
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
at weblogic.ejbc20.runBody(Compiled Code)
at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20)
--------------- nested within: ------------------
weblogic.xml.process.XMLParsingException: The content of element type
"entity" must match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
. - with nested exception:
[org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
.] Line: 16 Column: 16
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at weblogic.utils.NestedException.<init>(NestedException.java:18)
at
weblogic.xml.process.XMLParsingException.<init>(XMLParsingException.java:17)
at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:132)
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
at weblogic.ejbc20.runBody(Compiled Code)
at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20)
ERROR: weblogic.xml.process.XMLParsingException: The content of element type
"entity" must match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
. - with nested exception:
[org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
.] Line: 16 Column: 16looks like your xml file(ejb-jar.xml) is missing some required tag element or
the elements are out of
order. the format is specified in a dtd, you should take a look at the dtd for
ejb-jar.xml. for wl5.1, try looking under c:\weblogic for ejb-jar.dtd
Richard Ong wrote:
I do not know why this xml file is giving me the errors displayed below.
Thank you in advance.
Here is my xml file:
<?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>ObjectConnectorBean</ejb-name>
<display-name>ObjectConnector</display-name>
<home>com.harris.netboss.shared.posting.ObjectConnectorHome</home>
<remote>com.harris.netboss.shared.posting.ObjectConnector</remote>
<ejb-class>com.harris.netboss.shared.posting.ObjectConnectorBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.harris.netboss.shared.posting.ObjectConnectorPK</prim-ke
y-class>
<reentrant>False</reentrant>
</entity>
</enterprise-beans>
</ejb-jar>
Here is the error message:
org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Exception.java:42)
at org.xml.sax.SAXException.<init>(SAXException.java:45)
at org.xml.sax.SAXParseException.<init>(SAXParseException.java:56)
at
weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1008)
at
weblogic.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLEr
ror(XMLValidator.java:1280)
at
weblogic.apache.xerces.validators.common.XMLValidator.callEndElement(Compile
d Code)
at
weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispat
ch(Compiled Code)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
Code)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:128)
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
at weblogic.ejbc20.runBody(Compiled Code)
at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20)
--------------- nested within: ------------------
weblogic.xml.process.XMLParsingException: The content of element type
"entity" must match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
. - with nested exception:
[org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
.] Line: 16 Column: 16
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at weblogic.utils.NestedException.<init>(NestedException.java:18)
at
weblogic.xml.process.XMLParsingException.<init>(XMLParsingException.java:17)
at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:132)
at
weblogic.ejb20.dd.xml.EjbJarLoader_EJB20.process(EjbJarLoader_EJB20.java:919
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:74)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:47)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:38)
at weblogic.ejbc20.runBody(Compiled Code)
at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20)
ERROR: weblogic.xml.process.XMLParsingException: The content of element type
"entity" must match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
. - with nested exception:
[org.xml.sax.SAXParseException: The content of element type "entity" must
match
"(description?,display-name?,small-icon?,large-icon?,ejb-name,home,remote,ej
b-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-sche
ma-name?,cmp-field*,primkey-field?,transaction-scope?,env-entry*,ejb-ref*,se
curity-role-ref*,security-identity?,resource-ref*,resource-env-ref*,query*)"
.] Line: 16 Column: 16 -
Generated orion-ejb-jar.xml
I have app. which run under oc4j(version 020725.1695). If I try new
oc4j(version 020927.1699), app doesn't run.
If I compare generated orion-ejb-jar.xml by oc4j(version 020725.1695)
with generated orion-ejb-jar.xml by oc4j(version 020927.1699) there
is a differnce.
What I'm doing wrong?
thanks for any idea.
Jan
Differnce:
Relationship
my orion-ejb-jar.xml in project:
<cmp-field-mapping name="samaCase">
<entity-ref home="CaseBean">
<cmp-field-mapping name="samaCase">
<fields>
<cmp-field-mapping name="oid" persistence-name="CASE_ID"/>
</fields>
</cmp-field-mapping>
</entity-ref>
</cmp-field-mapping>
oc4j(version 020725.1695):
<cmp-field-mapping name="samaCase">
<entity-ref home="CaseBean">
<cmp-field-mapping name="samaCase">
<fields>
? <cmp-field-mapping name="oid" persistence-name="CASE_ID" />
</fields>
</cmp-field-mapping>
</entity-ref>
</cmp-field-mapping>
oc4j(version 020927.1699):
<cmp-field-mapping name="samaCase">
<entity-ref home="CaseBean">
<cmp-field-mapping name="samaCase">
<fields>
? <cmp-field-mapping name="oid" persistence-name="OID" />
</fields>
</cmp-field-mapping>
</entity-ref>
</cmp-field-mapping>
finders:
my orion-ejb-jar.xml in project:
- none
oc4j(version 020725.1695):
? <finder-method query="SELECT oid FROM SM_RATE" partial="false">
? <!-- Generated SQL: "SELECT oid FROM SM_RATE" -->
<method>
<ejb-name>RateBean</ejb-name>
<method-name>findAll</method-name>
<method-params>
</method-params>
</method>
</finder-method>
oc4j(version 020927.1699):
? <finder-method>
? <!-- Generated SQL: "select SM_RATE.OID from SM_RATE -->
<method>
<ejb-name>RateBean</ejb-name>
<method-name>findAll</method-name>
<method-params>
</method-params>
</method>
</finder-method>well, actually we delete the previously deployed application always. (we had to do it in old one, and also we try it in new oc4j. It didn't help.). New oc4j always rewrite our persistence-name CASE_ID on OID.
You are right, we have mapping on old orion-ejb-jar.xml too. The purpose is that we have a variable samaCase and the colum in the table is CASE_ID.
The question is, what we are doing wrong? Our app is running in old oc4j(version 020725.1695), and not in new oc4j(version 020725.1695). The problem is in the EJB relatinship.
EJB-QL - ok.
There is missing : " on the end. (behind the table name SN_RATE) Is it ok?
<!-- Generated SQL: "select SM_RATE.OID from SM_RATE -->
Jan
Maybe you are looking for
-
my voice call services is not working with cellular network...only works fine with wifi..please help?
-
Firefox will not load the normal way (clicking on a link or running it from Run window or even running it in safe mode). It only runs if I dig down to the installed directory, right-click firefox.exe and select "Run inside Comodo Sandbox". I have Com
-
Logic & Mainstage Crash On Leopard 10.5.2
I have discussed with many Leopard user lately... This is what I heard from them 1. with 10.5.1 and Mainstage 1.0.2 I had a pretty **** solid setup, since the 10.5.2 update I'm getting crazy cpu spikes all over the place and its basically feeling a l
-
Trying to copy something from ID to IL doesnt work
I have something I created in IDCS3. It's all outlines. I copy it and try to paste it into Illustrator CS3 and nothing happens. Tried several different ways but nothing happens in illustrator. So, I exported the IDCS3 document to PDF and placed in Il
-
We need to derive ZNUMPACK (Number of Packages) in plants depends batch
Hi Experts, I have the code,it is nothing but a lookup on 0BATCH for quantity more lines greater than zero.I would like to derive it directly in the BEx Report. That is all we have to do is count the number of batch lines. We need to derive ZNUMPAC