You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mean_bcp <go...@versatile.com> on 2015/09/15 17:34:11 UTC

ClassNotFoundException for my servlet class?

This is in the logs when I start up. This is deployed as part of an ear in
the /apps directory.

SEVERE: Error deploying CXF webservice for servlet [my class]
java.lang.ClassNotFoundException: [my class]

[my class] is exactly the same in both cases. How can tomee fail to find the
class, when it's only trying to deploy it because there's a @WebService
annotation in the class itself?

I'm not sure how to troubleshoot this, any advice or suggestions are most
welcome!



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by mean_bcp <go...@versatile.com>.
Wow that was it! I never would have suspected that was related to the error
message.

I double-checked the .ear file that was deployed to WebLogic and it has
those same generic IDs, so WebLogic must not care the same way that Tomee
does.

Thanks so much for your help, it was greatly appreciated! I would never have
figured that out on my own.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676386.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
opened very quickly but seems you use the same webapp id for both webapp
(id="WebApp_ID"), change it in one of both please


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-30 8:55 GMT-07:00 mean_bcp <go...@versatile.com>:

> Sorry for the delay. Here is a copy of the project with all logic removed.
> I
> am using tomee-plus-1.7.2, the only change I made is to configure apps as a
> deploy directory, and I drop the ear in there.
>
> https://github.com/mean-bcp/classnotfound
>
> Also, if I haven't mentioned it yet, I greatly appreciate your help so far!
>
> Sep 30, 2015 10:21:03 AM org.apache.openejb.server.webservices.WsService
> afterApplicationCreated
> SEVERE: Error deploying CXF webservice for servlet
> com.comcast.dollee.ws.Foo
> java.lang.ClassNotFoundException: com.comcast.dollee.ws.Foo
>         at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
>         at
>
> org.apache.tomee.catalina.LazyStopWebappClassLoader.loadWithDelegate(LazyStopWebappClassLoader.java:178)
>         at
>
> org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:168)
>         at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
>         at
>
> org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:410)
>         at
>
> org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676379.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: ClassNotFoundException for my servlet class?

Posted by mean_bcp <go...@versatile.com>.
Sorry for the delay. Here is a copy of the project with all logic removed. I
am using tomee-plus-1.7.2, the only change I made is to configure apps as a
deploy directory, and I drop the ear in there.

https://github.com/mean-bcp/classnotfound

Also, if I haven't mentioned it yet, I greatly appreciate your help so far!

Sep 30, 2015 10:21:03 AM org.apache.openejb.server.webservices.WsService
afterApplicationCreated
SEVERE: Error deploying CXF webservice for servlet com.comcast.dollee.ws.Foo
java.lang.ClassNotFoundException: com.comcast.dollee.ws.Foo
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
        at
org.apache.tomee.catalina.LazyStopWebappClassLoader.loadWithDelegate(LazyStopWebappClassLoader.java:178)
        at
org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:168)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
        at
org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:410)
        at
org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676379.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok then maybe time to try to reproduce with a sample project you can share
on github or any public website.

Should be something easy but doesnt appear up in the mailbox ;).
Le 28 sept. 2015 08:27, "mean_bcp" <go...@versatile.com> a écrit :

