You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2007/11/30 14:50:45 UTC

ClassNotFoundException in domain for application classes when registering a remote node

I'm getting the exception below when i try to register a contribution in a
node thats running in a separate JVM from the domain. Does this mean all
contributions in nodes also need to be in the classpath used by the domain?

INFO: Registered node: http://localhost:8080/tuscany/ at endpoint
http://L32H83W:8080/tuscany//SCANodeManagerComponent/SCANodeManagerService
30-Nov-2007 13:46:23
org.apache.tuscany.sca.domain.impl.SCADomainImplregisterContribution
SEVERE: Exception when registering contribution C:\Tomcat\apache-
tomcat-6.0.10\webapps\sample-helloworld-ws-service-webapp\org.apache.tuscany.sca.domain.DomainException:
java.lang.ClassNotFoundException: helloworld.HelloWorldImpl

   ...ant

Re: ClassNotFoundException in domain for application classes when registering a remote node

Posted by ant elder <an...@gmail.com>.
On Nov 30, 2007 3:32 PM, Simon Laws <si...@googlemail.com> wrote:

<snip>

I don't know what your contribution looks like but I'm going to try getting
> your web app code running in the store sample so I can move the sample
> distributed scenario on a bit and help you out. Any pointers to where I
> should start?
>

OK I've tried to tidy things up a bit so you could have a go but remember it
is still right in the middle of getting done so its all a bit hacky, and
nothing is finished or working properly or beautiful yet :)

There's a distribution/tomcat folder, building that creates an archive in
the target directory which can be unziped over a Tomcat install to add
things like all the Tuscany jars to the tomcat lib folder. You then have to
manually update the Tomcat conf/server.xml <Host> to include className= for
the Tuscany class, eg:

      <Host name="localhost"  appBase="webapps"
            className="org.apache.tuscany.sca.runtime.tomcat.TuscanyHost"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

Now when Tomcat starts up it should start a standalone sca node. There will
be FileNotFoundException errors for all the webapps that don't have any
WEB-INF/classes folder which can be ignored.

I've updated the samples so helloworld-ws-service creates a deployable
contribution that you can drop into the Tomcat sca-contributions folder
which should get added to the node automatically , can verify its worked by
getting the wsdl at http://localhost:8080/tuscany/HelloWorldService?wsdl.
And there's a webapp sample, helloworld-ws-deep-webapp, that creates a
webapp war which includes a composite but no Tuscany jars or Tuscany things
in the web.xml, doesn't yet work to deploy that without a tomcat restart
yet, but after a restart you can test the sca endpoint by getting the wsdl
at http://localhost:8080/tuscany/HelloWorldComponent?wsdl

There's a properties file in the sca-contributions folder and in there you
can define the url of and sca domain to have the tomcat node be part of, not
sure if that actually works properly yet.

   ...ant

Re: ClassNotFoundException in domain for application classes when registering a remote node

Posted by Simon Laws <si...@googlemail.com>.
On Nov 30, 2007 3:05 PM, Simon Laws <si...@googlemail.com> wrote:

