You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2010/02/22 12:37:20 UTC
1.x itest/contribution-jee
Looking back over the list it seems there has been some progress on
choosing a version of open ejb that has the right fixes in. When I run
the itest/contribution-jee tests now I get a different error, for
example,
[INFO] ------------------------------------------------------------------------
[INFO] Building Apache Tuscany SCA iTest Contribution Java EE
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b
uild is platform dependent!
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] Copying 0 resource to META-INF
[WARNING] POM for 'org.apache.santuario:xmlsec:pom:1.4.0:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'opensaml:opensaml:pom:1.1:compile' is invalid.
Its dependencies (if any) will NOT be available to the current build.
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 3 source files to D:\sca-java-1.x\itest\contribution-jee\target
\classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 9 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 10 source files to D:\sca-java-1.x\itest\contribution-jee\targe
t\test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: D:\sca-java-1.x\itest\contribution-jee\target\
surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompWarAppcompT
estCase
INFO - Extracting jar: C:\DOCUME~1\slaws\LOCALS~1\Temp\temp7665.ear
INFO - Extracted path: C:\DOCUME~1\slaws\LOCALS~1\Temp\temp7665
INFO - Extracting jar: C:\Documents and Settings\slaws\Local Settings\Temp\temp7
665\itest-contribution-jee-samples-06-war-appcomp-contrib-implicit.war
INFO - Extracted path: C:\Documents and Settings\slaws\Local Settings\Temp\temp7
665\itest-contribution-jee-samples-06-war-appcomp-contrib-implicit
WARN - No application-client.xml found assuming annotations present: C:\Document
s and Settings\slaws\Local Settings\Temp\temp7665, module: itest-contribution-je
e-samples-00-jar-shared.jar
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.359 sec <<< FA
ILURE!
testSCAJarEarAppcomp(org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppco
mpWarAppcompTestCase) Time elapsed: 7.344 sec <<< ERROR!
java.lang.RuntimeException: org.apache.tuscany.sca.contribution.service.Contribu
tionException: org.apache.tuscany.sca.contribution.service.ContributionReadExcep
tion: org.apache.openejb.OpenEJBException: Unable to load servlet class: sample.
HelloworldEjbServlet: sample.HelloworldEjbServlet
at org.apache.tuscany.sca.test.contribution.jee.TestExternalEarModelReso
lver.resolveModel(TestExternalEarModelResolver.java:133)
at org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver.
resolveModel(ExtensibleModelResolver.java:179)
at org.apache.tuscany.sca.implementation.jee.xml.JEEImplementationProces
sor.resolve(JEEImplementationProcessor.java:203)
at org.apache.tuscany.sca.implementation.jee.xml.JEEImplementationProces
sor.resolve(JEEImplementationProcessor.java:64)
at org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProc
essorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcess
orExtensionPoint.java:388)
at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactP
rocessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
at org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImpl
ementation(BaseAssemblyProcessor.java:340)
at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(Compos
iteProcessor.java:1028)
at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(Compos
iteProcessor.java:90)
at org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProc
essorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcess
orExtensionPoint.java:388)
at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactP
rocessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolv
e(CompositeDocumentProcessor.java:231)
at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolv
e(CompositeDocumentProcessor.java:59)
at org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactPr
ocessor.resolve(ExtensibleURLArtifactProcessor.java:106)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.processResolvePhase(ContributionServiceImpl.java:625)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.addContribution(ContributionServiceImpl.java:430)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.contribute(ContributionServiceImpl.java:198)
at org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompWarAppco
mpTestCase.testSCAJarEarAppcomp(SCAJarEarAppcompWarAppcompTestCase.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
Method.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
lable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
thod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
hod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.ja
va:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
ner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.ja
va:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
tSet(AbstractDirectoryTestSuite.java:138)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
stractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
refireBooter.java:308)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
ava:879)
Caused by: org.apache.tuscany.sca.contribution.service.ContributionException: or
g.apache.tuscany.sca.contribution.service.ContributionReadException: org.apache.
openejb.OpenEJBException: Unable to load servlet class: sample.HelloworldEjbServ
let: sample.HelloworldEjbServlet
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.addContribution(ContributionServiceImpl.java:421)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.contribute(ContributionServiceImpl.java:198)
at org.apache.tuscany.sca.test.contribution.jee.TestExternalEarModelReso
lver.resolveModel(TestExternalEarModelResolver.java:104)
... 45 more
Caused by: org.apache.tuscany.sca.contribution.service.ContributionReadException
: org.apache.openejb.OpenEJBException: Unable to load servlet class: sample.Hell
oworldEjbServlet: sample.HelloworldEjbServlet
at org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper.getMetadat
aCompleteModules(JavaEEModuleHelper.java:118)
at org.apache.tuscany.sca.contribution.jee.impl.JavaEEIntrospectorImpl.i
ntrospectJeeArchive(JavaEEIntrospectorImpl.java:404)
at org.apache.tuscany.sca.contribution.jee.impl.JavaEEArchiveProcessor.r
ead(JavaEEArchiveProcessor.java:46)
at org.apache.tuscany.sca.contribution.jee.impl.JavaEEArchiveProcessor.r
ead(JavaEEArchiveProcessor.java:34)
at org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProce
ssorExtensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorExte
nsionPoint.java:222)
at org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactPr
ocessor.read(ExtensibleURLArtifactProcessor.java:96)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.processReadPhase(ContributionServiceImpl.java:541)
at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
mpl.addContribution(ContributionServiceImpl.java:419)
... 47 more
Caused by: org.apache.openejb.OpenEJBException: Unable to load servlet class: sa
mple.HelloworldEjbServlet: sample.HelloworldEjbServlet
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
ploy(AnnotationDeployer.java:557)
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
ploy(AnnotationDeployer.java:513)
at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeploye
r.java:169)
at org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper.getMetadat
aCompleteModules(JavaEEModuleHelper.java:116)
... 54 more
Caused by: java.lang.ClassNotFoundException: sample.HelloworldEjbServlet
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isolat
edClassLoader.java:103)
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
ploy(AnnotationDeployer.java:554)
... 57 more
Anyone else seeing this?
Simon
--
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
I don't imagine that would cause any problems. Assuming that you get a
full clean build of course.
Simon
Re: 1.x itest/contribution-jee
Posted by Ramkumar R <ra...@gmail.com>.
Hi Simon,
Looks like the JEE sample projects are already available as dependencies for
the itest-contribution-jee module.
Though we have the required dependencies included, maven simply does not
pickup the WAR or EAR file as dependency. The reason for the same is
explained here...
http://old.nabble.com/war-dependency-not-being-picked-up--td21414576.html
While in the eclipse environment, when I try to add the required WAR and EAR
as
the project dependency, the itest-contribution-jee module does not throw any
ClassNotFoundException.
So to make this work with maven, we need to update the maven-war-plugin
version that we
are using (currently 2.0.2) to 2.1-beta-1.
I am planning to update the WAR plugin in Tuscany 1.x branch. Let me know,
if there
are any concerns in doing so.
On Mon, Mar 1, 2010 at 8:24 PM, Simon Laws <si...@googlemail.com>wrote:
> Another thing that comes to mind to try so see if you can get up and
> running is to make all of the JEE samples projects dependencies of the
> JEE test project. Should have the effect of making them all available
> to the TCCL down in the guts of the JEE processing. Not a long term
> solution but, assuming that this gets you any further alone (and I
> haven't tried this so don't know if it will actually improve things or
> not), it would at least allow you to run/debug some of the tests and
> get a feel for them.
>
> Regards
>
> Simon
>
--
Thanks & Regards,
Ramkumar Ramalingam
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
Another thing that comes to mind to try so see if you can get up and
running is to make all of the JEE samples projects dependencies of the
JEE test project. Should have the effect of making them all available
to the TCCL down in the guts of the JEE processing. Not a long term
solution but, assuming that this gets you any further alone (and I
haven't tried this so don't know if it will actually improve things or
not), it would at least allow you to run/debug some of the tests and
get a feel for them.
Regards
Simon
Re: 1.x itest/contribution-jee
Posted by Ramkumar R <ra...@gmail.com>.
Currently, the JavaEEModuleHelper uses the
org.apache.openejb.config.DeploymentLoader, to load
the JEE archieve and due to some classloading issues, the itests were
failing.
Today, I tried writing a custom Deployer and asked the OpenEJB to use the
TCCL as the classloader.
Now, I see that some few tests are failing and some are throwing NPE.
Earlier, all the test case use throw
exception with ClassNotFoundException.
Results :
Failed tests:
testSCAJarEarNonenhanced(org.apache.tuscany.sca.test.contribution.jee.SCAJarEarNonenhancedTestCase)
testEjbAppcom(org.apache.tuscany.sca.test.contribution.jee.WarAppcompTestCase)
testContributeWAR(org.apache.tuscany.sca.test.contribution.jee.ContributionServiceTestCase)
testContributeWARwDeployable(org.apache.tuscany.sca.test.contribution.jee.ContributionServiceTestCase)
testContributeEAR_Enhanced19(org.apache.tuscany.sca.test.contribution.jee.ContributionServiceTestCase)
Tests in error:
testSCAJarEarAppcomp(org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompTestCase)
testSCAJarEarAppcomp(org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompWarAppcompTestCase)
Tests run: 18, Failures: 5, Errors: 2, Skipped: 3
I might need some help from Vamsi, to see if we are in the right approach to
resolve this issue.
On Wed, Feb 24, 2010 at 3:27 PM, Simon Laws <si...@googlemail.com>wrote:
> Ok Ram, be interested to hear what you find.
>
> Simon
>
--
Thanks & Regards,
Ramkumar Ramalingam
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
Ok Ram, be interested to hear what you find.
Simon
Re: 1.x itest/contribution-jee
Posted by Ramkumar R <ra...@gmail.com>.
On Mon, Feb 22, 2010 at 6:08 PM, Simon Laws <si...@googlemail.com>wrote:
> On Mon, Feb 22, 2010 at 11:55 AM, Ramkumar R <ra...@gmail.com>
> wrote:
> > Hi Simon,
> >
> > You are right, I have been seeing the same error message. I believe, this
> > error should
> > be because of Tuscany code due to some class loader issues for the
> following
> > reason...
> >
> > While testing the itest/contribution-jee with OpenEJB v3.0.1, I noticed
> two
> > kind of error messages
> >
> > 1. StringIndexOutofBoundException and
> > 2. ClassNotFoundException (exactly as shown in your mail)...
> >
> > After we moved to OpenEJB v3.1.2, the StringIndexOutofBoundException seem
> to
> > be fixed. And we
> > are now still seeing the ClassNotFoundException.
> >
> > While investigating on the same, came to know from Vamsi that... We have
> a
> > classloader issue with
> > WAR file because of the single classloader in the itest.
>
> Ok, they used to work so something must have changed that's causing
> the problem now. We need to understand this in more detail.
>
> >
> > A possible solution to this problem would be to start the Geronimo server
> as
> > part of the itest and load the contribution,
> > so that a temporary classloader is set as thread context class loader and
> > the contribution is processed.
> >
>
> +1 I think we need to understand how to run tests inside Geronimo with
> the Tuscany plugin installed also. Do you know how to do this?
>
Hi Simon,
I remember couple of weeks ago, I was testing the Tuscany Plugin for
Geronimo and
there seem to be some issues over there, and Vamsi is currently working on
the same to fix it.
I will have to work with Vamsi to understand the plugin and see how to
automate
the same for itest.
--
Thanks & Regards,
Ramkumar Ramalingam
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
I caught up with Vamsi off list and it seems that a clearer way of
specifying the classloaders that get applied to the in memory JEE
model is in order.
I'm reminded that the TCCL approach is taken currently so that
containers (such as Geronimo) can push classloaders into this JEE
model from outside of Tuscany and in this code you can see the
temporary classloaders are being replaced with TCCL (albeit by
reflection). Its made a little more opaque because this
JavaEEModuleHelper is called multiple times in the Geronimo plugin for
different levels of the JEE model (EAR, JAR, WAR) depending on the
contents of the JEE app being processed as a contribution.
I don't have specific answers yet but we need to document the end to
end operation of classloading in this space and make sure that we
understand how the code can work in all the situations we need it to.
It's particularly tricky making the JEE and SCA sides of the
classloading story work together I suggest we extend this thread for
a while as we exchange thoughts/ideas.
Simon
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
So the following code seems to be at the heart of this...
public class JavaEEModuleHelper {
public AppModule getMetadataCompleteModules(String jarFilePath)
throws ContributionReadException {
DeploymentLoader loader = new DeploymentLoader();
AppModule appModule = null;
try {
appModule = loader.load(new File(jarFilePath));
} catch (OpenEJBException e) {
throw new ContributionReadException(e);
}
// Set the Thread context class loader as the module's class
loader and all the Web and EJB modules
// inside. Otherwise, SCA annotations could not be processed
// TODO: Eliminate the use of reflection for setting the class
loader
java.lang.reflect.Field field = null;
try {
field = appModule.getClass().getDeclaredField("classLoader");
} catch (SecurityException e) {
throw new ContributionReadException(e);
} catch (NoSuchFieldException e) {
throw new ContributionReadException(e);
}
field.setAccessible(true);
try{
field.set(appModule,
Thread.currentThread().getContextClassLoader());
} catch (IllegalArgumentException e) {
throw new ContributionReadException(e);
} catch (IllegalAccessException e) {
throw new ContributionReadException(e);
}
for(EjbModule ejbModule:appModule.getEjbModules()) {
java.lang.reflect.Field field1 = null;
try {
field1 = ejbModule.getClass().getDeclaredField("classLoader");
} catch (SecurityException e) {
throw new ContributionReadException(e);
} catch (NoSuchFieldException e) {
throw new ContributionReadException(e);
}
field1.setAccessible(true);
try {
field1.set(ejbModule,
Thread.currentThread().getContextClassLoader());
} catch (IllegalArgumentException e) {
throw new ContributionReadException(e);
} catch (IllegalAccessException e) {
throw new ContributionReadException(e);
}
}
for(WebModule webModule:appModule.getWebModules()) {
java.lang.reflect.Field field1 = null;
try {
field1 = webModule.getClass().getDeclaredField("classLoader");
} catch (SecurityException e) {
throw new ContributionReadException(e);
} catch (NoSuchFieldException e) {
throw new ContributionReadException(e);
}
field1.setAccessible(true);
try {
field1.set(webModule,
Thread.currentThread().getContextClassLoader());
} catch (IllegalArgumentException e) {
throw new ContributionReadException(e);
} catch (IllegalAccessException e) {
throw new ContributionReadException(e);
}
}
// Process deployment descriptor files
ReadDescriptors readDescriptors = new ReadDescriptors();
try {
readDescriptors.deploy(appModule);
} catch (OpenEJBException e) {
throw new ContributionReadException(e);
}
// Process annotations
AnnotationDeployer annDeployer = new AnnotationDeployer();
try {
annDeployer.deploy(appModule);
} catch (OpenEJBException e) {
throw new ContributionReadException(e);
}
return appModule;
}
}
We're using OpenEJB to create the the module representation of the JEE
app and we are here replacing the classloaders in the resulting model
with TCCL. This is unlikely to have the correct entries on it such
that the contents of the EAR and the WAR and JAR it contains, can be
located. This has apparently worked in the past so I'm a little
confused. May be this holds together in an container environment but
I'm suspicious. I'd like to understand
- what classloaders OpenEJB uses/created by default in the JSE and JEE
environments. In JEE environment I'd expect it to rely on the
containers EAR classloader hierarchy.
- what we think is on the TCCL in this case
- what the comment "Otherwise, SCA annotations could not be processed" means
Anyone have any insights to remove the need to trawl through the code?
Simon
Re: 1.x itest/contribution-jee
Posted by Simon Laws <si...@googlemail.com>.
On Mon, Feb 22, 2010 at 11:55 AM, Ramkumar R <ra...@gmail.com> wrote:
> Hi Simon,
>
> You are right, I have been seeing the same error message. I believe, this
> error should
> be because of Tuscany code due to some class loader issues for the following
> reason...
>
> While testing the itest/contribution-jee with OpenEJB v3.0.1, I noticed two
> kind of error messages
>
> 1. StringIndexOutofBoundException and
> 2. ClassNotFoundException (exactly as shown in your mail)...
>
> After we moved to OpenEJB v3.1.2, the StringIndexOutofBoundException seem to
> be fixed. And we
> are now still seeing the ClassNotFoundException.
>
> While investigating on the same, came to know from Vamsi that... We have a
> classloader issue with
> WAR file because of the single classloader in the itest.
Ok, they used to work so something must have changed that's causing
the problem now. We need to understand this in more detail.
>
> A possible solution to this problem would be to start the Geronimo server as
> part of the itest and load the contribution,
> so that a temporary classloader is set as thread context class loader and
> the contribution is processed.
>
+1 I think we need to understand how to run tests inside Geronimo with
the Tuscany plugin installed also. Do you know how to do this?
Simon
Re: 1.x itest/contribution-jee
Posted by Ramkumar R <ra...@gmail.com>.
Hi Simon,
You are right, I have been seeing the same error message. I believe, this
error should
be because of Tuscany code due to some class loader issues for the following
reason...
While testing the itest/contribution-jee with OpenEJB v3.0.1, I noticed two
kind of error messages
1. StringIndexOutofBoundException and
2. ClassNotFoundException (exactly as shown in your mail)...
After we moved to OpenEJB v3.1.2, the StringIndexOutofBoundException seem to
be fixed. And we
are now still seeing the ClassNotFoundException.
While investigating on the same, came to know from Vamsi that... We have a
classloader issue with
WAR file because of the single classloader in the itest.
A possible solution to this problem would be to start the Geronimo server as
part of the itest and load the contribution,
so that a temporary classloader is set as thread context class loader and
the contribution is processed.
On Mon, Feb 22, 2010 at 5:07 PM, Simon Laws <si...@googlemail.com>wrote:
> Looking back over the list it seems there has been some progress on
> choosing a version of open ejb that has the right fixes in. When I run
> the itest/contribution-jee tests now I get a different error, for
> example,
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Apache Tuscany SCA iTest Contribution Java EE
> [INFO] task-segment: [install]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [resources:resources {execution: default-resources}]
> [WARNING] File encoding has not been set, using platform encoding Cp1252,
> i.e. b
> uild is platform dependent!
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources,
> i.e. build is platform dependent!
> [INFO] Copying 2 resources
> [INFO] Copying 0 resource to META-INF
> [WARNING] POM for 'org.apache.santuario:xmlsec:pom:1.4.0:compile' is
> invalid.
>
> Its dependencies (if any) will NOT be available to the current build.
> [WARNING] POM for 'opensaml:opensaml:pom:1.1:compile' is invalid.
>
> Its dependencies (if any) will NOT be available to the current build.
> [INFO] [compiler:compile {execution: default-compile}]
> [INFO] Compiling 3 source files to
> D:\sca-java-1.x\itest\contribution-jee\target
> \classes
> [INFO] [resources:testResources {execution: default-testResources}]
> [WARNING] Using platform encoding (Cp1252 actually) to copy filtered
> resources,
> i.e. build is platform dependent!
> [INFO] Copying 9 resources
> [INFO] [compiler:testCompile {execution: default-testCompile}]
> [INFO] Compiling 10 source files to
> D:\sca-java-1.x\itest\contribution-jee\targe
> t\test-classes
> [INFO] [surefire:test {execution: default-test}]
> [INFO] Surefire report directory:
> D:\sca-java-1.x\itest\contribution-jee\target\
> surefire-reports
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running
> org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompWarAppcompT
> estCase
> INFO - Extracting jar: C:\DOCUME~1\slaws\LOCALS~1\Temp\temp7665.ear
> INFO - Extracted path: C:\DOCUME~1\slaws\LOCALS~1\Temp\temp7665
> INFO - Extracting jar: C:\Documents and Settings\slaws\Local
> Settings\Temp\temp7
> 665\itest-contribution-jee-samples-06-war-appcomp-contrib-implicit.war
> INFO - Extracted path: C:\Documents and Settings\slaws\Local
> Settings\Temp\temp7
> 665\itest-contribution-jee-samples-06-war-appcomp-contrib-implicit
> WARN - No application-client.xml found assuming annotations present:
> C:\Document
> s and Settings\slaws\Local Settings\Temp\temp7665, module:
> itest-contribution-je
> e-samples-00-jar-shared.jar
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.359 sec
> <<< FA
> ILURE!
>
> testSCAJarEarAppcomp(org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppco
> mpWarAppcompTestCase) Time elapsed: 7.344 sec <<< ERROR!
> java.lang.RuntimeException:
> org.apache.tuscany.sca.contribution.service.Contribu
> tionException:
> org.apache.tuscany.sca.contribution.service.ContributionReadExcep
> tion: org.apache.openejb.OpenEJBException: Unable to load servlet class:
> sample.
> HelloworldEjbServlet: sample.HelloworldEjbServlet
> at
> org.apache.tuscany.sca.test.contribution.jee.TestExternalEarModelReso
> lver.resolveModel(TestExternalEarModelResolver.java:133)
> at
> org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver.
> resolveModel(ExtensibleModelResolver.java:179)
> at
> org.apache.tuscany.sca.implementation.jee.xml.JEEImplementationProces
> sor.resolve(JEEImplementationProcessor.java:203)
> at
> org.apache.tuscany.sca.implementation.jee.xml.JEEImplementationProces
> sor.resolve(JEEImplementationProcessor.java:64)
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProc
>
> essorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcess
> orExtensionPoint.java:388)
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactP
> rocessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
> at
> org.apache.tuscany.sca.assembly.xml.BaseAssemblyProcessor.resolveImpl
> ementation(BaseAssemblyProcessor.java:340)
> at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(Compos
> iteProcessor.java:1028)
> at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.resolve(Compos
> iteProcessor.java:90)
> at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProc
>
> essorExtensionPoint$LazyStAXArtifactProcessor.resolve(DefaultStAXArtifactProcess
> orExtensionPoint.java:388)
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactP
> rocessor.resolve(ExtensibleStAXArtifactProcessor.java:183)
> at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolv
> e(CompositeDocumentProcessor.java:231)
> at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.resolv
> e(CompositeDocumentProcessor.java:59)
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactPr
> ocessor.resolve(ExtensibleURLArtifactProcessor.java:106)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.processResolvePhase(ContributionServiceImpl.java:625)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.addContribution(ContributionServiceImpl.java:430)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.contribute(ContributionServiceImpl.java:198)
> at
> org.apache.tuscany.sca.test.contribution.jee.SCAJarEarAppcompWarAppco
> mpTestCase.testSCAJarEarAppcomp(SCAJarEarAppcompWarAppcompTestCase.java:91)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(Framework
> Method.java:44)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCal
> lable.java:15)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMe
> thod.java:41)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMet
> hod.java:20)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
> java:28)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.ja
> va:31)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
> ner.java:73)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
> ner.java:46)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
> at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.
> java:28)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.ja
> va:31)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
> java:62)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
> tSet(AbstractDirectoryTestSuite.java:138)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
> stractDirectoryTestSuite.java:125)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
> refireBooter.java:308)
> at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
> ava:879)
> Caused by:
> org.apache.tuscany.sca.contribution.service.ContributionException: or
> g.apache.tuscany.sca.contribution.service.ContributionReadException:
> org.apache.
> openejb.OpenEJBException: Unable to load servlet class:
> sample.HelloworldEjbServ
> let: sample.HelloworldEjbServlet
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.addContribution(ContributionServiceImpl.java:421)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.contribute(ContributionServiceImpl.java:198)
> at
> org.apache.tuscany.sca.test.contribution.jee.TestExternalEarModelReso
> lver.resolveModel(TestExternalEarModelResolver.java:104)
> ... 45 more
> Caused by:
> org.apache.tuscany.sca.contribution.service.ContributionReadException
> : org.apache.openejb.OpenEJBException: Unable to load servlet class:
> sample.Hell
> oworldEjbServlet: sample.HelloworldEjbServlet
> at
> org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper.getMetadat
> aCompleteModules(JavaEEModuleHelper.java:118)
> at
> org.apache.tuscany.sca.contribution.jee.impl.JavaEEIntrospectorImpl.i
> ntrospectJeeArchive(JavaEEIntrospectorImpl.java:404)
> at
> org.apache.tuscany.sca.contribution.jee.impl.JavaEEArchiveProcessor.r
> ead(JavaEEArchiveProcessor.java:46)
> at
> org.apache.tuscany.sca.contribution.jee.impl.JavaEEArchiveProcessor.r
> ead(JavaEEArchiveProcessor.java:34)
> at
> org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProce
>
> ssorExtensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorExte
> nsionPoint.java:222)
> at
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactPr
> ocessor.read(ExtensibleURLArtifactProcessor.java:96)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.processReadPhase(ContributionServiceImpl.java:541)
> at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceI
> mpl.addContribution(ContributionServiceImpl.java:419)
> ... 47 more
> Caused by: org.apache.openejb.OpenEJBException: Unable to load servlet
> class: sa
> mple.HelloworldEjbServlet: sample.HelloworldEjbServlet
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
> ploy(AnnotationDeployer.java:557)
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
> ploy(AnnotationDeployer.java:513)
> at
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeploye
> r.java:169)
> at
> org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper.getMetadat
> aCompleteModules(JavaEEModuleHelper.java:116)
> ... 54 more
> Caused by: java.lang.ClassNotFoundException: sample.HelloworldEjbServlet
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at
> org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isolat
> edClassLoader.java:103)
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.de
> ploy(AnnotationDeployer.java:554)
> ... 57 more
>
> Anyone else seeing this?
>
> Simon
>
> --
> Apache Tuscany committer: tuscany.apache.org
> Co-author of a book about Tuscany and SCA: tuscanyinaction.com
>
--
Thanks & Regards,
Ramkumar Ramalingam