users@glassfish.java.net

Glassfish 3.1.2 exception due to cache

From: <forums_at_java.net>
Date: Thu, 3 Jan 2013 00:12:10 -0600 (CST)

I have posted this question on other forums across the net but no response. I
have a Rest Web service deployed on Glassfish 3.1.2. I sporadically get a
particular exception on it.
[#|2012-12-20T10:48:33.796+0530|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=28;_ThreadName=Thread-2;|StandardWrapperValve[Jersey
REST Service]: PWC1406: Servlet.service() for servlet Jersey REST Service
threw exception org.codehaus.jackson.map.JsonMappingException: WEB9031:
WebappClassLoader unable to load resource [java.util.TimeZone], because it
has not yet been started, or was already stopped (through reference chain:
spreadsheet.Exceldatalist["globalContext"]->spreadsheet.GlobalContext["dateOfCreation"])
at
org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:218)
at
org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:183)
at
org.codehaus.jackson.map.ser.std.SerializerBase.wrapAndThrow(SerializerBase.java:140)
at
org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:158)
at
org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:112)
at
org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:446)
at
org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
at
org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:112)
at
org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
at
org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1604)
at
org.codehaus.jackson.jaxrs.JacksonJsonProvider.writeTo(JacksonJsonProvider.java:558)
at
com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.writeTo(JacksonProviderProxy.java:160)
at
com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1437)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770) at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at
com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619) Caused by:
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load
resource [java.util.TimeZone], because it has not yet been started, or was
already stopped at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401)
at
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at
java.lang.Class.getDeclaredMethods(Class.java:1791) at
org.codehaus.jackson.map.introspect.AnnotatedClass._addMemberMethods(AnnotatedClass.java:620)
at
org.codehaus.jackson.map.introspect.AnnotatedClass.resolveMemberMethods(AnnotatedClass.java:408)
at
org.codehaus.jackson.map.introspect.BasicClassIntrospector.classWithCreators(BasicClassIntrospector.java:185)
at
org.codehaus.jackson.map.introspect.BasicClassIntrospector.collectProperties(BasicClassIntrospector.java:157)
at
org.codehaus.jackson.map.introspect.BasicClassIntrospector.forSerialization(BasicClassIntrospector.java:96)
at
org.codehaus.jackson.map.introspect.BasicClassIntrospector.forSerialization(BasicClassIntrospector.java:16)
at
org.codehaus.jackson.map.SerializationConfig.introspect(SerializationConfig.java:974)
at
org.codehaus.jackson.map.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:251)
at
org.codehaus.jackson.map.ser.StdSerializerProvider._createUntypedSerializer(StdSerializerProvider.java:782)
at
org.codehaus.jackson.map.ser.StdSerializerProvider._createAndCacheUntypedSerializer(StdSerializerProvider.java:735)
at
org.codehaus.jackson.map.ser.StdSerializerProvider.findValueSerializer(StdSerializerProvider.java:344)
at
org.codehaus.jackson.map.ser.impl.PropertySerializerMap.findAndAddSerializer(PropertySerializerMap.java:39)
at
org.codehaus.jackson.map.ser.BeanPropertyWriter._findAndAddDynamic(BeanPropertyWriter.java:463)
at
org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:441)
at
org.codehaus.jackson.map.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:150)
My Web service marshals an xml on the server after processing. The xml
contains a time set in a tag GregorianCalendar gc = (GregorianCalendar)
GregorianCalendar .getInstance();
globalContextObj.setDateOfCreation(DatatypeFactory.newInstance()
.newXMLGregorianCalendar(gc)); The jaxb xml object is private member var of
the class, changing the access modifier from static to none is not affecting
the exception. I read about the `WEB9031` exception that it is caused by the
classloader not being able to load the TimeZone class library. Glassfish
documentation suggests that while deploying we must mention the common
libraries in the console. But I have no common libraries. I think that the
java.util.timezone class mentioned in the exception is getting unloaded or
something like that. If anyone has any idea to resolve this please let me
know!!

--
[Message sent by forum member 'kavitadeshpande']
View Post: http://forums.java.net/node/893580