Use of env-entry in ejb-jar
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
HI ,
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
Similar Messages
-
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.
-
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 :-) -
Can't I use the comment in weblogic-ejb-jar.xml?
Hi, I am migrating to WebLogic Server 6.1 from 5.1.
And for the weblogic-ejb-jar.xml,
the following error occurs:
ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid XML character
(Unicode: 0xb8) was found in the comment.
ERROR: ejbc found errors
The errorneous line is the following comment. (it's fine in 5.1)
<!-- if false, ... -->
Must I remove this comment?
Thanks in advance.I used Korean language in comment.
But the charset of XML was iso-8859-1.
Sorry.
"mariah" <[email protected]> wrote:
>
Hi, I am migrating to WebLogic Server 6.1 from 5.1.
And for the weblogic-ejb-jar.xml,
the following error occurs:
ERROR: Error parsing 'META-INF/weblogic-ejb-jar.xml' line 14: An invalid
XML character
(Unicode: 0xb8) was found in the comment.
ERROR: ejbc found errors
The errorneous line is the following comment. (it's fine in 5.1)
<!-- if false, ... -->
Must I remove this comment?
Thanks in advance. -
env-entry-mapping element is removed during deployment process
I overwrite the variable value defined in ejb-jar.xml by the one defined in orion-ejb-jar.xml using <env-entry-mapping> element. But after my appliocation has deployed I don't find this element in the application orion-ejb-jar.xml. Oracle AS just removes this element from the descriptor!
ejb-jar.xml:
<env-entry>
<env-entry-name>server</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>172.38.48.12</env-entry-value>
</env-entry>
orion-ejb-jar.xml:
<session-deployment name="Inventory" max-instances="-1" location="Inventory">
<env-entry-mapping name="server">dummy</env-entry-mapping>
</session-deployment>
Can anybode help?Avi!
Of course, I had tried it before I wrote the question. I put the modified xml file into the application area. After that AS restarts OC4J instance. And then I find my xml without any changes I made! I tried to do the same thing from the AS console. The same!
Leonid -
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 -
Broken orion-ejb-jar.dtd?
I use the Ant task <xmlvalidate> in an EJB project to check the EJB XML deployment descriptors against their DTDs. Checking the (Sun-specified) "ejb-jar.xml" is fine. JDeveloper creates the OC4J specific deployment descriptor "orion-ejb-jar.xml" with a reference to the DTD located at "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd". Now this DTD seems to be broken.
Firstly, the DTD seems to have an invalid syntax. I'm not a DTD expert but Ant complains about lines 279-281 of that DTD :
279: isolation (commited | serializable | uncommited | repeatable_reads)
280: CDATA #IMPLIED
281: locking-mode (pessimistic | optimistic | read-only | old_pessimistic)
286: max-tx-retries CDATA #IMPLIED
287: update-changed-fields-only (true | false) "true"
There seems to be an attribut missing altogether at line 280 (see line 286) so I deleted that line. Then for lines 279 and 281, Ant complained about missing quotes - apparently, such an "enum" needs to have a "default value" (as in line 287), so I manually added such a value for each line.
The final error was in the "orion-ejb-jar.xml" (created by JDeveloper itself). Here is a piece of that:
<orion-ejb-jar>
<enterprise-beans>
<session-deployment max-instances="-1" name="DiscountCalculator"/>
I assume that the "max-instances" attribute sets the number of EJB instances in the OC4J pool to "unlimited". However, according to the DTD, session beans don't have such a "max-instances" attribute (lines 10-21):
<!-- Deployment info for a session bean. -->
ELEMENT session-deployment (env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)
ATTLIST session-deployment call-timeout CDATA #IMPLIED
copy-by-value CDATA #IMPLIED
location CDATA #IMPLIED
max-tx-retries CDATA #IMPLIED
name CDATA #IMPLIED
persistence-filename CDATA #IMPLIED
timeout CDATA #IMPLIED
wrapper CDATA #IMPLIED
replication CDATA #IMPLIED
>
So I copied and pasted the instances attribute from the entity bean section.
How come the DTD is broken? Even the 9.0.3 OC4J docs (http://download-east.oracle.com/docs/cd/A97688_08/generic.903/a97677/dtdxml.htm#620714) talk about all sorts of features (such as the "max-instances" attribute for session beans) and still points to the DTD "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd" that doesn't have these features at all.Karsten,
In case you are still on it, I stumbled upon this some time ago, too. My best guess is that they miss entire phrase, which I put in bold:
....mmited | repeatable_reads ) "commited"
disable-wrapper-cache CDATA #IMPLIED
locking-mode ( pesim...
(There is a line break between '"commited"' and 'disable-wrapper-cache'. 'commited', 'uncommited' must be MISSPELLED exactly as above.)
Btw, max-instances and min-instances are in the DTD that ships with 9.0.3 (jarred in oc4j.jar). This DTD, however, is still broken in the way that you found (it won't even XML-validate). How do they go around this? go figure! Oracle documentation? we all know ...
Best regards,
bjk -
Issue with [env-entry] element in web.xml
I know it's possible to define [env-entry] elements in web.xml for environment
properties of a web application. But how do you access [env-entry] elements from
classes that do not exist within a web application? In other words, this is my
problem:
I have an EAR file, enterprise.ear, which contains the following...
employee.jar
employeeSearchEJB.jar
webApp1.war
META-INF/
application.xml
The employee.jar file is a utility archive that contains common classes, one of
which is a class called LogManager. LogManager needs to read environment properties
in order to initialize itself. Currently, LogManager reads these properties from
a property file, and therefore it needs to know the name of the property file
in order to access it. I dont like this approach because I'm forced to hard-code
the name of the property file in LogManager. I would rather leverage the power
of J2EE deployment descriptors and use the [env-entry] element to define the environment
properties for the LogManager class. Then, I would simply use JNDI to get the
values of the [env-entry] elements without ever having to specify their location
aside from the default JNDI context; java:comp/env, which is standard anyway.
The problem I'm having is that you can define the [env-entry] element in only
2 types of deployment descriptors; namely, web.xml and ejb-jar.xml, neither of
which are available to LogManager because LogManager exists at the EAR root level.
I was hoping application.xml supported the [env-entry] element, but it doesn't.
Any suggestions?
SAFSAF,
I am not sure if this applies to you situation but if you create an initial context
instance and then grab the value using the jndi name within that context then
you should be able to grab that environment variable.
I have a helper class that is used as part of a deployed application. The helper
class doesn't have access to the Servlet context but it is created as part of
the application workflow. When it gets initiated it grabs an env-entry created
in the web.xml deployment descriptor to find the default url for a content path.
After I create an initialContext, I perform a initContext.lookup("jndi.env.entry.here")
where "jndi.env.entry.here" is the name specified in the env-entry tag.
This returns the value of the entry.
This works under both Jrun and Weblogic so my guess is it should work for you.
Again, I am assuming that your class will at least be able to grab a context
object to communicate back to the server.
Hope this helps,
Troy
"SAF" <[email protected]> wrote:
>
I know it's possible to define [env-entry] elements in web.xml for environment
properties of a web application. But how do you access [env-entry] elements
from
classes that do not exist within a web application? In other words, this
is my
problem:
I have an EAR file, enterprise.ear, which contains the following...
employee.jar
employeeSearchEJB.jar
webApp1.war
META-INF/
application.xml
The employee.jar file is a utility archive that contains common classes,
one of
which is a class called LogManager. LogManager needs to read environment
properties
in order to initialize itself. Currently, LogManager reads these properties
from
a property file, and therefore it needs to know the name of the property
file
in order to access it. I dont like this approach because I'm forced to
hard-code
the name of the property file in LogManager. I would rather leverage
the power
of J2EE deployment descriptors and use the [env-entry] element to define
the environment
properties for the LogManager class. Then, I would simply use JNDI to
get the
values of the [env-entry] elements without ever having to specify their
location
aside from the default JNDI context; java:comp/env, which is standard
anyway.
The problem I'm having is that you can define the [env-entry] element
in only
2 types of deployment descriptors; namely, web.xml and ejb-jar.xml, neither
of
which are available to LogManager because LogManager exists at the EAR
root level.
I was hoping application.xml supported the [env-entry] element, but it
doesn't.
Any suggestions?
SAF -
Hi,
I'm creating a J2ee application using various EJB's and at least one WAR, all inside one single EAR file.
This app. is to be intalled at different clients. I'd like to be able to specify different properties ( server used, remote host addresses, etc.) in some part of the EAR that will be available using
(String)context.lookup("java:comp/env/" + name );
I have been able to customize individual EJB's using the <env-entry> tag in its DD but what about the being able to customize the whole application??
I'm been scouring docs and the net and I can't see any specific application.wide examples.
Many thanks for your help.
Terry DoyleI faced the same problem some time ago. I went through the EJB 2.0 spec and the DTD of ejb-jar.xml. It appears that env-entry is for an EJB only. There is no 'global' env-entry.
-
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 -
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]] -
Hi,
When I deploy my application, Weblogic 6.1 validates the ejb-jar.xml against
the public DTD http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd.
In the production system, there will be no public internet access from the
Weblogic server. How do I disable this lookup that required internet access?
I've tried embedding the dtd or using a SYSTEM reference, but ejbc always
complains -
"Error processing 'META-INF/ejb-jar.xml': XML document does not appear to
contain a properly formed DOCTYPE header"
Is it possible to embed DTDs or use SYSTEM DTD references in ejb-jar.xml? If
so, what is the syntax?
Thanks,
ManishActually the problem wasn't with the ejb jar, but the web archive.
Weblogic.xml had the wrong DOCTYPE -
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.1.0
WEB//EN" http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd>
instead of
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application
6.0//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-web-jar.dtd>
Hence the server was trying to look up the url to validate. All works
without internet access now!
Cheers,
Manish
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]..
Actually, ejbc should be using a local copy of the dtd which we ship in
weblogic.jar. You don't need to do anything to disable the network lookup.
-- Rob
Manish Shah wrote:
Hi,
When I deploy my application, Weblogic 6.1 validates the ejb-jar.xml against
the public DTD http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd.
In the production system, there will be no public internet access from the
Weblogic server. How do I disable this lookup that required internet access?
I've tried embedding the dtd or using a SYSTEM reference, but ejbc always
complains -
"Error processing 'META-INF/ejb-jar.xml': XML document does not appear to
contain a properly formed DOCTYPE header"
Is it possible to embed DTDs or use SYSTEM DTD references in ejb-jar.xml? If
so, what is the syntax?
Thanks,
Manish
AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnWebLogic.com -
Xdoclet for Generate CMR Fileds orion-ejb-jar
Does anybody try to use xdoclet to generate orion-ejb-jar.xml with ejb relation?
i tried with @orion.persistence but it's not generate fine.
thanks for any advice.i got this in the orion-ejb-jar.xml
<entity-deployment name="Invoice_master" data-source="jdbc/OracleDS2" table="INVOICE_MASTER">
and got this in the data-sources.xml
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS2"
location="jdbc/OracleCoreDS2"
pooled-location="jdbc/OraclePooledDS2"
xa-location="jdbc/xa/OracleXADS2"
ejb-location="jdbc/OracleDS2"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="_x_"
password="_y_"
min-connections="3"
max-connections="20"
url="jdbc:oracle:thin:@_ip_:1521:devdb"
inactivity-timeout="30"
/>
and i've got no problems with OracleDS2 from other places in the application (getting Connections from the DataSource).. (but its NOT the first source, its the second(as the name may indicate) we're operating with 3 different datasources, going by OracleDS1, OracleDS2, OracleDS3)
Other problems ? to come, to come ;)
Thanks for your time.
with regards. -
Orion-ejb-jar.xml for oc4j and xdoclet
Does anybody try to use xdoclet to generate orion-ejb-jar.xml with ejb relation?
Could somebody show me any example of definition relation for xdoclet and orion-ejb-jar.xml? (@orion:persistence...)
thanks for any advice... :-)
ZajoHello,
The warning message looks to be unrelated to the java.lang.IllegalArgumentException error. The warning states that optimistic locking cannot be migrated to the toplink-ejb-jar.xml file; this is stated in chapter 7 of the TopLink developer's guide at
http://download-west.oracle.com/otn_hosted_doc/toplink/1013/MAIN/_pdf/b13593_v1_01.pdf
The exception though seems to indicate that your orion-ejb-jar.xml contains EJBs mapped to the same table that are not related through EJB inheritance. I do it all the time with POJOs so this will work in TopLink, but you will need a support case to help get your project migrated if this is the case.
Best Regards,
Chris Delahunt -
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
Maybe you are looking for
-
Can't get off the settings page. Cant turn on or off
Hullo there. My current problem is this, whilst on the ipad an alert popped up advertising some game or other for free d/load, when i tried to d/load it a message came up saying(i'll paraphrase here!) "you dont have enough storage left to d/load, go
-
Still no full retina support, even with the new CC Apps?
Hello over there! I just bought the full CC abo, after trying PS and Indesign and becoming a fan of the new workflow, that is possible with the upcoming new CC Apps (Muse, Edge Tools...). Now, after getting things right and downloading the needed App
-
What I an doing is trying to manage the files, for a small project, and I will be taking care of the documents versions. I was wondering if it is possible to to create a the whole Directory tree, where the names of the subfiles can also be displayed.
-
Canon printer randomly erroring out during printing.
A few weeks ago I bought a new AEBS and hooked up my Canon MP530 printer to it. I printed out a few things from my Mac. My wife printed out a few things from her PC. Everything seemed fine. Today I go to print out a simple two page pdf and about 75%
-
When emailing photos I get an error message 10665?
When emailing photos I get an error message 10665?