Got a bit further with your suggestion: I'm not a freemarker expert
unfortunately.
009-06-19 13:46:13.965::DEBUG: EXCEPTION
javax.servlet.ServletException: init
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:36
3)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:320)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
ction.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.jav
a:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.ja
va:450)
Caused by: java.lang.NoClassDefFoundError:
freemarker/template/ObjectWrapper
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown
Source)
at java.lang.Class.getConstructors(Unknown Source)
at
com.sun.ws.rest.impl.modelapi.annotation.IntrospectionModeller.createRes
ource(IntrospectionModeller.java:81)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.getAbstractResource(
WebApplicationImpl.java:198)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.processRootResources
(WebApplicationImpl.java:411)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:329)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:277)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.initiate(ServletC
ontainer.java:333)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.init(ServletConta
iner.java:110)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:4
33)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:34
2)
... 13 more
Caused by: java.lang.ClassNotFoundException:
freemarker.template.ObjectWrapper
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 25 more
2009-06-19 13:46:13.996::WARN: Nested in
javax.servlet.ServletException: init:
java.lang.NoClassDefFoundError: freemarker/template/ObjectWrapper
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown
Source)
at java.lang.Class.getConstructors(Unknown Source)
at
com.sun.ws.rest.impl.modelapi.annotation.IntrospectionModeller.createRes
ource(IntrospectionModeller.java:81)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.getAbstractResource(
WebApplicationImpl.java:198)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.processRootResources
(WebApplicationImpl.java:411)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:329)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:277)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.initiate(ServletC
ontainer.java:333)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.init(ServletConta
iner.java:110)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:4
33)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:34
2)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:320)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
ction.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.jav
a:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.ja
va:450)
Caused by: java.lang.ClassNotFoundException:
freemarker.template.ObjectWrapper
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 25 more
2009-06-19 13:46:13.028::WARN: /football/includepathgenerator
java.lang.NoClassDefFoundError: freemarker/template/ObjectWrapper
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown
Source)
at java.lang.Class.getConstructors(Unknown Source)
at
com.sun.ws.rest.impl.modelapi.annotation.IntrospectionModeller.createRes
ource(IntrospectionModeller.java:81)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.getAbstractResource(
WebApplicationImpl.java:198)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.processRootResources
(WebApplicationImpl.java:411)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:329)
at
com.sun.ws.rest.impl.application.WebApplicationImpl.initiate(WebApplicat
ionImpl.java:277)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.initiate(ServletC
ontainer.java:333)
at
com.sun.ws.rest.spi.container.servlet.ServletContainer.init(ServletConta
iner.java:110)
at
org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:4
33)
at
org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:34
2)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:463)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:320)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
ction.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.jav
a:228)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.ja
va:450)
Caused by: java.lang.ClassNotFoundException:
freemarker.template.ObjectWrapper
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 25 more
2009-06-19 13:46:13.043::DEBUG: GET /football/includepathgenerator
HTTP/1.1
Accept: */*
Accept-Language: en-gb
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.
04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
Host: noldev40:8081
Connection: Keep-Alive
Cache-Control: no-cache
2009-06-19 13:46:13.059::DEBUG: RESPONSE /football/includepathgenerator
500
-----Original Message-----
From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: 19 June 2009 13:36
To: Jonathan Cook - FM&T
Cc: users_at_jersey.dev.java.net
Subject: Re: [Jersey] Cannot Instantiate new provider
On Jun 19, 2009, at 2:25 PM, Jonathan Cook - FM&T wrote:
> You're guess might be right. I commented out all the freemarker stuff
> and don't get those errors anymore. But obviously the app doesn't
> work.
>
> Would it be some freemarker configuration options do you think?
I think it is something more fundamental related to class loading and
the freemarker dependencies, since IIRC the constructor of your template
processor does not invoke any freemarker code, and infact the
constructor is not getting called, otherwise you would see it in the
log.
How about you try this little experiment, copy the code from the
TemplateProcessor into one of your resource classes, and seeing if a
useful exception pops out. Failing that create a simple servlet include
the code (if i guess right, you should not need to execute any code,
just the fact that the import statements are there seems to be causing
some issue).
Paul.
>
>
> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: 19 June 2009 13:18
> To: Jonathan Cook - FM&T
> Subject: Re: [Jersey] Cannot Instantiate new provider
>
>
> On Jun 19, 2009, at 2:01 PM, Jonathan Cook - FM&T wrote:
>
>> Thanks.
>>
>> Any ideas then or should I stick to using the list?
>
> The list is best, but i thought you might be uncomfortable disclosing
> certain types of info, if so feel free to email me privately certain
> information if you think it will help solve things faster.
>
> I recommend trying to upgrade it at all possible.
>
> My guess is there is something about your remote deployment scenario
> where the dependency on the freemarker stuff is causing issues. You
> might want to try commenting out the freemarker stuff in the
> implementation just to see your template processor gets instantiated
> and invoked.
>
> Paul.
>
>>
>> Jon
>>
>> -----Original Message-----
>> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
>> Sent: 19 June 2009 13:00
>> To: Jonathan Cook - FM&T
>> Subject: Re: [Jersey] Cannot Instantiate new provider
>>
>> Taking off list, just in case you do not want to disclose some
>> details.... let me know otherwise...
>>
>> On Jun 19, 2009, at 1:42 PM, Jonathan Cook - FM&T wrote:
>>
>>> Hi,
>>>
>>> It is a windows environment. Our deployment is manual. We copy over
>>> some folders/files. We don't have jersey installed as such the jars
>>> are just bundled with our release.
>>>
>>> We are using the same version of Jersey in both environments and it
>>> is
>>
>>> older than 1.0.2.
>>
>> I realized i got the version wrong, the warning error message
>> indicates version 0.6 or less.
>>
>>
>>> Why does it get to that line of code below?
>>
>> It is hard for me to help you because you are running a very old
>> version of Jersey. Can i suggest you upgrade?
>>
>> Paul.
>