Hi,

I have a large handful of servlets that were originally developed under 
NetBeans 8 and Java 8, running on Glassfish 4.1.

I am now trying to move to NetBeans 11.3 and then 12.

On every one of my old servlets I can clean compile once I have changed to 
libraries to javaee-web-api-8.0.jar but I always get an Allocate exception – 
see below.  Trying to trace through the error arises on the new instance by 
name call.  I’ve googled around and made sure that all my servlets have a no 
parameters constructor but that doesn’t help.

I created a new project and that works.

I’ve looked at every point of comparison I can think of (constructor java code, 
web.xml, build.xml, project.xml, libraries, .war contents) but can see no 
difference.  I’ve run under both Glassfish 5.1.0 and Payara latest version with 
the same results under both.  Maybe that’s not surprising since the core code 
is the same.  I’ve run with NetBeans on both Mac OS Catalina and Windows 10 
with the same results.

I’ve kept the Java platform at 8 to avoid changing too much at once.

Looks like I will have to recreate all my servlet projects, but before I do, 
has anyone had the same problem and solved it ?

Thanks

David G


Log Entry Detail


Timestamp
Apr 18, 2020 17:24:53.716
Log Level
WARNING
Logger
javax.enterprise.web
Name-Value Pairs
{levelValue=900, timeMillis=1587227093716}
Record Number
148
Message ID
Complete Message
StandardWrapperValve[TestServlet]: Allocate exception for servlet TestServlet
java.lang.RuntimeException:
                at TestServlet.<init>(TestServlet.java:1)
                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 
com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:292)
                at 
com.sun.enterprise.web.WebContainer.createServletInstance(WebContainer.java:779)
                at 
com.sun.enterprise.web.WebModule.createServletInstance(WebModule.java:2095)
                at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1350)
                at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1158)
                at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
                at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
                at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:755)
                at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:575)
                at 
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
                at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
                at 
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
                at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
                at 
com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
                at 
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
                at 
org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:182)
                at 
org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:156)
                at 
org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:218)
                at 
org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:95)
                at 
org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:260)
                at 
org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:177)
                at 
org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:109)
                at 
org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:88)
                at 
org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:53)
                at 
org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:524)
                at 
org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:89)
                at 
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:94)
                at 
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:33)
                at 
org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:114)
                at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569)
                at 
org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549)
                at java.lang.Thread.run(Thread.java:748)




Reply via email to