>
>
> On Nov 30, 2007 2:18 PM, ant elder <an...@apache.org> wrote:
>
> > On Nov 30, 2007 2:05 PM, Simon Laws <si...@googlemail.com> wrote:
> >
> > >
> > >
> > > On Nov 30, 2007 1:50 PM, ant elder < ant.elder@gmail.com> wrote:
> > >
> > > > I'm getting the exception below when i try to register a
> > contribution in
> > > > a
> > > > node thats running in a separate JVM from the domain. Does this mean
> > all
> > > > contributions in nodes also need to be in the classpath used by the
> > > > domain?
> > > >
> > > > INFO: Registered node: http://localhost:8080/tuscany/ at endpoint
> > > >
> > > >
> > http://L32H83W:8080/tuscany//SCANodeManagerComponent/SCANodeManagerService
> > > > 30-Nov-2007 13:46:23
> > > > org.apache.tuscany.sca.domain.impl.SCADomainImplregisterContribution
> > > > SEVERE: Exception when registering contribution C:\Tomcat\apache-
> > > >
> > > >
> > tomcat-6.0.10\webapps\sample-helloworld-ws-service-webapp\org.apache.tuscany.sca.domain.DomainException:
> > > > java.lang.ClassNotFoundException: helloworld.HelloWorldImpl
> > > >
> > > >   ...ant
> > > >
> > > Yes, the domain reads the contribution to build the domain model.
> > >
> > > - we don't at the moment have a mechanism of moving contributions
> > > physically between domain/node or node/domain. Only the id and
> > location is
> > > passed. A shared filesystem is assumed.
> > > - we could relax this restriction when you add a contribution to a
> > node
> > > but we would still need to pass the model back to the domain somehow.
> > Would
> > > require work.
> > >
> > > In your case when you drop the contribution (war/jar?) into the web
> > app
> > > container what do you provide as the contribution URL? Can we make
> > sure that
> > > is an absolute URL and make sure that the domain can see it?
> > >
> > > Simon
> > >
> >
> > I see. I think it is using an absolute URL, (the error message above
> > includes it), maybe the problem is the contribution URL is to the webapp
> > root folder but the classes are inside that in the WEB-INF\classes
> > directory
> > so the don't get found.
> >
> >   ...ant
> >
> Doh. I should have noticed that from the error message. The war is
> presented to the domain as a file contribution and hence the domain doesn't
> know to look in WEB-INF\classes as you say.
>
> I works in the node by accident as Tomcat has already processed the war
> and put the classes on the classpath.  I expect we need to present it as a
> war contribution and set the model resolver up so that it can find the
> classes in WEB-INF\classes. It doesn't seem that we support war
> contributions now. I'll have a look to see what happens in Contribution. Any
> Contribution experts out there that can comment?
>
> Simon
>
I just chatted with Rajini and she suggested we try using the WEB\classes
dir as the contribution root and treat it as a file contribution as a work
around.

I don't know what your contribution looks like but I'm going to try getting
your web app code running in the store sample so I can move the sample
distributed scenario on a bit and help you out. Any pointers to where I
should start?

Simon

Simon

Re: ClassNotFoundException in domain for application classes when registering a remote node

Posted by Simon Laws <si...@googlemail.com>.
On Nov 30, 2007 2:18 PM, ant elder <an...@apache.org> wrote:

> On Nov 30, 2007 2:05 PM, Simon Laws <si...@googlemail.com> wrote:
>
> >
> >
> > On Nov 30, 2007 1:50 PM, ant elder <an...@gmail.com> wrote:
> >
> > > I'm getting the exception below when i try to register a contribution
> in
> > > a
> > > node thats running in a separate JVM from the domain. Does this mean
> all
> > > contributions in nodes also need to be in the classpath used by the
> > > domain?
> > >
> > > INFO: Registered node: http://localhost:8080/tuscany/ at endpoint
> > >
> > >
> http://L32H83W:8080/tuscany//SCANodeManagerComponent/SCANodeManagerService
> > > 30-Nov-2007 13:46:23
> > > org.apache.tuscany.sca.domain.impl.SCADomainImplregisterContribution
> > > SEVERE: Exception when registering contribution C:\Tomcat\apache-
> > >
> > >
> tomcat-6.0.10\webapps\sample-helloworld-ws-service-webapp\org.apache.tuscany.sca.domain.DomainException:
> > > java.lang.ClassNotFoundException: helloworld.HelloWorldImpl
> > >
> > >   ...ant
> > >
> > Yes, the domain reads the contribution to build the domain model.
> >
> > - we don't at the moment have a mechanism of moving contributions
> > physically between domain/node or node/domain. Only the id and location
> is
> > passed. A shared filesystem is assumed.
> > - we could relax this restriction when you add a contribution to a node
> > but we would still need to pass the model back to the domain somehow.
> Would
> > require work.
> >
> > In your case when you drop the contribution (war/jar?) into the web app
> > container what do you provide as the contribution URL? Can we make sure
> that
> > is an absolute URL and make sure that the domain can see it?
> >
> > Simon
> >
>
> I see. I think it is using an absolute URL, (the error message above
> includes it), maybe the problem is the contribution URL is to the webapp
> root folder but the classes are inside that in the WEB-INF\classes
> directory
> so the don't get found.
>
>   ...ant
>
Doh. I should have noticed that from the error message. The war is presented
to the domain as a file contribution and hence the domain doesn't know to
look in WEB-INF\classes as you say.

