You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by vojdan_ <vo...@yahoo.com> on 2009/07/21 18:35:12 UTC

Standalone deployment doesn't work

Hello,
I am developing an application and we recently migrated from WAS 6 and
Rational application developer 6 to Eclipse Ganymede and Geronimo v2.1.

The application works fine when deployed if the server is started from
Eclipse i.e. if I work on GEP (even if removed and redeployed).
But, if I shut down the server from eclipse, then start it from command line
with "geronimo run" and deploy it via the geronimo console it gives me a
NullPointerRefferenceException.
When deploying I export the EAR project to an EAR file and deploy from it.

I think I get this exception because somehow, in the second case the
<cross-context/> tag doesn't work because the log messages are familiar and
it throws it when trying to access a function in a utility project.

Can someone help?

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


Re: Standalone deployment doesn't work

Posted by vojdan_ <vo...@yahoo.com>.
Thanks for the ideas guys but I'm not that experienced with unix.
The thing is that the final environment is going to be unix, but hte
development is run under windows xp so i have a unix server available but I
don't know nothing but the basic commands.

Anyway, i did a workaround for my problem (having the strings harcoded
instead of getting them from a function in the utility project) and got hung
up somewhere else.
This is the new stacktrace:
2009-07-24 16:18:45,145 ERROR [[ReferralPatientSearchForm]]
Servlet.service() for servlet ReferralPatientSearchForm threw exception
java.lang.ClassNotFoundException: javax.wsdl.OperationType in classloader
default/ZBCEar/1.0/car
        at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadOptimizedClass(MultiParentClassLoader.java:438)
        at
org.apache.geronimo.kernel.config.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:280)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at
org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java:59)
        at
nl.vektis.www.Vz3738BindingStub.<clinit>(Vz3738BindingStub.java:22)
        at
nl.vektis.www.Vz3738ServiceLocator.getVz3738Port(Vz3738ServiceLocator.java:57)
        at
nl.vektis.www.Vz3738ServiceLocator.getVz3738Port(Vz3738ServiceLocator.java:51)
        at nl.vektis.www.VecozoSOAP.checkInsurance3738(VecozoSOAP.java:124)
        at
nl.yellowstone.zbc.internal.office.referrals.ReferralPatientSearchForm.doPost(ReferralPatientSearchForm.java:84)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
        at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)
valid: 0
Security for Vecozo initialized!!!
Changed Vecozo security!!!
This is in Vz3738Servicelocator.java - Line 56
2009-07-24 16:20:01,853 ERROR [[ReferralPatientSearchForm]]
Servlet.service() for servlet ReferralPatientSearchForm threw exception
java.lang.NoClassDefFoundError: Could not initialize class
nl.vektis.www.Vz3738BindingStub
        at
nl.vektis.www.Vz3738ServiceLocator.getVz3738Port(Vz3738ServiceLocator.java:57)
        at
nl.vektis.www.Vz3738ServiceLocator.getVz3738Port(Vz3738ServiceLocator.java:51)
        at nl.vektis.www.VecozoSOAP.checkInsurance3738(VecozoSOAP.java:124)
        at
nl.yellowstone.zbc.internal.office.referrals.ReferralPatientSearchForm.doPost(ReferralPatientSearchForm.java:84)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
        at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)


I see that there is a difference in the errors between the first and second
request. And the error circumstances are similar like in that error before
i.e. one class trying to call a function from another class within the same
project.
There are also a few debug messages in there.

Is all of this somehow connected?
I just can't make sense of it. :(


Thanks for helping.