> I finally got some linux boxes set up for testing, so I am not using cygwin
> anymore, and I still get the same exception.
>
> Class is defined like this:
>
> package com.comcast.dollee.ws;
> ...
>
> @WebService
> public class Dollee {
>
> I am trying to convert this application from WebLogic (where it runs fine)
> to Tomee. I am sure I am missing something simple, but I cannot figure it
> out.
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676348.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: ClassNotFoundException for my servlet class?

Posted by mean_bcp <go...@versatile.com>.
I finally got some linux boxes set up for testing, so I am not using cygwin
anymore, and I still get the same exception.

Class is defined like this:

package com.comcast.dollee.ws;
...

@WebService
public class Dollee {

I am trying to convert this application from WebLogic (where it runs fine)
to Tomee. I am sure I am missing something simple, but I cannot figure it
out.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676348.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yeah, I guess the paths parsing can have some issues then. DOS +
startup.bat/catalina.bat should just work fine


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-16 9:40 GMT-07:00 mean_bcp <go...@versatile.com>:

> It's always cygwin
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676261.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: ClassNotFoundException for my servlet class?

Posted by mean_bcp <go...@versatile.com>.
It's always cygwin 



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676261.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Are you using cygwin? If so can you use a plain dos shell instead?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-16 7:33 GMT-07:00 mean_bcp <go...@versatile.com>:

> Originally, I had nothing in the web.xml, just a JAX-WS @WebService
> annotation. That's what was so mystifying - if the class couldn't be found,
> then how did it find the annotation in the class?
>
> I've since added servlet tags, but it still can't find my class. It's
> definitely in WEB-INF/classes.
>
>
> /C/apache-tomee-plus-1.7.2/apps/dollee-appserver-20150915/DolleeWS/WEB-INF/classes/com/comcast/dollee/ws$
> ls -lat
> total 44
> drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 jaxws
> drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 .
> drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 ..
> -rwxrwxr-x+ 1 Gene None 17375 Sep  1 11:31 Dollee.class
>
> <servlet>
>     <servlet-name>DolleeServiceServlethttp</servlet-name>
>     <servlet-class>com.comcast.dollee.ws.Dollee</servlet-class>
>     <load-on-startup>0</load-on-startup>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>DolleeServiceServlethttp</servlet-name>
>     <url-pattern>/DolleeService</url-pattern>
>   </servlet-mapping>
>
> SEVERE: Error deploying CXF webservice for servlet DolleeServiceServlethttp
> java.lang.ClassNotFoundException: com.comcast.dollee.ws.Dollee
>         at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
>         at
>
> org.apache.tomee.catalina.LazyStopWebappClassLoader.loadWithDelegate(LazyStopWebappClassLoader.java:178)
>         at
>
> org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:168)
>         at
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
>         at
>
> org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:410)
>         at
>
> org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676247.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: ClassNotFoundException for my servlet class?

Posted by mean_bcp <go...@versatile.com>.
Originally, I had nothing in the web.xml, just a JAX-WS @WebService
annotation. That's what was so mystifying - if the class couldn't be found,
then how did it find the annotation in the class?

I've since added servlet tags, but it still can't find my class. It's
definitely in WEB-INF/classes.

/C/apache-tomee-plus-1.7.2/apps/dollee-appserver-20150915/DolleeWS/WEB-INF/classes/com/comcast/dollee/ws$
ls -lat
total 44
drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 jaxws
drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 .
drwxrwxr-x+ 1 Gene None     0 Sep 15 11:22 ..
-rwxrwxr-x+ 1 Gene None 17375 Sep  1 11:31 Dollee.class

<servlet>
    <servlet-name>DolleeServiceServlethttp</servlet-name>
    <servlet-class>com.comcast.dollee.ws.Dollee</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>DolleeServiceServlethttp</servlet-name>
    <url-pattern>/DolleeService</url-pattern>
  </servlet-mapping>

SEVERE: Error deploying CXF webservice for servlet DolleeServiceServlethttp
java.lang.ClassNotFoundException: com.comcast.dollee.ws.Dollee
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
        at
org.apache.tomee.catalina.LazyStopWebappClassLoader.loadWithDelegate(LazyStopWebappClassLoader.java:178)
        at
org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:168)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
        at
org.apache.openejb.server.webservices.WsService.afterApplicationCreated(WsService.java:410)
        at
org.apache.tomee.webservices.TomeeJaxWsService.afterApplicationCreated(TomeeJaxWsService.java:56)



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221p4676247.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ClassNotFoundException for my servlet class?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

how did you define it in web.xml?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-15 8:34 GMT-07:00 mean_bcp <go...@versatile.com>:

> This is in the logs when I start up. This is deployed as part of an ear in
> the /apps directory.
>
> SEVERE: Error deploying CXF webservice for servlet [my class]
> java.lang.ClassNotFoundException: [my class]
>
> [my class] is exactly the same in both cases. How can tomee fail to find
> the
> class, when it's only trying to deploy it because there's a @WebService
> annotation in the class itself?
>
> I'm not sure how to troubleshoot this, any advice or suggestions are most
> welcome!
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ClassNotFoundException-for-my-servlet-class-tp4676221.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>