Java property file in web.xml?

I'm having trouble getting a web app to work resonably closely to how I expect:
I have a property file that is accessed by the package of java classes ( under
WEB-INF/classes). In the classes ( package com.th.lifeinsruance ) i have a property
file which is referenced in the java code as com.th.lifeinsurance.xx.properties.
It seems the only place that wl6.0 is prepared to look for this property file
is under the /weblogic6.0 dir ( i.e totally outside the web app!!). I would guess
that I'm supposed to register this property file in web.xml for the app however
the only examples refer to DataSources and so on ( to set a resource). Is this
correct? Does someone have an example of a java property file being read correctly
in its package with the .class files?
Many Thanks
Mark

I've some other solution for the same problem which is working fine for me.
1) make a jar file only consisting of the properties file
jar -cvf DescriptionBundle.jar  DescriptionBundle.properties
2) copy the jar file to the /dist/Portal-inf/lib folder
3) Use the following code to get the ResourceBundle
Locale locale = null;
Locale locale = null;
locale = Locale.US;
servletReq.getSession().setAttribute("myLocale", locale);
ResourceBundle bundle = ResourceBundle.getBundle("DescriptionBundle", locale);
if (bundle == null) {
     logger.warning("bundle is null");
for (Enumeration e = bundle.getKeys(); e.hasMoreElements();) {
     String key = (String) e.nextElement();
     String s = bundle.getString(key);
     servletReq.getSession().setAttribute(key, s);
     logger.info("Key is" + key + "value is" + s);
This solution doesn't suit  the title of the topic but is another way to access the properties files.

Similar Messages

  • Include another xml file in web.xml

    I was able to use XML Entity to include another xml file in web.xml for older servlet specifications, i.e.:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" [
      <!ENTITY my-web SYSTEM "my-web.xml">
    ]>
    <web-app>
      &my-web;
    </web-app>This allows me to share my-web.xml among various web applications.
    How do I achieve the same thing for servlet specification 2.5, which does not have a DTD but rather an XSD?
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      id="WebApp_ID" version="2.5">I am using Glassfish V2UR1. I know about $domain-dir/config/default-web.xml, but for reasons I won't get into I cannot put things in there.

    Hi Maksim. I understood that. It's just that I would prefer some method that doesn't require the developers to do something like extracting a file from the EAR file, changing the file and then putting it back in. As you probably know, some developers could handle it and some will most certainly make mistakes.
    When they do they come to my group and say "my app doesn't work" and then we have to spend time figuring out why.
    Plus, once the developers get used to doing things the automated way they're going to have a hard time remembering to do a manual step each time they do a build.
    I have heard that there may be some way to do something similar to this on Visual Administrator. I'm going to investigate that too.
    Thanks!
    David.

  • How to chage the welcome file in web.xml using creator?

    Hi guys,
    I want to set the welcome file in web.xml to index.html but every time I run my project in creator, creator replaces index.html by faces/index.jsp. I need the index.html to check if the browser enables cookies & javascript and then I redirect to index.jsp. If I change the web.xml in a common editor, build the war-file with ant and deploy the project with tomcat, everything is fine. but how can I change it in creator?
    thanks in advance

    Sorry, that doesn't make much sense.
    The XML you gave is a configuration file for txt2xml utility. It doesn't represent the output format.
    Are you a user of this utility?

  • Use of jsp-file in web.xml

    hello
    can anybody explain about , when we need <jsp-file> in web.xml
    and why we use this tag in place of <url-pattern>?

    If you want to declare a JSP in your web.xml file you use the jsp-file tag instead of the servlet-class tag. Normally there is no need to declare a JSP in the web.xml file unless you want to use init-params.
    Usually people can access a JSP directly wether it is declared in the web.xml or not. So it is not that the jsp-file tag replaces the url-pattern tag so much as the url-pattern tag is not needed for a JSP. However notthing prevents you from declaring the JSP in the web.xml and then mapping the JSP to a different url that doesn't end in '.jsp'.

  • How to read configuration data from an xml file (not web.xml)?

    Hi,
    I want to separate the application specific configuration parameters in a separate xml file and read them as and when they are needed? I know that I can use the wb.xml but I want to separate them in a different xml file because I don't want the web.xml file to be played around later after deployment. If any change is needed then it should be done in the application-config.xml.
    How can I read the parameters from this xml file in my jsp code and also what should be the location of this file if I have
    ../webapps/Root/application
    directoty structure ?
    Any help is greatly appreciated.

    can you give an example of a property file and also
    it is loaded in the jsp ?Hmm... loading properties in a JSP is not a very good idea. You should do it in a separate class, rather than mixing the logic with the display logic.
    Properties properties = new Properties();
    properties.load(UtilClass.class.getResourceAsStream("config.properties"));
    // Add a try - catch block around the load
    // for IOException...

  • Welcome File in Web.xml

              I am having problems with my web.xml file.
              I have my welcome page <welcome-file> as my “home_page.jsp” which I want to be
              the default page on start-up. On this page is a link to “log on”. When you click
              on this you are taken to my (FORM) “Login.jsp”. After successful logon I want
              to go to the “Welcome.jsp”, instead I am returned to my “home_page.jsp”. Which
              puts me in a continuous loop. How after successful logon can I be directed to
              a page other than the <welcome-file> “home_page.jsp”
              My web.xml file looks like this;
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <welcome-file-list>
              <welcome-file>Welcome.jsp</welcome-file>
              </welcome-file-list>
              <login-config>
              <auth-method>FORM</auth-method>
              <realm-name>default</realm-name>
              <form-login-config>
                   <form-login-page>/Login.jsp</form-login-page>
                   <form-error-page>/LoginFailure.jsp</form-error-page>
              </form-login-config>
              </login-config>
              <security-role>
              <role-name>web-user</role-name>
              </security-role>
              <security-constraint>
              <web-resource-collection>
              <web-resource-name>Logged into NOTiFY</web-resource-name>
              <url-pattern>/Welcome.jsp</url-pattern>
              <http-method>GET</http-method>
              <http-method>POST</http-method>
              </web-resource-collection>
              <auth-constraint>
              <role-name>web-user</role-name>
              </auth-constraint>
              </security-constraint>
              </web-app>
              Thanks.
              

    It doesn't quite work that way. You should just direct the user directly to
              the Welcome.jsp page. If they're not already logged in, they'll be asked to
              log-in via the Login.jsp. The login mechanism knows to redirect them to the
              last page they wanted once they successfully log in. I think this is why you
              are being returned to the home_page.jsp, since there was no target
              restricted page requested.
              I have to admit - this mechanism doesn't lend itself to the portal-style
              login used on the web. It's geared more towards security and authorization
              for access to particular URL resources. You might need to tweak how your GUI
              looks to make this mechanism make sense.
              Alternatively, you could add some code to the home_page.jsp to redirect the
              user to a specific restricted page based on what is in their session. I
              would also suggest that the Welcome.jsp and home_page.jsp be the same page
              that just behaves differently based upon whether a user is logged in or not.
              "Roger Lee" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I am having problems with my web.xml file.
              >
              > I have my welcome page <welcome-file> as my "home_page.jsp" which I want
              to be
              > the default page on start-up. On this page is a link to "log on". When you
              click
              > on this you are taken to my (FORM) "Login.jsp". After successful logon I
              want
              > to go to the "Welcome.jsp", instead I am returned to my "home_page.jsp".
              Which
              > puts me in a continuous loop. How after successful logon can I be directed
              to
              > a page other than the <welcome-file> "home_page.jsp"
              >
              > My web.xml file looks like this;
              >
              > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              2.2//EN"
              > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              >
              > <web-app>
              >
              > <welcome-file-list>
              > <welcome-file>Welcome.jsp</welcome-file>
              > </welcome-file-list>
              >
              > <login-config>
              > <auth-method>FORM</auth-method>
              > <realm-name>default</realm-name>
              > <form-login-config>
              > <form-login-page>/Login.jsp</form-login-page>
              > <form-error-page>/LoginFailure.jsp</form-error-page>
              > </form-login-config>
              > </login-config>
              >
              > <security-role>
              > <role-name>web-user</role-name>
              > </security-role>
              >
              > <security-constraint>
              > <web-resource-collection>
              > <web-resource-name>Logged into NOTiFY</web-resource-name>
              > <url-pattern>/Welcome.jsp</url-pattern>
              > <http-method>GET</http-method>
              > <http-method>POST</http-method>
              > </web-resource-collection>
              > <auth-constraint>
              > <role-name>web-user</role-name>
              > </auth-constraint>
              > </security-constraint>
              >
              > </web-app>
              >
              > Thanks.
              >
              

  • How to run java servlet without using Web.xml?

    How to run servlet without using Web.xml? From a book, I know that web.xml descriptor is optional, but the book doesn't tell us how to run java servelet without web.xm descriptor. So how to do that? Thanks a lot.

    How to run servlet without using Web.xml?But Tomcat now uses a web.xml for its global server-wide configuration.
    If you'd like to invoke a servlet with:
    http://host/servlet/ServletName
    you have to enable the invoker servlet.
    [from an HTML]
      <FORM METHOD="POST" ACTION="/servlet/HGrepSearchSJ">
    [from resin.conf of Resin Web Server 2.1.12]
      <!--
         - The "invoker" servlet invokes servlet classes from the URL.
         - /examples/basic/servlet/HelloServlet will start the HelloServlet
         - class.  In general, the invoker should only be used
         - for development, not on a deployment server, because it might
         - leave open security holes.
        -->
      <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
    [from TOMCAT5.0.19/conf/web.xml, a global server-wide web.xml file]
      <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
      <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
      <!-- servlet is mapped to URL pattern "/servlet/*", but you can map it    -->
      <!-- to other patterns as well.  The extra path info portion of such a    -->
      <!-- request must be the fully qualified class name of a Java class that  -->
      <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
      <!-- of an existing servlet definition.     This servlet supports the     -->
      <!-- following initialization parameters (default values are in square    -->
      <!-- brackets):                                                           -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->
        <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
    ---comment out below----------------------------------------------------------
        <!-- The mapping for the invoker servlet -->
    <!--
        <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>
    -->

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Cannot find JSP file through web.xml

    Content of a.jsp
    function Thisthing (id, name) {
    this.id = id;
    this.descr = name;
    I want to access a.jsp from b.jsp. like
    <script type="text/javascript" src="a.js"></script>
    I have web.xml content
    <servlet>
    <servlet-name>DomainObjectis</servlet-name>
    <jsp-file>/a.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>DomainObjectis</servlet-name>
    <url-pattern>*.js</url-pattern>
    </servlet-mapping>
    However its showing me an error -> .Thisthing undefined whenever I run this in Tomcat 5.5.
    I appears its not finding my a.jsp file. It's working fine when I do
    <%@ include file="a.jsp" %>

    thanks for replying jgalacambra.
    I have deployed several web applications before. But this is the first one where I am trying to include a JSP file as a javascript.
    tomcat recognizes when I simply including the jsp file with import but when I try to include it as a script it's not working. So I am hoping that there are some experts here who can help me. I saw this being done in a project and am trying to build a similar web application myself.

  • Trouble with war file contianing web.xml

    I have a problem with my ISP. I have to send a war file to upload my files. It includes my web.xml file, but it seems that it's ignored when i visit my site. Can somebody help me with this. When I run the web.xml file on my own computer it works fine.
    I create my war file at the moment with the command jar cvf name.war -C d:\directory .
    It also look like a good deploy of the site because everything gets into the right please.
    Tnx for the help already

    Well when I go to my site and I go into my small Content Management System I press a button and it should call on a page under de alias admintool. In my web.xml file it will redirect the request to the proper class file. This doesn't work. I also add a form-login-page option into my web.xml file. So that when I call on a page it should redirect to a login screen. But that doesn't work also. It doesn't redirect, it's goes straight to the page that should be secure.

  • How to configure the property file

    Is this the correct way of configuring the property file in web.xml.
    <servlet>
    <servlet-name>ControllerServlet</servlet-name>
    <servlet-class>com.test.prod.pds.Controller</servlet-class>
    <init-param>
    <param-name>LOGINID</param-name>
    <param-value>C:\bea\user_projects\domains\mydomain\applications\TestWebApp\WEB-INF\classes\loginid.properties</param-value>
    <description>Pds Group properties file</description>
    </init-param>
    </servlet>
    IT is giving an error "javax.servlet.ServletException: loginid.properties (The system cannot find the file specified)"

    Hi,
    Place that properties file in the application classpath Then it will work fine without any problems.
    Go through the follwing links,In that you will get usefull information on this.
    http://jtidy.sourceforge.net/multiproject/jtidyservlet/configuration.html
    http://www.utdallas.edu/~baughman/velocity4.html
    Regards
    Anilkumar kari

  • How to use dynamic file as welcome-file-list in web.xml

    I have configured my web.xml file as this,
    <web-app>
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>login.jsf</welcome-file>
    </welcome-file-list>
    </web-app>
    and my login.xhtml file as this,
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core">
    <body>
    <f:view>
    <h:form>
    UserName:<h:inputText id="userName"
    value="#{bean.userName}" rendered="true"
    required="true"/>
    Password:<h:inputText id="password"
    value="#{bean.password}" rendered="true"
    required="true"/>
    <h:commandButton id="submit" value="Submit" action="#{bean.authenticate}" />
    </h:form>
    </f:view>
    </body>
    </html>
    but when i deploy this using tomcat and try to put url as this,
    http://localhost:8080/project
    Its not identifying welcome file from web.xml
    I am getting error like this,
    The requested resource (/project/) is not available.
    How to resolve this,
    Thanks,
    Vinutha

    This might help:
    http://forum.java.sun.com/thread.jspa?threadID=696586
    As well, you might have to change the servlet-mapping in your web.xml. The url-pattern, I think, needs to be .xhtml. Your login.jsf file in the welcome list will need to be renamed to login.xhtml.
    CowKing

  • SDK : web.xml file, what for ?

    Hello,
    I designed a new web service using the SDK, I noticed a file named web.xml, with some authority settings in it.
    What's the purpose of such file ? Is it to define which roles is required to be able to call a WS ?
    Thanks

    Thank Ivan, can you give me more details ?
    Here is my file content :
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>Extended Web Services</display-name>
         <login-config>
           <auth-method>BASIC</auth-method>
         </login-config>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>restricted methods</web-resource-name>
                   <url-pattern>/*</url-pattern>
                   <http-method>POST</http-method>
                   <http-method>GET</http-method>
              </web-resource-collection>
              <auth-constraint>
                   <role-name>Admin</role-name>
              </auth-constraint>
         </security-constraint>
    </web-app>
    What the purpose of the <role-name> node ? Is it referring a NW role needed to call WS ?

  • How to configure Java Properties File location in WLW

    How do we tell Workshop 7.0 where to look for Java properties files (loaded by
    PropertyResouceBundle in code) ?
    Thanks,
    Ray

    Ray,
    The build number indicates that you have not upgraded to Service Pack 2 of
    version 7.0. I will strongly recommend you to do so. That will shield you
    from the issues which were fixed in the 2 service packs.
    Regards,
    Anurag
    "Ray Yan" <[email protected]> wrote in message
    news:[email protected]...
    >
    Raj,
    We are using WebLogic Workshop Build 7.0.1.0.0829.0 on Windows 2000.
    We shut down the WebLogic Server on Solaris 2.6, log off, log back on,startWebLogic
    in production nodebug mode, and re-run jwsCompile on the same source code.The
    error does not occur anymore. Everything seems to be fine now.
    Thanks,
    Ray
    "Raj Alagumalai" <[email protected]> wrote:
    Hello Ray,
    Can you let me know if you are using the GA version of WebLogic Workshop
    or
    if you have the latest Service Pack.
    Thank You,
    Raj Alagumalai
    WebLogic Workshop Support
    "Ray Yan" <[email protected]> wrote in message
    news:[email protected]...
    Anurag:
    Thanks for your response!
    By moving the property files to WEB-INF/classes from WEB-INF, we arealmost there.
    But we have a follow up problem. We use a static initializer to loadthe
    log4j
    property file like this:
    static {
    try {
    ClassLoader cl= (new Log()).getClass().getClassLoader();
    InputStream is = cl.getResourceAsStream(logfile);
    Properties props = new Properties();
    props.load(is);
    PropertyConfigurator.configure(props);
    } catch (Exception e) {
    e.printStackTrace();
    When we run jwsCompile, we keep getting this:
    Compiling: com/****/TestWS.jws
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[weblogic.management.Admin
    may only be used on the Server ]
    at weblogic.management.Admin.getInstance(Admin.java:104)
    at
    weblogic.security.internal.ServerPrincipalValidatorImpl.getSecret(ServerPrin
    cipalValidatorImpl.java:79)
    at
    weblogic.security.internal.ServerPrincipalValidatorImpl.sign(ServerPrincipal
    ValidatorImpl.java:59)
    at
    weblogic.security.service.PrivilegedActions$SignPrincipalAction.run(Privileg
    edActions.java:70)
    at java.security.AccessController.doPrivileged(Native Method)
    at
    weblogic.security.service.SecurityServiceManager.createServerID(SecurityServ
    iceManager.java:1826)
    at
    weblogic.security.service.SecurityServiceManager.getServerID(SecurityService
    Manager.java:1839)
    at
    weblogic.security.service.SecurityServiceManager.sendASToWire(SecurityServic
    eManager.java:538)
    at
    weblogic.security.service.SecurityServiceManager.getCurrentSubjectForWire(Se
    curityServiceManager.java:1737)
    at weblogic.rjvm.RJVMImpl.getRequestStream(RJVMImpl.java:434)
    at
    weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:
    88)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :255)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :230)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown
    Source)
    atweblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
    atweblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
    at javax.naming.InitialContext.lookup(InitialContext.java:345)
    at weblogic.knex.bean.EJBGenerator$1.run(EJBGenerator.java:101)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    atweblogic.knex.bean.EJBGenerator.lookupAdminHome(EJBGenerator.java:84)
    atweblogic.knex.bean.EJBGenerator.ensureAdminHome(EJBGenerator.java:122)
    at weblogic.knex.bean.EJBGenerator$6.run(EJBGenerator.java:660)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:821)
    atweblogic.knex.bean.EJBGenerator.generateJar(EJBGenerator.java:482)
    at
    weblogic.knex.dispatcher.DispJar.generateJar(DispJar.java:401)
    atweblogic.knex.dispatcher.DispCache.ensureDispUnit(DispCache.java:695)
    atweblogic.knex.compiler.JwsCompile.compileJws(JwsCompile.java:872)
    at
    weblogic.knex.compiler.JwsCompile.compile(JwsCompile.java:619)
    at weblogic.knex.compiler.JwsCompile.main(JwsCompile.java:109)
    ejbc successful.
    Generating EAR ...
    The EAR was generated and we can even deploy it on Solaris. But whatdoes
    the
    AssertionError mean?
    Thanks,
    Ray
    "Anurag Pareek" <[email protected]> wrote:
    Ray,
    ResourceBundle looks for the properties file in the current thread's
    classpath.
    Since a Workshop webservice's project is nothing but a webapp, the
    properties files can be kept in the WEB-INF/classes directory, which
    is part
    of the webapp classpath.
    You can also use
    Thread.currentThread().getContextClassLoader().getResourceAsStream("MyProp
    s
    properties"); to get access to the properties file.
    Thanks,
    Anurag
    "Ray Yan" <[email protected]> wrote in message
    news:[email protected]...
    How do we tell Workshop 7.0 where to look for Java properties files(loaded by
    PropertyResouceBundle in code) ?
    Thanks,
    Ray

  • Setting up JNDI resources in web.xml only

    Hi,
    I'm using Tomca 4.0 LE and JDK 1.4.0_01.
    I've been using a database connection pool on my local machine by editing the server.xml file and web.xml. However, I need to move the webapp onto a web hosting compaines server (same tomcat and jdk version). I cannot edit the server.xml file, so I need to set up my JNDI resource in web.xml only.
    I have done this (in web.xml):
    <resource-ref>
          <res-ref-name>jdbc/ocb_clients</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref> Now, before when I had this all set up in web.xml, I had a list of <ResourceParams> within the <context> element:
    <ResourceParams name="jdbc/ocb_clients">
        <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <parameter>
         <name>username</name>
         <value>username_here</value>
        </parameter>
        <parameter>
         <name>password</name>
         <value>password_here</value>
        </parameter>          
        <parameter>
           <name>driverClassName</name>
           <value>org.gjt.mm.mysql.Driver</value>
        </parameter>       
        <parameter>
          <name>url</name>
          <value>jdbc:mysql://localhost:3306/ocb_clients</value>
        </parameter>
      </ResourceParams>These parameters are obviously needed for the datasource to work. How can I set these up just using web.xml?
    Also, this code is from a servlet that I have loading on tomcat startup. Will this still work with the new configuration?
    public void init() throws ServletException
         DataSource ds = null;       
         try
           //Set up the inital context
           Context ctx = new InitialContext();
           //Look up the database
           ds = (DataSource) ctx.lookup("java:comp/env/jdbc/ocb_clients");
         catch(NamingException nameE)
           System.err.println("Error looking up database: " + nameE);
         //Add the datasource to the application scope
         getServletContext().setAttribute("ocbDatabase", ds);
      }Any help is greatly appricated,
    Thanks, Mel.

    I am Having exactly the same problem with tomcat 5.0. I have tried to do everything mention as solutions at different fourums but I failed.
    BTW I am using MySQL
    Thanks
    Dibakar

