java.lang.NullPointerException: The parameter 'contextDirectory' must not be null. [message #1402163] |
Wed, 16 July 2014 16:06 |
Edmundo López Bóbeda Messages: 27 Registered: October 2012 |
Junior Member |
|
|
Hello,
I'm trying to deploy an RAP application to Heroku, but I get the following exception (see later). The setup of my application is without the workbench and packaged as a war. In heroku they use Tomcat 7 using a wrapper to launch the app.
My research lead me to the following problem. The RAP app (in the class org.eclipse.rap.rwt.internal.application.ApplicationContextImpl) is trying to create a file to put the resources (it's not me but the framework) and to define where to write it either obtains it from the servlet context using the parameter name 'resource_root_location' or the default value, the root directory "/".
Somehow, in the wrapper, the function servletContext.getRealPath( "/" ) returns null. Even though I try to set the variable to use another directory, putting the following in web.xml:
<context-param>
<param-name>resource_root_location</param-name>
<param-value>./tmp</param-value>
</context-param>
I still get null. I use that directory (I mean the tmp directory), because Heroku won't let the app write in any other directory, which is another problem. In fact, they do not guarantee that whatever the framework wrote will remain there. If you want to test the error, you can try any war using RWT with the heroku launcher available here: https://github.com/heroku/devcenter-webapp-runner.git
So my questions are the following:
- Is there a way for the RAP-framework to avoid writing?
- If not, how can I configure the 'resource_root_location' variable?
Best regards,
Edmundo
---- here is the exception ----
argos:net.lopezbobeda.dplus.myapp mundacho$ java -jar ../../devcenter-webapp-runner/target/dependency/webapp-runner.jar target/net.lopezbobeda.dplus.myapp-1.0.0.qualifier.war
deploying app from: /Users/mundacho/git/net.lopezbobeda.dplus.myapp/net.lopezbobeda.dplus.myapp/target/net.lopezbobeda.dplus.myapp-1.0.0.qualifier.war
juil. 16, 2014 5:37:10 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
juil. 16, 2014 5:37:10 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
juil. 16, 2014 5:37:10 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.22
juil. 16, 2014 5:37:11 PM org.apache.catalina.startup.ContextConfig webConfig
INFO: No global web.xml found
juil. 16, 2014 5:37:12 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.eclipse.rap.rwt.engine.RWTServletContextListener
java.lang.NullPointerException: The parameter 'contextDirectory' must not be null.
at org.eclipse.rap.rwt.internal.util.ParamCheck.notNull(ParamCheck.java:40)
at org.eclipse.rap.rwt.internal.resources.ResourceDirectory.configure(ResourceDirectory.java:28)
at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.doActivate(ApplicationContextImpl.java:254)
at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.activate(ApplicationContextImpl.java:131)
at org.eclipse.rap.rwt.application.ApplicationRunner.activateApplicationContext(ApplicationRunner.java:115)
at org.eclipse.rap.rwt.application.ApplicationRunner.start(ApplicationRunner.java:83)
at org.eclipse.rap.rwt.engine.RWTServletContextListener.contextInitialized(RWTServletContextListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
juil. 16, 2014 5:37:12 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
juil. 16, 2014 5:37:12 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
juil. 16, 2014 5:37:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04559 seconds