I works in the node by accident as Tomcat has already processed the war and
put the classes on the classpath.  I expect we need to present it as a war
contribution and set the model resolver up so that it can find the classes
in WEB-INF\classes. It doesn't seem that we support war contributions now.
I'll have a look to see what happens in Contribution. Any Contribution
experts out there that can comment?

Simon

Re: ClassNotFoundException in domain for application classes when registering a remote node

Posted by ant elder <an...@apache.org>.
On Nov 30, 2007 2:05 PM, Simon Laws <si...@googlemail.com> wrote:

>
>
> On Nov 30, 2007 1:50 PM, ant elder <an...@gmail.com> wrote:
>
> > I'm getting the exception below when i try to register a contribution in
> > a
> > node thats running in a separate JVM from the domain. Does this mean all
> > contributions in nodes also need to be in the classpath used by the
> > domain?
> >
> > INFO: Registered node: http://localhost:8080/tuscany/ at endpoint
> >
> > http://L32H83W:8080/tuscany//SCANodeManagerComponent/SCANodeManagerService
> > 30-Nov-2007 13:46:23
> > org.apache.tuscany.sca.domain.impl.SCADomainImplregisterContribution
> > SEVERE: Exception when registering contribution C:\Tomcat\apache-
> >
> > tomcat-6.0.10\webapps\sample-helloworld-ws-service-webapp\org.apache.tuscany.sca.domain.DomainException:
> > java.lang.ClassNotFoundException: helloworld.HelloWorldImpl
> >
> >   ...ant
> >
> Yes, the domain reads the contribution to build the domain model.
>
> - we don't at the moment have a mechanism of moving contributions
> physically between domain/node or node/domain. Only the id and location is
> passed. A shared filesystem is assumed.
> - we could relax this restriction when you add a contribution to a node
> but we would still need to pass the model back to the domain somehow. Would
> require work.
>
> In your case when you drop the contribution (war/jar?) into the web app
> container what do you provide as the contribution URL? Can we make sure that
> is an absolute URL and make sure that the domain can see it?
>
> Simon
>

I see. I think it is using an absolute URL, (the error message above
includes it), maybe the problem is the contribution URL is to the webapp
root folder but the classes are inside that in the WEB-INF\classes directory
so the don't get found.

   ...ant

Re: ClassNotFoundException in domain for application classes when registering a remote node

Posted by Simon Laws <si...@googlemail.com>.
On Nov 30, 2007 1:50 PM, ant elder <an...@gmail.com> wrote:

> I'm getting the exception below when i try to register a contribution in a
> node thats running in a separate JVM from the domain. Does this mean all
> contributions in nodes also need to be in the classpath used by the
> domain?
>
> INFO: Registered node: http://localhost:8080/tuscany/ at endpoint
> http://L32H83W:8080/tuscany//SCANodeManagerComponent/SCANodeManagerService
> 30-Nov-2007 13:46:23
> org.apache.tuscany.sca.domain.impl.SCADomainImplregisterContribution
> SEVERE: Exception when registering contribution C:\Tomcat\apache-
>
> tomcat-6.0.10\webapps\sample-helloworld-ws-service-webapp\org.apache.tuscany.sca.domain.DomainException:
> java.lang.ClassNotFoundException: helloworld.HelloWorldImpl
>
>   ...ant
>
Yes, the domain reads the contribution to build the domain model.

- we don't at the moment have a mechanism of moving contributions physically
between domain/node or node/domain. Only the id and location is passed. A
shared filesystem is assumed.
- we could relax this restriction when you add a contribution to a node but
we would still need to pass the model back to the domain somehow. Would
require work.

In your case when you drop the contribution (war/jar?) into the web app
container what do you provide as the contribution URL? Can we make sure that
is an absolute URL and make sure that the domain can see it?

Simon