Looks like things are still working because the composite file
explicitly add the SDO factory

   <dbsdo:import.sdo factory="helloworld.HelloworldFactory"/>

As for the WEB-INF\classes\, there was some discussion before, and at
that time, we decided to keep the artifact URI as is, so I have
introduced some more logic on the SDO Processor to handle this
scenario, and get the right class name when it's in a web app. I also
removed the import.sdo from the sample application composite file.

BTW, one way or another, I still get an exception on the JSP, did you see that ?

[1] http://www.mail-archive.com/tuscany-dev@ws.apache.org/msg18008.html


On 7/31/07, ant elder <[EMAIL PROTECTED]> wrote:
> On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Author: antelder
> > Date: Tue Jul 31 03:05:21 2007
> > New Revision: 561293
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=561293
> > Log:
> > Fix NPE when clazz not resolved
> >
> > Modified:
> >
> >     
> > incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOPostProcessor.java
> >
> > Modified:
> > incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOPostProcessor.java
> > URL:
> > http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOPostProcessor.java?view=diff&rev=561293&r1=561292&r2=561293
> >
> > ==============================================================================
> > ---
> > incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOPostProcessor.java
> > (original)
> > +++
> > incubator/tuscany/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOPostProcessor.java
> > Tue Jul 31 03:05:21 2007
> > @@ -56,7 +56,7 @@
> >                  String factoryName = getFactoryClassName(artifactURI);
> >                  ClassReference clazz = new ClassReference(factoryName);
> >                  clazz = contribution.getModelResolver().resolveModel(
> > ClassReference.class, clazz);
> > -                if (clazz.getClass() != null) {
> > +                if (clazz.getJavaClass() != null) {
> >                      try {
> >                          //check if it's a SDO factory by introspecting
> > INSTANCE field
> >                          if (isSDOFactory(clazz.getJavaClass())) {
>
>
>
> The  actual cause of this problem seems to be a different bug where the
> class name is prefixed with "WEB-INF\classes\" when running in a webapp so
> the classes never get resolved. Although that doesn't seem to stop things
> from still working ok so I'm not sure what this is code is really trying to
> do? Can see this by debugging with a break point in the above code and
> running the new helloworld sdo webapp sample.
>
>    ...ant
>


-- 
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to