kevan wrote:
> 
> 
> On Jul 22, 2009, at 12:23 PM, David Jencks wrote:
> 
>> There are two possibilities I can think of right now:
>>
>> 1. Something is calling Environment.setApplicationProperties(null)  
>> which produces a NullPointerException before the System.out can tell  
>> you about it.  This seems unlikely but is easy to check with another  
>> System.out. I guess there might be a clearApplicationProperties()  
>> method also...
>>
>> 2. you have 2 classloaders loading the Environment class.  I don't  
>> really see how this would be happening either but again is pretty  
>> easy to check.
> 
> That was the only "idea" that I had...
> 
> You should be able to reproduce this under the Eclipse Debugger.  
> Launch the server process remotely (i.e. 'bin/geronimo.sh jpda run'),  
> attach the Eclipse process to this server process (e.g. localhost port  
> 8000), set breakpoint(s), and run a deploy.
> 
> --kevan
> 
> 

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


Re: Standalone deployment doesn't work

Posted by Kevan Miller <ke...@gmail.com>.
On Jul 22, 2009, at 12:23 PM, David Jencks wrote:

> There are two possibilities I can think of right now:
>
> 1. Something is calling Environment.setApplicationProperties(null)  
> which produces a NullPointerException before the System.out can tell  
> you about it.  This seems unlikely but is easy to check with another  
> System.out. I guess there might be a clearApplicationProperties()  
> method also...
>
> 2. you have 2 classloaders loading the Environment class.  I don't  
> really see how this would be happening either but again is pretty  
> easy to check.

That was the only "idea" that I had...

You should be able to reproduce this under the Eclipse Debugger.  
Launch the server process remotely (i.e. 'bin/geronimo.sh jpda run'),  
attach the Eclipse process to this server process (e.g. localhost port  
8000), set breakpoint(s), and run a deploy.

--kevan

Re: Standalone deployment doesn't work

Posted by David Jencks <da...@yahoo.com>.
There are two possibilities I can think of right now:

1. Something is calling Environment.setApplicationProperties(null)  
which produces a NullPointerException before the System.out can tell  
you about it.  This seems unlikely but is easy to check with another  
System.out. I guess there might be a clearApplicationProperties()  
method also...

2. you have 2 classloaders loading the Environment class.  I don't  
really see how this would be happening either but again is pretty easy  
to check.

Code suggestions inline...

thanks
david jencks

On Jul 22, 2009, at 4:58 AM, vojdan_ wrote:

>
> 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 called with" +  
applicationProperties);
System.out.println("Environment classloader during set:" +  
getClass().getClassLoader());
> 		 System.out.println("set application properties: " +
> Environment.applicationProperties.getCtxDesign());
> }
>
> public static String getDesignContext(){
System.out.println("Environment classloader during access:" +  
getClass().getClassLoader());
> 	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.
>

Re: Standalone deployment doesn't work

Posted by vojdan_ <vo...@yahoo.com>.
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.


Re: Standalone deployment doesn't work

Posted by David Jencks <da...@yahoo.com>.
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

On Jul 21, 2009, at 3:26 PM, vojdan_ wrote:

>
> Here is the stacktrace:
> 2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet  
> jsp
> threw exception java.lang.NullPointerException
>        at
> nl 
> .yellowstone 
> .zbc.common.Environment.getDesignContext(Environment.java:96)
>        at  
> org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
>        at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> .......
> 2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet  
> jsp
> threw exception
> java.lang.NullPointerException
>        at
> nl 
> .yellowstone 
> .zbc.common.Environment.getDesignContext(Environment.java:96)
>        at  
> org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
>        at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> ........
> 2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet  
> jsp
> threw exception
> java.lang.NullPointerException
>        at
> nl 
> .yellowstone 
> .zbc.common.Environment.getDesignContext(Environment.java:96)
>        at  
> org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
>        at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>        ...23 more
>
>
> The structure of the EAR is:
> EAR
>  |
> META-INF------------------------------application.xml
> war1.war                                      geronimo-application.xml
> war2.war                                      MANIFEST.MF
> war3.war                                      .modulemaps
> .....                                              ibm-application- 
> ext.xmi
> ZBCUtility.jar                                ibm-application-bnd.xmi
> commons-fileupload-1.2.jar
> .compatibility
>
>
> I am accessing one of the WARs which uses the getStringContext()  
> from the
> project ZBCUtility.
> I'm guessing that project (ZBCUtility) gets packed as a JAR and put  
> in the
> EAR.
> (I'm pretty new to java so don't laugh cause I'm unsure :))
>
> Both of these classes are in the ZBCUtility project but in different
> packages.
> Environment.java:
> public static String getDesignContext(){
> 		return applicationProperties.getCtxDesign(); //throws exception  
> here -
> line 96
>
> //trying to call the bottom function
> }
>
> ApplicationProperties.java:
> public  String getCtxDesign(){
> 	                return ctxDesign;
> }
>
>
>
> One more thing, I don't get any errors on deployment. When deploying
> everything is fine.
> But, when I try to access a page it throws the exception.
>
>
> Thanks again.
>
>
>
>
>
> -- 
> View this message in context: http://www.nabble.com/Standalone-deployment-%3Ccross-context%3E-doesn%27t-work-tp24591184s134p24596946.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>

Re: Standalone deployment doesn't work

Posted by vojdan_ <vo...@yahoo.com>.
Here is the stacktrace:
2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet jsp
threw exception java.lang.NullPointerException
        at
nl.yellowstone.zbc.common.Environment.getDesignContext(Environment.java:96)
        at org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
.......
2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet jsp
threw exception
java.lang.NullPointerException
        at
nl.yellowstone.zbc.common.Environment.getDesignContext(Environment.java:96)
        at org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
........
2009-07-21 18:24:59,544 ERROR [[jsp]] Servlet.service() for servlet jsp
threw exception
java.lang.NullPointerException
        at
nl.yellowstone.zbc.common.Environment.getDesignContext(Environment.java:96)
        at org.apache.jsp.templates.login_jsp._jspService(login_jsp.java:70)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        ...23 more


The structure of the EAR is:
EAR
  |
META-INF------------------------------application.xml
war1.war                                      geronimo-application.xml
war2.war                                      MANIFEST.MF
war3.war                                      .modulemaps
.....                                              ibm-application-ext.xmi
ZBCUtility.jar                                ibm-application-bnd.xmi
commons-fileupload-1.2.jar
.compatibility


I am accessing one of the WARs which uses the getStringContext() from the
project ZBCUtility.
I'm guessing that project (ZBCUtility) gets packed as a JAR and put in the
EAR.
(I'm pretty new to java so don't laugh cause I'm unsure :))

Both of these classes are in the ZBCUtility project but in different
packages.
Environment.java:
public static String getDesignContext(){
		return applicationProperties.getCtxDesign(); //throws exception here -
line 96
                                                                                               
//trying to call the bottom function
}

ApplicationProperties.java:
public  String getCtxDesign(){
	                return ctxDesign;
}



One more thing, I don't get any errors on deployment. When deploying
everything is fine.
But, when I try to access a page it throws the exception.


Thanks again.





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


Re: Standalone deployment doesn't work

Posted by David Jencks <da...@yahoo.com>.
On Jul 21, 2009, at 9:35 AM, vojdan_ wrote:

>
> Hello,
> I am developing an application and we recently migrated from WAS 6 and
> Rational application developer 6 to Eclipse Ganymede and Geronimo  
> v2.1.
>
> The application works fine when deployed if the server is started from
> Eclipse i.e. if I work on GEP (even if removed and redeployed).
> But, if I shut down the server from eclipse, then start it from  
> command line
> with "geronimo run" and deploy it via the geronimo console it gives  
> me a
> NullPointerRefferenceException.
> When deploying I export the EAR project to an EAR file and deploy  
> from it.
>
> I think I get this exception because somehow, in the second case the
> <cross-context/> tag doesn't work because the log messages are  
> familiar and
> it throws it when trying to access a function in a utility project.
>
> Can someone help?

Can you show the stack trace, the structure of your ear, and tell us  
where any relevant classes are?

<cross-context> is a tomcat specific element that tells tomcat to  
break spec compatibility and share session objects between web apps.   
It is not likely to cause a startup or deployment failure.

thanks
david jencks


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