You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Roman Sokolyuk <ro...@gmail.com> on 2010/01/14 00:29:44 UTC

Mapping properties file

Tomcat 6.0
Windows Vista
Java 6

Hi,

I am trying to migrate a web app from a different web server to Tomcat and I
am running into a problem - it depends on a properties file.
In the previous server the file was mapped in the configuration file for the
container in an <env-entry>
For Tomcat I put the following in server.xml

<Environment
        name="my.properties"
        type="java.lang.String"
        value="C:/.../my.properties" />

But still I get the following exception:

javax.naming.NameNotFoundException: Name my.properties is not bound in this
Context
    at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at com.ewomp.q4.JavaQ4UtilFunc.getProperties(JavaQ4UtilFunc.java:2160)
    at
com.ewomp.q4.NgsDataSource.getConnectionWOContext(NgsDataSource.java:262)
    at com.ewomp.q4.NgsDataSource.getConnection(NgsDataSource.java:176)
    at com.ewomp.q4.PartnerClass.select(PartnerClass.java:1371)
    at com.ewomp.q4.PartnerClass.<init>(PartnerClass.java:1028)
    at com.ewomp.q4.PartnerClass.hasPartner(PartnerClass.java:763)
    at org.apache.jsp.main_jsp._jspService(main_jsp.java:95)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Unknown Source)

RE: Mapping properties file

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Roman Sokolyuk [mailto:romsok.tech@gmail.com]
> Subject: Mapping properties file
> 
> For Tomcat I put the following in server.xml
> <Environment
>         name="my.properties"
>         type="java.lang.String"
>         value="C:/.../my.properties" />

Where exactly did you place the above (show us your complete server.xml file)?  Note that it's extremely bad practice to place <Context> elements in server.xml, and <Environment> must be nested inside a <Context>.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org