NPE if wapama is deployed as .war file

30 views
Skip to first unread message

Esteban Aliverti

unread,
Jul 27, 2011, 10:01:04 AM7/27/11
to wapama
Hi,
I'm deploying wapama as a .war file. The problem is that I'm getting a
NPE when I try to access the application.
The NPE is related to the use of ServletContext.getRealPath() method.
According to the specification, this method could return null if the
application is deployed as a .war file. And I think I'm experiencing
that behavior :(
Unfortunately, I'm using WSO2 app server and I didn't find yet an
option to deploy the application as an exploded war.
Any thoughts on this? I think it would be nice if wapama itself
doesn't depend on the way it is deployed.

Best Regards,

Antoine Toulme

unread,
Jul 27, 2011, 1:30:29 PM7/27/11
to wap...@googlegroups.com
getRealPath() is used extensively for lack of better knowledge. Would you have a suggestion to handle this in a better, more elegant way ?

Antoine

Esteban Aliverti

unread,
Jul 27, 2011, 2:07:54 PM7/27/11
to wap...@googlegroups.com
AFAIK, the only solution would be to have a configuration parameter or file specifying it. More elegant, but more cumbersome :(

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com

Antoine Toulme

unread,
Jul 27, 2011, 11:21:10 PM7/27/11
to wap...@googlegroups.com
I don't understand your solution, would you be so kind as to provide a patch ?

Thanks,

Antoine

Esteban Aliverti

unread,
Aug 2, 2011, 1:40:11 AM8/2/11
to wap...@googlegroups.com
The solution a I'm talking about is to stop using context.getPath() and replace it with some kind of configuration variable. The value of that variable must be the real path where the application is deployed. The drawback of this solution is that you need to change that variable in each deployment that you have.   

Best Regards,


XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


Antoine Toulme

unread,
Aug 2, 2011, 7:32:37 PM8/2/11
to wap...@googlegroups.com
That's not really workable. You could use a method which would try to use getRealPath and default on something else. Wapama writes files to compress JS as well, so it might just not be possible to support a solution where the war remains zipped.
Reply all
Reply to author
Forward
0 new messages