You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Douglas Scott Jackson (JIRA)" <ji...@apache.org> on 2008/02/05 00:49:08 UTC

[jira] Created: (ODE-239) Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic

Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic
------------------------------------------------------------------------------------------------

                 Key: ODE-239
                 URL: https://issues.apache.org/jira/browse/ODE-239
             Project: ODE
          Issue Type: Bug
          Components: Axis2 Integration
    Affects Versions: 1.2
            Reporter: Douglas Scott Jackson


I dropped the ode.war inside an ear file since we may wish to deploy it as part of our application.
When I did so, I got a NullPointerException.  
The expression config.getServletContext().getRealPath("/WEB-INF") evaluated to null.

I would like to propose a fix like the following:

Index: axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
===================================================================
--- axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (revision 615241)
+++ axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (working copy)
@@ -115,7 +115,12 @@
         boolean success = false;
         try {
             _axisConfig = axisConf;
-            _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
+            String workingDir = System.getProperty("org.apache.ode.workingDir");
+            if (workingDir != null)
+               _appRoot = new File(workingDir);
+            else
+               _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
+
             TempFileManager.setWorkingDirectory(_appRoot);

             __log.debug("Loading properties");


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


RE: [jira] Commented: (ODE-239) Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic

Posted by "Jackson, Douglas" <dj...@ugs.com>.
Hi!
I was using Weblogic 9.2.0.

I specified the system.getProperty in that patch because there was some
other code that did something similar in the servlet.  It would seem
better to grab the value from the servlet context so that it would be
possible to specify the value in the web.xml file rather than in a JVM
wide system property.  Putting the value in the ServletContext would
allow for more than one ode to run in a container without clashing
directories (a somewhat unlikely scenario).
Putting the value in the ServletContext would allow for the
configuration to be set in our installer rather than modifying the app
server startup scripts.
-Doug.

-----Original Message-----
From: Matthieu Riou (JIRA) [mailto:jira@apache.org] 
Sent: Tuesday, February 05, 2008 10:50 AM
To: dev@ode.apache.org
Subject: [jira] Commented: (ODE-239) Ode server fails with null pointer
exception when war is deployed inside an ear file in weblogic


    [
https://issues.apache.org/jira/browse/ODE-239?page=com.atlassian.jira.pl
ugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565804#ac
tion_12565804 ] 

Matthieu Riou commented on ODE-239:
-----------------------------------

Actually there are already ways to externalize the configuration (the
content of the conf directory) and the working directory (where
processes are deployed). These are the mechanisms that I'd assume you'd
use for clustering. Where the root directory is used directly is usually
for immutable stuff, like our WSDLs and such. But if this gives to a
null in an EAR deployment, then a way to set it is needed.

Btw, forgot to ask, which app server are you using?

> Ode server fails with null pointer exception when war is deployed
inside an ear file in weblogic
>
------------------------------------------------------------------------
------------------------
>
>                 Key: ODE-239
>                 URL: https://issues.apache.org/jira/browse/ODE-239
>             Project: ODE
>          Issue Type: Bug
>          Components: Axis2 Integration
>    Affects Versions: 1.2
>            Reporter: Douglas Scott Jackson
>
> I dropped the ode.war inside an ear file since we may wish to deploy
it as part of our application.
> When I did so, I got a NullPointerException.  
> The expression config.getServletContext().getRealPath("/WEB-INF")
evaluated to null.
> I would like to propose a fix like the following:
> Index: axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
> ===================================================================
> --- axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
(revision 615241)
> +++ axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
(working copy)
> @@ -115,7 +115,12 @@
>          boolean success = false;
>          try {
>              _axisConfig = axisConf;
> -            _appRoot = new
File(config.getServletContext().getRealPath("/WEB-INF"));
> +            String workingDir =
System.getProperty("org.apache.ode.workingDir");
> +            if (workingDir != null)
> +               _appRoot = new File(workingDir);
> +            else
> +               _appRoot = new
File(config.getServletContext().getRealPath("/WEB-INF"));
> +
>              TempFileManager.setWorkingDirectory(_appRoot);
>              __log.debug("Loading properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ODE-239) Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic

Posted by "Matthieu Riou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthieu Riou resolved ODE-239.
-------------------------------

    Resolution: Incomplete
      Assignee: Matthieu Riou

> Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic
> ------------------------------------------------------------------------------------------------
>
>                 Key: ODE-239
>                 URL: https://issues.apache.org/jira/browse/ODE-239
>             Project: ODE
>          Issue Type: Bug
>          Components: Axis2 Integration
>    Affects Versions: 1.2
>            Reporter: Douglas Scott Jackson
>            Assignee: Matthieu Riou
>
> I dropped the ode.war inside an ear file since we may wish to deploy it as part of our application.
> When I did so, I got a NullPointerException.  
> The expression config.getServletContext().getRealPath("/WEB-INF") evaluated to null.
> I would like to propose a fix like the following:
> Index: axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
> ===================================================================
> --- axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (revision 615241)
> +++ axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (working copy)
> @@ -115,7 +115,12 @@
>          boolean success = false;
>          try {
>              _axisConfig = axisConf;
> -            _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +            String workingDir = System.getProperty("org.apache.ode.workingDir");
> +            if (workingDir != null)
> +               _appRoot = new File(workingDir);
> +            else
> +               _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +
>              TempFileManager.setWorkingDirectory(_appRoot);
>              __log.debug("Loading properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-239) Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic

Posted by "Matthieu Riou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565804#action_12565804 ] 

Matthieu Riou commented on ODE-239:
-----------------------------------

Actually there are already ways to externalize the configuration (the content of the conf directory) and the working directory (where processes are deployed). These are the mechanisms that I'd assume you'd use for clustering. Where the root directory is used directly is usually for immutable stuff, like our WSDLs and such. But if this gives to a null in an EAR deployment, then a way to set it is needed.

Btw, forgot to ask, which app server are you using?

> Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic
> ------------------------------------------------------------------------------------------------
>
>                 Key: ODE-239
>                 URL: https://issues.apache.org/jira/browse/ODE-239
>             Project: ODE
>          Issue Type: Bug
>          Components: Axis2 Integration
>    Affects Versions: 1.2
>            Reporter: Douglas Scott Jackson
>
> I dropped the ode.war inside an ear file since we may wish to deploy it as part of our application.
> When I did so, I got a NullPointerException.  
> The expression config.getServletContext().getRealPath("/WEB-INF") evaluated to null.
> I would like to propose a fix like the following:
> Index: axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
> ===================================================================
> --- axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (revision 615241)
> +++ axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (working copy)
> @@ -115,7 +115,12 @@
>          boolean success = false;
>          try {
>              _axisConfig = axisConf;
> -            _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +            String workingDir = System.getProperty("org.apache.ode.workingDir");
> +            if (workingDir != null)
> +               _appRoot = new File(workingDir);
> +            else
> +               _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +
>              TempFileManager.setWorkingDirectory(_appRoot);
>              __log.debug("Loading properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-239) Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic

Posted by "Douglas Scott Jackson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12565777#action_12565777 ] 

Douglas Scott Jackson commented on ODE-239:
-------------------------------------------

A further advantage of allowing for a system property to configure the working directory
might be for clustering so that deploying to one ode deploys to all if more than 1 ode
points to the same directory (shared filesystem).



> Ode server fails with null pointer exception when war is deployed inside an ear file in weblogic
> ------------------------------------------------------------------------------------------------
>
>                 Key: ODE-239
>                 URL: https://issues.apache.org/jira/browse/ODE-239
>             Project: ODE
>          Issue Type: Bug
>          Components: Axis2 Integration
>    Affects Versions: 1.2
>            Reporter: Douglas Scott Jackson
>
> I dropped the ode.war inside an ear file since we may wish to deploy it as part of our application.
> When I did so, I got a NullPointerException.  
> The expression config.getServletContext().getRealPath("/WEB-INF") evaluated to null.
> I would like to propose a fix like the following:
> Index: axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
> ===================================================================
> --- axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (revision 615241)
> +++ axis2/src/main/java/org/apache/ode/axis2/ODEServer.java     (working copy)
> @@ -115,7 +115,12 @@
>          boolean success = false;
>          try {
>              _axisConfig = axisConf;
> -            _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +            String workingDir = System.getProperty("org.apache.ode.workingDir");
> +            if (workingDir != null)
> +               _appRoot = new File(workingDir);
> +            else
> +               _appRoot = new File(config.getServletContext().getRealPath("/WEB-INF"));
> +
>              TempFileManager.setWorkingDirectory(_appRoot);
>              __log.debug("Loading properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.