Query Reg env-entry in ejb jar xml
Hi,
I have the following tag in the ejb-jar of my application:
<env-entry>
<env-entry-name>postingDate</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>Request</env-entry-value>
</env-entry>
When a JNDI LookUp is done for this variable in the application, it doesn't pick up the value of the variable which is "Request" but it picks up the Value of the Posting Date.
I need to know how this works!
Just an Fyi, Posting Date is a date entered from the UI.
I feel it is like declaring global and local variables with the same name and trying to access that variable.
Similar Messages
-
In my ejb-jar.xml I have a Session bean with a env-entry:
<env-entry>
<env-entry-name>xslNameFile</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>pdftemplate.xsl</env-entry-value>
</env-entry>
In a class where I use the bean I make a lookup of this env-entry (using the same
context):
Context environment = (Context)ctx.lookup("java:comp/env/");
val = (String)environment.lookup("xslNameFile");
And I have the following Exception:
javax.naming.NameNotFoundException: Unable to resolve 'comp/env/xslNameFile' Reso
lved: 'comp/env' Unresolved:'xslNameFile' ; remaining name 'xslNameFile'
What I m doing wrong??
Could anyone help me?
Thanks
F.CanonicaHI ,
The Primary Purpose of <env-entry> tag
is used to Customize your bean at Runtime
and to Make your bean as an DataDriven one.
( instead of Storing it in DataBase )
Regards
Karthikeyan Gangadharan
"Deepak Vohra" <[email protected]> wrote:
>
>
>
InitialContext ic = new InitialContext();
String val = (String) ic.lookup("java:/comp/env/xslNameFile");
"canonica" <[email protected]> wrote:
In my ejb-jar.xml I have a Session bean with a env-entry:
<env-entry>
<env-entry-name>xslNameFile</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>pdftemplate.xsl</env-entry-value>
</env-entry>
In a class where I use the bean I make a lookup of this env-entry (using
the same
context):
Context environment = (Context)ctx.lookup("java:comp/env/");
val = (String)environment.lookup("xslNameFile");
And I have the following Exception:
javax.naming.NameNotFoundException: Unable to resolve 'comp/env/xslNameFile'
Reso
lved: 'comp/env' Unresolved:'xslNameFile' ; remaining name 'xslNameFile'
What I m doing wrong??
Could anyone help me?
Thanks
F.Canonica -
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 :-) -
Common lookup for datasource name in ejb-jar.xml for all EJB's??
I used <env-entry>...</env-entry> in ejb-jar.xml ...but that does not allow me to look the same entry in another EJB ...what is the right place to keep and look for such a information ?
EJBing recently !!
Thanks
AjayI am sorry friend, that is not what i am looking for.
I have datasource/connection pool and do not want to hardcode the name into all EJB's rather want to access it from xml file. If i use
<env-entry> that is for a perticular session or entity bean. and i have to write that for all 35 beans. I believe there shoule be a tag to access globaly.
thanks for considering me to reply.
Ajay -
ModelException when moving Activation properties for MDB to ejb-jar.xml
Hi,
I have an MDB called BatchMdb that needs to be deployed into both JBoss and SAP NetWeaver. This means I have different activation config properties depending on the application server. So I cannot specify the properties by annotation, I have to place them in the ejb-jar.xml. It works fine in JBoss, but in the SAP IDE, I get this exception:
EJB Model Builder: Exception occurred: com.sap.engine.services.ejb3.model.impl.ModelException: There is no bean BatchMdb defined in module auth_app*annotation|src. at com.sap.engine.services.ejb3.model.impl.ModuleImpl.getBeanImpl(ModuleImpl.java:181)
For some reason, the IDE does not like the entry in ejb-jar.xml for the MDB. This looks like a bug to me. Comments, anyone?
Regards,
JohanHi Vladimir
Here's the stack trace:
com.sap.engine.services.ejb3.model.impl.ModelException: There is no bean MDBBean defined in module testMdb*annotation|ejbModule.
at com.sap.engine.services.ejb3.model.impl.ModuleImpl.getBeanImpl(ModuleImpl.java:181)
at com.sap.engine.services.ejb3.model.builders.xml.BeanCommonBuilder.importMetadataFromEJBJarXml(BeanCommonBuilder.java:42)
at com.sap.engine.services.ejb3.model.builders.xml.MessageBeanBuilder.importMetadataFromEJBJarXml(MessageBeanBuilder.java:41)
at com.sap.engine.services.ejb3.model.builders.xml.BrieflyDescribedBuilder.process(BrieflyDescribedBuilder.java:44)
at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.processMessageBeans(ModuleBuilder.java:201)
at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.processEnterpriseBeans(ModuleBuilder.java:128)
at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.importMetadataFromEJBJarXml(ModuleBuilder.java:85)
at com.sap.engine.services.ejb3.model.builders.xml.ModuleBuilder.process(ModuleBuilder.java:73)
at com.sap.engine.services.ejb3.model.builders.xml.XMLModelFiller.perform(XMLModelFiller.java:55)
at com.sap.engine.services.ejb3.model.builders.CompositeModuleBuilder.getXmlModule(CompositeModuleBuilder.java:135)
at com.sap.engine.services.ejb3.model.builders.CompositeModuleBuilder.buildModule(CompositeModuleBuilder.java:90)
at com.sap.tc.jtools.jlinee.ejb.model.EJBModelBuilder.buildJEE5(EJBModelBuilder.java:200)
at com.sap.tc.jtools.jlinee.ejb.model.EJBModelBuilder.build(EJBModelBuilder.java:88)
at com.sap.tc.jtools.jlinee.lib.model.impl.AbstractModelBuilderTest.execute(AbstractModelBuilderTest.java:48)
at com.sap.tc.jtools.jlinee.lib.AbstractJ2EETest.executeWithStatus(AbstractJ2EETest.java:149)
at com.sap.tc.jtools.jlinee.lib.framework.dependency.Node.execute(Node.java:212)
at com.sap.tc.jtools.jlinee.lib.framework.JLinEETestProcessor.executeAll(JLinEETestProcessor.java:153)
at com.sap.tc.jtools.jlinee.lib.framework.JLinEETestProcessor.execute(JLinEETestProcessor.java:123)
at com.sap.engine.jlinee.lib.impl.TestManager.executeTestsForAppComponent(TestManager.java:154)
at com.sap.engine.jlinee.lib.impl.TestManager.executeTests(TestManager.java:89)
at com.sap.engine.jlinee.lib.JLinEEValidatorImpl.validateApplication(JLinEEValidatorImpl.java:143)
at com.sap.engine.jlinee.lib.JLinEEValidatorImpl.validateApplication(JLinEEValidatorImpl.java:127)
at com.sap.tc.jtools.jlint.validation.wtp.JLinEEValidator.validate(JLinEEValidator.java:69)
at org.eclipse.wst.validation.internal.core.ValidatorLauncher.start(ValidatorLauncher.java:98)
at org.eclipse.wst.validation.internal.operations.ValidationOperation.launchValidator(ValidationOperation.java:1286)
at org.eclipse.wst.validation.internal.operations.ValidationOperation.internalValidate(ValidationOperation.java:1101)
at org.eclipse.wst.validation.internal.operations.ValidationOperation.validate(ValidationOperation.java:996)
at org.eclipse.wst.validation.internal.operations.ValidationOperation.run(ValidationOperation.java:657)
at org.eclipse.wst.validation.internal.operations.ValidationBuilder.build(ValidationBuilder.java:203)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:624)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:166)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:197)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:246)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:249)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:302)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:334)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:137)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[Error: com.sap.tc.jtools.jlinee.lib Thread[Worker-85,5,main]] -
env-entry element in ejb-jar.xml
I just started to create my ejb-jar.xml (deployment descriptor file) manually so
that I won't depend on those generated by proprietary IDEs.
The ejb-jar_2_0.dtd specifies that env-entry is used in
entity, message-driven, and session elements.
My question is - When do we use the element <env-entry>? Under what
circumstances that ejb-jar_2_0.dtd necessitates its provision in the ejb-jar.xml
in relation to entity, message-driven, and session elements?Hi,
I've same prob here
<env-entry>
<env-entry-name>config.file.location</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>C:/bea/ITReportingConf.xml</env-entry-value>
</env-entry>
Right now config file is out side of my EAR, How can i put it within the EAR I tried with changing the
<env-entry-value>/ITReportingConf.xml</env-entry-value> Value
But i dont know which dir it is refering to and where should i put "ITReportingConf.xml" File
Thanks -
Reg. Field names in ejb-jar.xml (EJB CMP)
Hi,
I am using WAS 5.1 and EJB CMP 2.0.
I got a error while dealing with the database i.e ORACLE 8.The Scenario in detail,
I had a table X with filed names 'help' and 'sequence'. When i am generating Jar file using 'ejbdeploy', the name of the field names in Table.ddl changing automatically to 'help1' and 'sequence1'. Due to this i am not able to access data from database.
Why field names are changing? Are they keywords ? con't we have field names with the above names? If they are keywords tell me the document which contains these details?
Thanks in Advance.According to the ejb-jar.xml dtd ejb-name, ejb-class, persistence-type, prim-key-class, reentrant are the required elements for an entity bean.
<!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*)> -
How to add environment entry in EJB3 ejb-jar.xml
Hi,
Is that a build in way of add environment entries in JDev for EJB 3 beans? For EJB 2 beans you can do that using properties. But the bean properties is not available in EJB 3. Please help.
Thanks
KennyThank you for the reply. But I need a way to enter env-entry value in ejb-jar.xml for EJB 3 in Jdev. In EJB 2, Jdev generate ejb-jar.xml for the bean and also let you add env-entry through bean's properties menu. But in there in no properties menu for EJB 3, also generated ejb-jar.xml is only a empty file doesn't contain any EJB depolyment information. That means you have to code ejb-jar.xml all manually.
If I am wrong, can someone show me how to do this right? -
Can't create EJB from existing .java AND ejb-jar.xml entries
I've noticed that I can create the source files for an EJB outside of JDeveloper, then I can do the "Create Entity Bean" thing, and specify the path to the source files, and it will use those source files, instead of forcing me to create them again.
However, I've noticed that if I manually add the information to the "ejb-jar.xml" file, and then try to add the bean, it won't let me. I've found I have to delete the entry from the ejb-jar.xml file and let JDeveloper control the creation of the fields, even if I know exactly what needs to be set.If you are adding/modifying ejb-jar.xml outside JDeveloper and trying to see the changes.
Save the ejb-jar.xml file which is being modified externally
Select ejb-jar.xml in JDeveloper
and do View | Refresh
This will load in the changes (providing the source path has been set properly)
raghu
JDev Team -
Reg. Provider Url set in weblogic-ejb-jar.xml
have created an MDB which listens to an IBM MQ. I currently
specify the path of the binding file by setting the provider_url in the weblogic-ejb-jar.xml
An example is as follows::
<destination-jndi-name>Sample.Q</destination-jndi-name>
<initial-context-factory>com.sun.jndi.fscontext.RefFSContextFactory</initial-context-factory>
<provider-url>file:/apps/test/</provider-url>
<connection-factory-jndi-name>Sample.QCF</connection-factory-jndi-name>
is there any way to set this parameter dynamically from MDB itselfAFAIK you can't dynamically reconfigure MDBs; whats in the XML is what you get.
One alternative is to use Spring and Message Driven POJOs which allows you to use Spring to configure the provider & activation spec, which allows you to dynamically at runtime configure properties however you wish or even hot deploy MDPs within a running application.
http://jencks.org/Message+Driven+POJOs
Depending on how complex your runtime-configuration is you could create your own Spring Factory Beans to do wacky stuff (query a database or whatever to figure out the provider URLs etc) or use a Spring post processor to inject values from some other source (JNDI, LDAP etc).
James
http://logicblaze.com/ -
Query about reentrant in ejb-jar.xml file(in case of entity Bean)
Hi all friends,
I am new to EJB I couldn't understand in ejb-jar.xml file in case Entity Bean[<reentrant>False</reentrant>
&<reentrant>true</reentrant>]what is the function of this tag and what is the effect of value true and false of this tag.Can any one please explain it.
Regards
BikashHi,
Re-entrant tag is used in the ejb-jar.xml to notify the container if you would want your bean to call itself through another bean.
Most of the time you would want it to be set to FALSE because you would have to consider the multi-threading issues if you set it TRUE.
Regards
Meka Toka -
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> -
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 -
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 -
What are the necessary elements in ejb-jar.xml with CMP entity bean
What are the necessary elements in ejb-jar.xml with CMP entity bean
Actually i am using webligic 8.1 and while deployment getting the error that
some elements r missing
Thanks
Anand PritamAccording to the ejb-jar.xml dtd ejb-name, ejb-class, persistence-type, prim-key-class, reentrant are the required elements for an entity bean.
<!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*)>
Maybe you are looking for
-
Mysterious repeat log entries in System events log
I tried unsuccessfully to share internet connection with 2 iMacs without router(That doesn't matter). But after this, my iMac (24" 2.8 GHz) not networked or on internet now shows this repeated log entries every minute: com.apple.launchd[1] (com.apple
-
Reg: F4 help on the selection screen
Hi, My requirement is that I want to get the set of values which i want on the f4 help of the field. But not the default search help which comes. Similar to getting f4 help in ABAP by using the function module F4IF_INT_TABLE_VALUE_REQUEST'. please h
-
Sorting exceptional messages in md06
Is it possible to sort according to exceptional message numbers in md06. i have got more message no. 20, i like to sort and delete the same. pls advise how to do that?
-
LMS 4.1 Topology Service Question
i have only 1 switch 2960 POE at customer enviroment. i did run topology service and checked on the right side POE CAPABLE Devices it shows me that i have 4 switch POE while actually there is only 1 switch POE in real enviroment. does anyone have any
-
how do i change the language of the email i receive when the job has been sent to the printer?