geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vojdan_ <vojdan_karda...@yahoo.com>
Subject Re: Standalone deployment <cross-context> doesn't work
Date Wed, 22 Jul 2009 11:58:18 GMT

Init.java:
public void init(ServletConfig arg0) throws ServletException {
...........
      inputStream = ctx.getResourceAsStream("/file.properties");
      Utf8Properties utf8Properties = new Utf8Properties();
      utf8Properties.load(inputStream);
      ApplicationProperties applicationProperties = new
ApplicationProperties();
      ApplicationProperties.set(utf8Properties);
      // let the environment know about the new application properties
      Environment.setApplicationProperties(applicationProperties );
}


public class Environment {
private static ApplicationProperties applicationProperties;

public static void setApplicationProperties (ApplicationProperties
applicationProperties) {
		 Environment.applicationProperties = applicationProperties;
                 //here I print ot confirm it is intialized
		 System.out.println("set application properties: " +
Environment.applicationProperties.getCtxDesign());                 
}

public static String getDesignContext(){
	return applicationProperties.getCtxDesign(); //exception thrown here
}

}



The code should be ok because like I said everything works when started on
GEP, but if deployed as a standalone it doesn't work. I also tried to deploy
the application on GEP and then start the same server manually but no
difference.





I don't think you have a classloading problem, since you can get to  
the code in Environment just fine.

I think the problem is that Environment.applicationContext is null.   
What is supposed to initialize  it?

thanks
david jencks
-- 
View this message in context: http://www.nabble.com/Standalone-deployment-%3Ccross-context%3E-doesn%27t-work-tp24591184s134p24604920.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message