Bug in lookup of web.xml env-entry in WL 7.0?
If I create an "env-entry" block for a name (e.g. "MySchemaName") in my web.xml
file and deploy the web app, I should be able to look up the name from my webapp
with the line:
<br>
myInitialContext.lookup("java:comp/env/MySchemaName");
<br>
However when I do that I get the error message:
<br>
javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
<br>
Note that the "comp/env" prefix has been changed to "comp.env". This worked under
WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or both or
something else altogether?
The immediately previous line successfully performs an EJBHome lookup using the
same Initial Context object. The main difference is that the EJBHome name is defined
thru the EJB deployment descriptors, not the web.xml.
Thanks,
Steve
Ah, I was trying to do a lookup from session bean for the env-entry defined in
the web.xml. After reading the J2EE spec, I see this just won't work. env-entries
are only accessible from within the component where they are defined.
Still the error message with "comp.env" instead of the expected "comp/env" is
a bit confusing.
Not much traffic in this newsgroup, is there?
Steve
"Steve Ditlinger" <[email protected]> wrote:
>
>
>
If I create an "env-entry" block for a name (e.g. "MySchemaName") in
my web.xml
file and deploy the web app, I should be able to look up the name from
my webapp
with the line:
<br>
myInitialContext.lookup("java:comp/env/MySchemaName");
<br>
However when I do that I get the error message:
<br>
javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
<br>
Note that the "comp/env" prefix has been changed to "comp.env". This
worked under
WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or
both or
something else altogether?
The immediately previous line successfully performs an EJBHome lookup
using the
same Initial Context object. The main difference is that the EJBHome
name is defined
thru the EJB deployment descriptors, not the web.xml.
Thanks,
Steve
Similar Messages
-
Hi,
When I use j2eeappreg.bat to deploy application, I got the following error:
Connected to LDAP server on BJI02 port 389
java.lang.IllegalStateException: internal assert: why is web.xml jar entry
null?
at com.kivasoft.util.Debug.assert(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unkno
wn Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
java.lang.IllegalStateException: internal assert: why is web.xml jar entry
null?
at com.kivasoft.util.Debug.assert(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unkno
wn Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
com.netscape.server.deployment.ApplicationXmlException: cannot parse
correspondi
ng web app xml file!
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unkno
wn Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unk
nown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
j2eeappreg done.
Anybody can help? Thanks!
BinHi,
Please let me know the version & O/S of iAS including the web server name &
version and if it is installed on same machine or different machine.
Regards
Raj
Bin Ji wrote:
Hi,
When I use j2eeappreg.bat to deploy application, I got the following error:
Connected to LDAP server on BJI02 port 389
java.lang.IllegalStateException: internal assert: why is web.xml jar entry
null?
at com.kivasoft.util.Debug.assert(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unknown Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
java.lang.IllegalStateException: internal assert: why is web.xml jar entry
null?
at com.kivasoft.util.Debug.assert(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unknown Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
com.netscape.server.deployment.ApplicationXmlException: cannot parse
corresponding web app xml file!
at com.netscape.server.deployment.ApplicationXmlUtil.handleModules
(Unknown Source)
at
com.netscape.server.deployment.ApplicationXmlUtil.parseApplicationFro
mDOM(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.ApplicationXmlUtil.xmlToDescriptor
(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.run(Unknown Source)
at com.netscape.server.deployment.J2eeAppReg.main(Unknown Source)
j2eeappreg done.
Anybody can help? Thanks!
Bin -
Env-entry problem in Pluto portal
I have portlet project. I wrote in web.xml:
<env-entry>
<env-entry-name>time_interval</env-entry-name>
<env-entry-value>5</env-entry-value>
<env-entry-type>java.lang.Long</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>file_path</env-entry-name>
<env-entry-value>d:\tmp</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
I get following error during deploying portlet:
12:21:30,588 INFO [Engine]
StandardContext[pluto]PortletDefinitionRegistryService initializing...
12:21:32,561 ERROR [Engine] StandardContext[pluto]ServiceManager: An
unidentified error occurred
ValidationException: element "env-entry" occurs more than once.
(XMLFieldDesciptor: envEntry AS env-entry)
at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
730)
But when I put only one env-entry in web.xml, it works perfectly.
Does any solution exist for adding more than one env-entry?I have portlet project. I wrote in web.xml:
<env-entry>
<env-entry-name>time_interval</env-entry-name>
<env-entry-value>5</env-entry-value>
<env-entry-type>java.lang.Long</env-entry-type>
</env-entry>
<env-entry>
<env-entry-name>file_path</env-entry-name>
<env-entry-value>d:\tmp</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
I get following error during deploying portlet:
12:21:30,588 INFO [Engine]
StandardContext[pluto]PortletDefinitionRegistryService initializing...
12:21:32,561 ERROR [Engine] StandardContext[pluto]ServiceManager: An
unidentified error occurred
ValidationException: element "env-entry" occurs more than once.
(XMLFieldDesciptor: envEntry AS env-entry)
at
org.exolab.castor.xml.UnmarshalHandler.endElement(UnmarshalHandler.java:
730)
But when I put only one env-entry in web.xml, it works perfectly.
Does any solution exist for adding more than one env-entry? -
@Resource and env-entry
I used the JSF2 GuessNumber example as the basis for my project. I'm running a simple JSF2 application (my first, although I'm very familiar with JSF1) on Tomcat 7.0.16.
I have the following bean:
@ManagedBean
@SessionScoped
public class ConfigBean {
@Resource
private String dataDirectory;
public String getDataDirectory() {
return dataDirectory;
public void setDataDirectory(String dataDirectory) {
this.dataDirectory = dataDirectory;
}I want to access the data directory property in a .xhtml file as follows:
#{configBean.dataDirectory}To populate the property, I have the following in web.xml:
<env-entry>
<env-entry-name>dataDirectory</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>D:\Users\kdean\projects\DemoJSF2\data</env-entry-value>
</env-entry>I put a breakpoint in getDataDirectory() to confirm that it's being called (it is) but the value is always null.
What am I missing? Thanks.Hi,
JDeveloper 10.1.3 is using JEE 1.4, not JEE 1.5. JDeveloper 11 would be the build to use and I am currently testing if it works in here
Frank -
Validation error when using env-entry in web.xml
I've added an env-entry element to my web.xml and it falls over at deploy time with a validation error. However, from what I can see, this is valid based on the schema.
And infact, it matches the example in the weblogic doco - http://edocs.bea.com/wls/docs103/webapp/web_xml.html#wp1025195
The error I'm getting is:
<17/12/2008 11:45:56 AM EST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\workspace\source_checkout\investment_control\ic-web\src\main\webapp/WEB-INF/web.xml of module ic-web.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'mapped-name@http://java.sun.com/xml/ns/javaee injection-target@http://java.sun.com/xml/ns/javaee' instead of 'env-entry-type@http://java.sun.com/xml/ns/javaee' here in element env-entry@http://java.sun.com/xml/ns/javaee:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
My web.xml looks like:
<web-app 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/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<description>IC Web</description>
<env-entry>
<env-entry-name>aEntry</env-entry-name>
<env-entry-value>aValue</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
</web-app>
Any suggestions???Found a resolution to this in the end.
Unless you have the sub-elements in the order below, it will get validation errors.
<env-entry>
<env-entry-name>maxAmount</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>aString</env-entry-value>
</env-entry>
A bit weird and very frustrating.... -
[svn] 1616: Remove stale security constraint entries in the sample web.xml
Revision: 1616
Author: [email protected]
Date: 2008-05-08 08:11:40 -0700 (Thu, 08 May 2008)
Log Message:
Remove stale security constraint entries in the sample web.xml
Bugs: BLZ-162: samples web.xml contains unreferenced security constraint
QA: yes
Ticket Links:
http://bugs.adobe.com/jira/browse/BLZ-162
Modified Paths:
blazeds/branches/3.0.x/apps/samples/WEB-INF/web.xmlThis goes in your ejb-jar.xml file
<assembly-descriptor>
<method-permission>
<description></description>
<role-name>yourRole</role-name>
<method>
<ejb-name>YourEJB</ejb-name>
<method-name>findByYourFinder</method-name>
</method>
</method-permission>
</assembly-descriptor>
"Kven" <[email protected]> wrote in message
news:[email protected]..
Hello
Can anyone provide a sample web.xml file with "security-constraint" tag
included in it.
I have the RDBMS Realm set up and it seems to be working fine with
servlets. I need to test with EJBs, dont know how to proceed.
Any help is appretiated.
Thanks
K -
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 -
How do you 'configure' a Workshop application?
The normal way to do this in J2EE is to add environment entries in web.xml,
ejb-jar.xml or even application.xml.
In Workshop there is only web.xml. And when deploying as an EAR file, it
gets packaged in a WAR file, not inside the JAR file of the Web Service. So
you can't just look up a web.xml environment entry from your jws file.
=======
Another question: why is web.xml and weblogic.xml available in Workshop in
the first place? What can you do with these files? I don't see how they can
be useful to the developers.
Since all the 'plumbing' of Web Services is hidden inside Workshop anyway, I
think they should remain hidden too. Or if they are useful, then I think we
should be able to see the other deployment descriptors (the WebServices's
(ejb-jar.xml) and the EAR's (application.xml)).
Even better, how about some new categories under the project's properties,
called 'descriptors'. Hide all that XML and show it graphically. Don't allow
modifying what is the guts of the system, it's error-prone.
Thanks,
Emmanuel ProulxThanks for the details, Emmanuel. I'm sure that our Product Management team
will be interested in your feedback.
Ian M. Goldstein
Developer Relations Engineer
BEA Systems, Inc.
"Emmanuel Proulx" <[email protected]> wrote in message
news:[email protected]...
Ian, group,
Unfortunately, I'm going to answer your first question with a question
(since we're in Beta, let's think of this as an opportunity for us tolearn
from each other): What kinds of "configuration" do you want to do to
your
Workshop application? What types of environment entries are youinterested
in adding to the deployment descriptors?J2EE defines the environment entries as a way to set up an application
without modifying the code. You just look up the environment entry and you
get a value that you can use in the code. This modifies the behavior ofyour
code without having to change it. It's like an OS environment variable.
Examples:
- Debug Flag
- Currency Symbol
- Location of temp folder
- Location of a resource (although ther are resource references for that,a
special kind of environment entry), like JDBC datasource, JMS conn.factory,
EJB reference (using ejb-refs), etc.
You can change any of those in the XML file and you don't have torecompile.
This is very very useful, in particular when switching an application froma
development to a production box. The debug flag should be turned off, the
temp folder is different, the datasource should point to the production
database, etc.
Currently if you want to configure a Workshop application in this way, you
have to modify the project and recompile. This can introduce problems when
deploying to the production server.
I suggest we add a new category in the project properties (right pane)like
this:
+ target-namespace
+ schema
- configuration
- environment
debugFlag java.lang.Boolean true
currency java.lang.Char $
temp String c:/temp
- resource references
databaseDS javax.sql.DataSource Container DS-JNDI-Name
Shareable
- EJB references
EJB1 Session EJB-JNDI-Name EJBHome EJBRemote EJBName
(ejb-link)
- EJB local references
EJB1 Session Local-EJB-JNDI-Name EJBLocalHome EJBLocal
EJBName (ejb-link)
These should be saved in application.xml at the time of deployment. The
references should be available as a choice in the various controls. E.g.for
the database control, any Datasource reference should appear in thecreation
dialog and properties.
NOTE: The above comes from what I saw in Weblogic Builder. But somethingis
missing from WebLogic Builder: either <resource-ref> or <resource-env-ref>
is not listed.
More 0.02$.
Talk to you soon,
Emmanuel
As for your second question, I agree that exposing the web.xml and
weblogic.xml in the project tree does in fact suggest that developers
may
want to edit them. I'll bring that feedback to our development team.Thanks!
Your suggestion about providing a graphical editor for modifyingdeployment
descriptors is something that the WebLogic Server development team feels
pretty strongly about, too -- check out WebLogic Builder
(http://e-docs.bea.com/wls/docs70/wlbuilder/WebLogicBuilder.html),
included
in the WebLogic Platform 7.0 beta. Of course, you don't need to go thatdeep
into application deployment descriptors to build and deploy your
applications with WebLogic Workshop. (In fact, you don't even need to
know
what a deployment descriptor is to successfully deploy web services you
develop with WebLogic Workshop.)
Cheers!
Ian M. Goldstein
Developer Relations Engineer
BEA Systems, Inc.
"Emmanuel Proulx" <[email protected]> wrote in message
news:[email protected]...
How do you 'configure' a Workshop application?
The normal way to do this in J2EE is to add environment entries inweb.xml,
ejb-jar.xml or even application.xml.
In Workshop there is only web.xml. And when deploying as an EAR file,
it
gets packaged in a WAR file, not inside the JAR file of the WebService.
So
you can't just look up a web.xml environment entry from your jws file.
=======
Another question: why is web.xml and weblogic.xml available in
Workshop
in
the first place? What can you do with these files? I don't see how
they
can
be useful to the developers.
Since all the 'plumbing' of Web Services is hidden inside Workshop
anyway,
I
think they should remain hidden too. Or if they are useful, then I
think
we
should be able to see the other deployment descriptors (the
WebServices's
(ejb-jar.xml) and the EAR's (application.xml)).
Even better, how about some new categories under the project'sproperties,
called 'descriptors'. Hide all that XML and show it graphically. Don'tallow
modifying what is the guts of the system, it's error-prone.
Thanks,
Emmanuel Proulx -
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 -
Using error code in web.xml
hi I have following servlet ..
sevlet :
PrintWriter out = res.getWriter();
out.println("<p>I will throw a ServletEexception now....</p>");
//res.sendError(404, "messagge");
In the above code res.sendError(404, "messagge"); is commented and i get the result as expected, when i call above servlet.
After that i un-comment res.sendError(404, "messagge"); and get error.jsp, since web.xml contains :
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
But if i open a different browser and access the above servlet , then i am getting The page cannot be found.
I am getting the following stack trace(sun app server) :
[#|2006-06-18T17:12:30.593-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=61;|
NotifyUtil::java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:525)
at com.sun.enterprise.server.ss.ASClientSocketImpl.connect(ASClientSocketImpl.java:175)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:237)
|#]
[#|2006-06-18T17:12:31.593-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=62;|
NotifyUtil::java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:525)
at com.sun.enterprise.server.ss.ASClientSocketImpl.connect(ASClientSocketImpl.java:175)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:237)
|#]---------------------------------------------------------------
I have tried the same in Tomcat 5 and i am still getting similar problem.
Any help will be appreciated
Message was edited by:
java_do_proHi my web.xml error entry looks like
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
Want I want to do is that is user asks for WEB_URL/anypage.jsp or anypage.html
and if the page does not exist in the web application then the control shall be transfered to the jsp page which will display the error details (and do some processing as well)
hth,
Asif -
Admin UI for editing environment entries (i.e. env-entry in web.xml)
Hi there,
just wanted to know if Weblogic nowadays features a UI for post-deployment editing of environment entries such as the ones declared via <env-entry> in web.xml ( [http://download.oracle.com/docs/cd/E21764_01/web.1111/e13712/web_xml.htm#autoId30] ). So far, I'm using a deployment plan to re-configure these things at the time of each deployment, which works but which is also probably not the most flexible solution.
Thanks in advance,
ChrisAh, I was trying to do a lookup from session bean for the env-entry defined in
the web.xml. After reading the J2EE spec, I see this just won't work. env-entries
are only accessible from within the component where they are defined.
Still the error message with "comp.env" instead of the expected "comp/env" is
a bit confusing.
Not much traffic in this newsgroup, is there?
Steve
"Steve Ditlinger" <[email protected]> wrote:
>
>
>
If I create an "env-entry" block for a name (e.g. "MySchemaName") in
my web.xml
file and deploy the web app, I should be able to look up the name from
my webapp
with the line:
<br>
myInitialContext.lookup("java:comp/env/MySchemaName");
<br>
However when I do that I get the error message:
<br>
javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
<br>
Note that the "comp/env" prefix has been changed to "comp.env". This
worked under
WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or
both or
something else altogether?
The immediately previous line successfully performs an EJBHome lookup
using the
same Initial Context object. The main difference is that the EJBHome
name is defined
thru the EJB deployment descriptors, not the web.xml.
Thanks,
Steve -
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 -
Env-entry in web.xml and 6.0 sp4
Does anyone know if iws 6.0 sp4 supports env-entry elements in web.xml???
According to servlet specs 2.2 it should support it since it has JSP support.
From 2.3 specs:
"The following addtional elements exist in the web application deployment
descriptor to meet the requirements of web containers that are JSP enabled or part
of a J2EE application server. They are not required to be supported by containers
wishing to support only the servlet specification.:
� taglib
� syntax for looking up JNDI objects (env-entry, ejb-ref, ejb-local-ref, resourceref,
resource-env-ref)
See the DTD comments for further description of these elements."Additional info...actually the code throws a NamingException.
-
Edit env-entry values from web.xml in the WLS console.
Hi guys!
Is it possible to define JNDI variables of type java.lang.String using WLS Console?
ThanksI think this would require the use of a deployment plan, which you can learn about here: [http://e-docs.bea.com/wls/docs103/deployment/config.html] . This won't be as convenient as just editing the value directly in the admin console. In fact, it won't even prevent the requirement of redeploying the webapp. It will only allow you to make the change without rebuilding and repackaging the webapp.
It's questionable whether it's practical or meaningful to change env-entry values in a web.xml without redeployment, because even if you could change the values without redeploying, you'd have to reinitialize the servlet/filter with the changed environment parameter.
If you really need this dynamic reconfiguration ability, you might have to design the facility into your application, using some sort of polling or event handling capability. -
Move env-entry from web.xml into deployment plan
I have:
<env-entry>
<env-entry-name>USERNAME</env-entry-name>
<env-entry-value>someUser</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
and I'd like to move it from web.xml into my_app_plan.dat. Is it possible? How?
Thank you in advance!Let me describe my case in few more words...
I have some kind of client-server app. Clients have OC4J installed and they download myApp.ear and myApp_plan.dat files and by using script (Windows CMD batch file) clients install those files with admin_client.jar, OC4J's admin utility. The problem is that I have 2 different types of clients and I have client specific settings set in web.xml file and each time I compile myApp.ear I have to uncomment/comment some lines in web.xml.
So, to make a long story short, I need a way to deploy those settings separated from (outside of) myApp.ear. By following you link, I have read that orion-web.xml should reside inside WEB-INF folder of myApp.ear, which is not good for me.
Maybe you are looking for
-
TS1550 Unable to complete backup. An error occurred while creating the backup folder.
Running OS X 10.8.5 Trying to backup to Passport Time machine. Has worked fine until a few days ago. Don't want to tinker too much as am not that savvy. TIA for any help. Di
-
Center text in Datagrid columns
Hi all, I need help vertically centering text in a datagrid column. Does anyone know of a way to do this without custom item Renderers?
-
Setting required to process incomming Email with CSV file attached
Dear all, We are having a scenario where in the supplier receives a PO confirmation CSV file from the download center as an Email attachment. The supplier updates the file by confirming PO's and replies back. The CSV file needs to update the confirme
-
Hi, I have the HP DV6-3126sa with built in Altec Lansing speakers. The problem is when im listening to stuff say on YouTube, when it hits a certain pitch it starts to buzz/whistle. I have tried playing around with the Sound Control settings in Equali
-
Applets in IE7 Protected mode ON is not writing files in %APPDATA% folder.
It seems like applets are having less permission to access files in IE7 running on Windows Vista. It is even stricter in Protected mode On. We have couple of applets which write files in %APPDATA% folder under a particular directory. This was not wor