Maybe you are looking for

  • Can't register (or see) a KOBO in ADE using Ubuntu

    Greetings and thanks in advance for any help.  I am running ADE through Wine in Ubuntu, and ADE works fine on my PC.  I have downloaded a DRM book that I bought and can see that fine on the PC.  When I connect my KOBO, however, the KOBO is not recogn

  • *****Standby light stays on on one monitor******

    I have a dual monitor set up but whe I shut down the standby LED of the additional monitor (both Apple Cinema Display) stays on, Any ideas why?

  • JMS persistance issue

    Hello All, We are using JDBC persistance for JMS store. We are seeing messages getting corrupted. The only option is to delete / empty tables and re-start. We cann't afford to delete or loose messages which effects our service credibility. Please not

  • How long should "Disk Repair" take?

    I have a G Raid 4 T external drive that I recently had shipped back from my editor. She did not use the original packing box and I fear the drive could be damaged. It starts up okay and doesn't make any suspicious noises - but it doesn't mount. I ran

  • [svn:fx-trunk] 5831: Fix bug Fix SDK-19800 FxButton doesnt resize itself to display all text when lineBreak == toFit

    Revision: 5831 Author: [email protected] Date: 2009-03-31 16:50:47 -0700 (Tue, 31 Mar 2009) Log Message: Fix bug Fix SDK-19800 FxButton doesnt resize itself to display all text when lineBreak == toFit Fix: implement text reflow support for TextGraphi