[
https://issues.apache.org/jira/browse/JCLOUDS-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756564#comment-13756564
]
Raghunandan Rao commented on JCLOUDS-259:
-----------------------------------------
ok, I moved to 1.6.0 version but still same error. 1.6.2-incubating was not
compiling because it doesnt have other dependency jars of same version. Other
thing is, we are using vsphere jclouds lab version. Since there is no maven
repository for that, we have the jar file as external lib and during build it
goes to same place where other jars are present. I saw the ServiceLoader is
causing the issue, it is not able to find VSphereApiMetadata class in this jar.
But this happens rarely not consistent. I further dug the hole, then found the
ProviderRegistry has list of providers and that is getting cleared off
automatically at runtime. I get "provider aws-ec2 is not in the list of
providers{}" very often. So I have two problems one is "class not found" and
other "provider aws-ec2 is not in the list of providers{}". Both are not
consistent. I saw various forums and found ServiceLoader is not reliable API.
Can you please suggest what can be done. Thanks.
> Caused by: java.lang.ClassNotFoundException:
> org.jclouds.apis.internal.BaseApiMetadata
> --------------------------------------------------------------------------------------
>
> Key: JCLOUDS-259
> URL: https://issues.apache.org/jira/browse/JCLOUDS-259
> Project: jclouds
> Issue Type: Bug
> Components: jclouds-compute
> Affects Versions: 1.6.0
> Environment: unix, jetspeed portal webapp
> Reporter: Raghunandan Rao
>
> Hi,
> I am facing class not found issue like this Caused by:
> java.lang.ClassNotFoundException: org.jclouds.apis.internal.BaseApiMetadata.
> Will be great if you can resolve.
> For some calls it works but some calls it wont. Attached is the stacktrace
> Caused by: java.lang.NoClassDefFoundError:
> org/jclouds/apis/internal/BaseApiMetadata
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
> at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:249)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1700)
> at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:249)
> at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:346)
> at java.util.ServiceLoader$1.next(ServiceLoader.java:428)
> at
> com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:354)
> at
> com.google.common.collect.ImmutableSet$Builder.addAll(ImmutableSet.java:604)
> at org.jclouds.apis.Apis.all(Apis.java:74)
> at org.jclouds.apis.Apis.withId(Apis.java:91)
> at org.jclouds.ContextBuilder.newBuilder(ContextBuilder.java:164)
> ....
> Caused by: java.lang.ClassNotFoundException:
> org.jclouds.apis.internal.BaseApiMetadata
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira