juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goddard <godd...@acm.org>
Subject Allocate exception for servlet under certain Windows environments
Date Sun, 28 Oct 2018 10:33:00 GMT
Hi,

I'm having a very odd problem when trying to test deployment of an 
application I have recently updated to use Juneau 7.2.x.  The problem 
appears to be specific to certain Windows environments.

When I call a GET or POST against the application deployed in Tomcat, I 
get a 500 server error.  Tomcat logs report the cause as:

org.apache.juneau.FormattedRuntimeException: Could not instantiate class 
org.apache.juneau.svl.Var

This appears to be caused by a npe:

org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1871)
	... 26 more
Caused by: java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
	at java.util.Arrays.asList(Arrays.java:3800)
	at org.apache.juneau.utils.Args.<init>(Args.java:115)
	at org.apache.juneau.utils.Args.<init>(Args.java:149)
	at org.apache.juneau.svl.vars.ArgsVar.<init>(ArgsVar.java:86)

(Interestingly I am having trouble getting the log4j logging to work in 
this environment also, but that may be unconnected)

This app works fine in:
  - Windows based Eclipse development environment (using Maven 
tomcat7:run goal to spin up a server)
  - Tomcat 9 deployment on MacOS

Fails in:
  - Windows Tomcat 8.5 environment on different Windows Server 2009 R2 
machine
  - Windows Tomcat 8.5 environment on Windows 10 desktop

I've tried both IBM and Sun JREs, most recently an Oracle 1.8.0_192-b12 
- this does not change the result.

I've tested with both 7.2.0 and the 7.2.1 RC, with the same results.

Any ideas?

##############################################

This is my tomcat log output using the 7.2.1 RC binary:

28-Oct-2018 11:10:19.536 SEVERE [http-nio-8080-exec-7] 
org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception 
for servlet [RootResources]
  java.lang.NullPointerException
         at java.util.Objects.requireNonNull(Objects.java:203)
         at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
         at java.util.Arrays.asList(Arrays.java:3800)
         at org.apache.juneau.utils.Args.<init>(Args.java:115)
         at org.apache.juneau.utils.Args.<init>(Args.java:149)
         at org.apache.juneau.svl.vars.ArgsVar.<init>(ArgsVar.java:86)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
         at 
org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1871)
         at 
org.apache.juneau.internal.ClassUtils.newInstance(ClassUtils.java:1810)
         at 
org.apache.juneau.svl.VarResolverBuilder.vars(VarResolverBuilder.java:54)
         at 
org.apache.juneau.svl.VarResolverBuilder.defaultVars(VarResolverBuilder.java:82)
         at 
org.apache.juneau.rest.RestContextBuilder.<init>(RestContextBuilder.java:131)
         at org.apache.juneau.rest.RestContext.create(RestContext.java:3078)
         at org.apache.juneau.rest.RestServlet.init(RestServlet.java:50)
         at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144)
         at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
         at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:773)
         at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
         at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
         at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
         at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
         at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
         at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
         at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
         at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
         at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
         at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
         at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
         at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
         at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
         at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
         at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
         at java.lang.Thread.run(Thread.java:748)

##############################################

This is from the Tomcat stderr log:

Servlet init error on class 
'com.ibm.cognos.sdk.framework.c10ServiceFrameworkReferenceImplementation.RootResources'
javax.servlet.ServletException: 
org.apache.juneau.FormattedRuntimeException: Could not instantiate class 
org.apache.juneau.svl.Var
	at 
org.apache.juneau.rest.RestContextBuilder.<init>(RestContextBuilder.java:251)
	at org.apache.juneau.rest.RestContext.create(RestContext.java:3078)
	at org.apache.juneau.rest.RestServlet.init(RestServlet.java:50)
	at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144)
	at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
	at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:773)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
	at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
	at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.juneau.FormattedRuntimeException: Could not 
instantiate class org.apache.juneau.svl.Var
	at 
org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1890)
	at org.apache.juneau.internal.ClassUtils.newInstance(ClassUtils.java:1810)
	at 
org.apache.juneau.svl.VarResolverBuilder.vars(VarResolverBuilder.java:54)
	at 
org.apache.juneau.svl.VarResolverBuilder.defaultVars(VarResolverBuilder.java:82)
	at 
org.apache.juneau.rest.RestContextBuilder.<init>(RestContextBuilder.java:131)
	... 22 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at 
org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1871)
	... 26 more
Caused by: java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
	at java.util.Arrays.asList(Arrays.java:3800)
	at org.apache.juneau.utils.Args.<init>(Args.java:115)
	at org.apache.juneau.utils.Args.<init>(Args.java:149)
	at org.apache.juneau.svl.vars.ArgsVar.<init>(ArgsVar.java:86)
	... 31 more
Servlet init error on class 
'com.ibm.cognos.sdk.framework.c10ServiceFrameworkReferenceImplementation.RootResources'
javax.servlet.ServletException: 
org.apache.juneau.FormattedRuntimeException: Could not instantiate class 
org.apache.juneau.svl.Var
	at 
org.apache.juneau.rest.RestContextBuilder.<init>(RestContextBuilder.java:251)
	at org.apache.juneau.rest.RestContext.create(RestContext.java:3078)
	at org.apache.juneau.rest.RestServlet.init(RestServlet.java:50)
	at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144)
	at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
	at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:773)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
	at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
	at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
	at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.juneau.FormattedRuntimeException: Could not 
instantiate class org.apache.juneau.svl.Var
	at 
org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1890)
	at org.apache.juneau.internal.ClassUtils.newInstance(ClassUtils.java:1810)
	at 
org.apache.juneau.svl.VarResolverBuilder.vars(VarResolverBuilder.java:54)
	at 
org.apache.juneau.svl.VarResolverBuilder.defaultVars(VarResolverBuilder.java:82)
	at 
org.apache.juneau.rest.RestContextBuilder.<init>(RestContextBuilder.java:131)
	... 22 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at 
org.apache.juneau.internal.ClassUtils.newInstanceFromOuter(ClassUtils.java:1871)
	... 26 more
Caused by: java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
	at java.util.Arrays.asList(Arrays.java:3800)
	at org.apache.juneau.utils.Args.<init>(Args.java:115)
	at org.apache.juneau.utils.Args.<init>(Args.java:149)
	at org.apache.juneau.svl.vars.ArgsVar.<init>(ArgsVar.java:86)
	... 31 more


##############################################

This is the catalina log showing server startup:

28-Oct-2018 11:09:09.187 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version: 
     Apache Tomcat/8.5.32
28-Oct-2018 11:09:09.192 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server built: 
     Jun 20 2018 19:50:35 UTC
28-Oct-2018 11:09:09.193 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server number: 
     8.5.32.0
28-Oct-2018 11:09:09.193 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Name: 
     Windows Server 2008 R2
28-Oct-2018 11:09:09.193 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Version: 
     6.1
28-Oct-2018 11:09:09.193 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Architecture: 
     amd64
28-Oct-2018 11:09:09.193 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Java Home: 
     D:\Java\jdk1.8.0_192\jre
28-Oct-2018 11:09:09.194 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 
     1.8.0_192-b12
28-Oct-2018 11:09:09.194 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: 
     Oracle Corporation
28-Oct-2018 11:09:09.194 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: 
     D:\Program Files\Apache Software Foundation\Tomcat 8.5
28-Oct-2018 11:09:09.194 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: 
     D:\Program Files\Apache Software Foundation\Tomcat 8.5
28-Oct-2018 11:09:09.195 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Dcatalina.home=D:\Program Files\Apache Software 
Foundation\Tomcat 8.5
28-Oct-2018 11:09:09.195 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Dcatalina.base=D:\Program Files\Apache Software 
Foundation\Tomcat 8.5
28-Oct-2018 11:09:09.195 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djava.io.tmpdir=D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\temp
28-Oct-2018 11:09:09.197 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Oct-2018 11:09:09.197 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Djava.util.logging.config.file=D:\Program Files\Apache 
Software Foundation\Tomcat 8.5\conf\logging.properties
28-Oct-2018 11:09:09.197 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: exit
28-Oct-2018 11:09:09.197 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: abort
28-Oct-2018 11:09:09.197 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Xms256m
28-Oct-2018 11:09:09.198 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Command line 
argument: -Xmx2048m
28-Oct-2018 11:09:09.199 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR 
based Apache Tomcat Native library [1.2.17] using APR version [1.6.3].
28-Oct-2018 11:09:09.199 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR 
capabilities: IPv6 [true], sendfile [true], accept filters [false], 
random [true].
28-Oct-2018 11:09:09.199 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL 
configuration: useAprConnector [false], useOpenSSL [true]
28-Oct-2018 11:09:09.988 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL 
successfully initialized [OpenSSL 1.0.2o  27 Mar 2018]
28-Oct-2018 11:09:10.186 INFO [main] 
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler 
["http-nio-8080"]
28-Oct-2018 11:09:10.326 INFO [main] 
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a 
shared selector for servlet write/read
28-Oct-2018 11:09:10.336 INFO [main] 
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler 
["ajp-nio-8009"]
28-Oct-2018 11:09:10.339 INFO [main] 
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a 
shared selector for servlet write/read
28-Oct-2018 11:09:10.340 INFO [main] 
org.apache.catalina.startup.Catalina.load Initialization processed in 
1748 ms
28-Oct-2018 11:09:10.386 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting service 
[Catalina]
28-Oct-2018 11:09:10.386 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet 
Engine: Apache Tomcat/8.5.32
28-Oct-2018 11:09:10.423 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployWAR Deploying web 
application archive [D:\Program Files\Apache Software Foundation\Tomcat 
8.5\webapps\c10ServiceFrameworkReferenceImplementation.war]
28-Oct-2018 11:09:12.492 INFO [localhost-startStop-1] 
org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was 
scanned for TLDs yet contained no TLDs. Enable debug logging for this 
logger for a complete list of JARs that were scanned but no TLDs were 
found in them. Skipping unneeded JARs during scanning can improve 
startup time and JSP compilation time.
28-Oct-2018 11:09:12.544 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployWAR Deployment of web 
application archive [D:\Program Files\Apache Software Foundation\Tomcat 
8.5\webapps\c10ServiceFrameworkReferenceImplementation.war] has finished 
in [2,121] ms
[...]
28-Oct-2018 11:09:14.824 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\docs]
28-Oct-2018 11:09:14.856 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\docs] has finished in [32] ms
28-Oct-2018 11:09:14.856 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\examples]
28-Oct-2018 11:09:15.195 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\examples] has finished in [339] ms
28-Oct-2018 11:09:15.195 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\host-manager]
28-Oct-2018 11:09:15.239 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\host-manager] has finished in [44] ms
28-Oct-2018 11:09:15.240 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\manager]
28-Oct-2018 11:09:15.281 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\manager] has finished in [42] ms
28-Oct-2018 11:09:15.281 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\ROOT]
28-Oct-2018 11:09:15.310 INFO [localhost-startStop-1] 
org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web 
application directory [D:\Program Files\Apache Software 
Foundation\Tomcat 8.5\webapps\ROOT] has finished in [29] ms
28-Oct-2018 11:09:15.337 INFO [main] 
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler 
["http-nio-8080"]
28-Oct-2018 11:09:15.354 INFO [main] 
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler 
["ajp-nio-8009"]
28-Oct-2018 11:09:15.357 INFO [main] 
org.apache.catalina.startup.Catalina.start Server startup in 5016 ms

##############################################

Thanks,

David

Mime
View raw message