[jboss-user] [Installation, Configuration & Deployment] - Can't access env-entry

anukumar004 do-not-reply at jboss.com
Wed Dec 2 02:12:32 EST 2009


Hi, 

I am using jboss-4.2.3.GA on solaris. I created a simple client.war application which tries to access an env-entry. I get the following error - 

2009-12-02 00:08:24,358 INFO  [STDOUT] ======================================================
2009-12-02 00:08:24,360 INFO  [STDOUT]  
2009-12-02 00:08:24,360 INFO  [STDOUT] == Configuration Failure ==
2009-12-02 00:08:24,361 INFO  [STDOUT]  
2009-12-02 00:08:24,361 INFO  [STDOUT] PropertiesManager(): Could not find java:comp/env/tapestry/property_file setting
2009-12-02 00:08:24,361 INFO  [STDOUT] which is the variable that tells the framework where to find the properties file.
2009-12-02 00:08:24,361 INFO  [STDOUT]  
2009-12-02 00:08:24,361 INFO  [STDOUT] ======================================================

The code is as follows

client.jsp
%@page contentType="text/html"
 import="java.util.*,javax.naming.*"
 %>
 <%
  String propertiesFile="";
  
            try
          {        
            Context initContext = new InitialContext();
            propertiesFile=(String)initContext.lookup("java:comp/env/tapestry/property_file");
          }
          catch(Exception e)
          {
            System.out.println("======================================================");
            System.out.println(" ");
            System.out.println("== Configuration Failure ==");
            System.out.println(" ");
            System.out.println("PropertiesManager(): Could not find java:comp/env/tapestry/property_file setting");
            System.out.println("which is the variable that tells the framework where to find the properties file.");
            System.out.println(" ");
            System.out.println("======================================================");
          }

  out.println(propertiesFile);
%>

WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
         <env-entry>
          Path to config file
          <env-entry-name>tapestry/property_file</env-entry-name>
          <env-entry-value>/project/WORK/Web-gui/config/sm.properties</env-entry-value>
          <env-entry-type>java.lang.String</env-entry-type>
        </env-entry>
</web-app>


jndi tree
java:comp namespace of the client.war application:
  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)


When I deploy client.war on the jboss-4.2.3.GA running on windows, the application runs fine. Can someone please help me with this ?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268418#4268418

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268418



More information about the jboss-user mailing list