VMware {code} Community
aariverbed
Contributor
Contributor

no class found error while importing dar file into vco



HI,


I am working on creating a plugin and am getting a no class found error in the vco log.


the class is in an external jar file. I am trying to create the dar file using Eclipse.


I added the reference for the class and one of its methods in the vso.xml file but of no use. 


Is there a documented way of adding external jar files to reference classes in vco actions??


Log

2014-09-10 22:04:02.925+0000 ERROR {} Error in vCO module file unable to find class : 'com.***.Locator' in classpath ! file : file:/var/lib/vco/app-server/temp/dars/o11nplugin-solarsystem.dar


java.lang.ClassNotFoundException: com.***.Locator



at java.net.URLClassLoader$1.run(Unknown Source)



at java.net.URLClassLoader$1.run(Unknown Source)



at java.security.AccessController.doPrivileged(Native Method)



at java.net.URLClassLoader.findClass(Unknown Source)



at java.lang.ClassLoader.loadClass(Unknown Source)



at java.lang.ClassLoader.loadClass(Unknown Source)



at java.lang.Class.forName0(Native Method)



at java.lang.Class.forName(Unknown Source)



at ch.dunes.vso.sdk.SDKModuleDescription.testModule(SDKModuleDescription.java:403)



at ch.dunes.vso.sdk.ModulesFactory.loadModule(ModulesFactory.java:386)



at ch.dunes.vso.sdk.ModulesFactory.loadDunesArchive(ModulesFactory.java:165)



at ch.dunes.vso.sdk.ModulesFactory.loadModulesInPath(ModulesFactory.java:148)



at ch.dunes.vso.sdk.ModulesFactory.loadModules(ModulesFactory.java:139)



at ch.dunes.vso.sdk.ModulesFactory.loadMapper(ModulesFactory.java:717)



at ch.dunes.scripting.jsmodel.Definitions.loadMappers(Definitions.java:179)



at com.vmware.o11n.sdk.EnhancedScriptingSDK.afterPropertiesSet(EnhancedScriptingSDK.java:235)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)



at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)



at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)



at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)



at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)



at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)



at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)



at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)



at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.afterPropertiesSet(AbstractRefreshableConfigApplicationContext.java:149)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)



at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)



at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)



at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)



at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)



at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)



at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)



at com.vmware.o11n.integration.initialization.VCOApplicationContextInitializer.tryToInitializeVcoApplicationContext(VCOApplicationContextInitializer.java:143)



at com.vmware.o11n.integration.initialization.VCOApplicationContextInitializer.nextExecutionTime(VCOApplicationContextInitializer.java:53)



at org.springframework.scheduling.concurrent.ReschedulingRunnable.schedule(ReschedulingRunnable.java:68)



at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:86)



at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)



at java.util.concurrent.FutureTask.run(Unknown Source)



at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)



at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)



at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)



at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)



at java.lang.Thread.run(Unknown Source)


Reply
0 Kudos
4 Replies
LudicrousSpeed
Contributor
Contributor

In your build you need to ensure that you are placing the jar file into the proper directory structure when the dar file is built. Example:

place in the /lib directory of the dar

and

place in /WEB-INF/lib (within the .war file) if needed

Reply
0 Kudos
aariverbed
Contributor
Contributor

Hi LudicrousSpeed,

Thanks for the response. I did that.

I see that the dar file now has these jar files. However, I get the same error and cannot see any of my classes in the plug-in.

Reply
0 Kudos
LudicrousSpeed
Contributor
Contributor

Do you have new log file after the change to see if there is still reference issue? Also, in your vso.xml file you need to make sure it is accessible.

As example:

....

<finders> 

    <finder datasource="main-datasource"

       java-class="com.****.Locator"

       script-object="myLocator" type="Locator">

    <id accessor="getId()" />

   <description>Some Description of Locator</description>

   <properties>

      <property bean-property="prop1" display-name="myProperty1"

         name="prop1" />

      <property bean-property="prop2" display-name="myProperty2"

         name="prop2" />

   </properties>

   </finder>

</finders>

....

<objects>

    <object java-class="com.*****.Locator"

        script-name="myLocator" create="true">

    <description>Some Description of Locator</description>

    <constructors>

        <constructor>

            <description>Some Description of Locator Constructor</description>

            <parameters>

                <parameter name="prop1" type="string">Property1 Of Locator</parameter>

               <parameter name="prop2" type="string">Property2 Of Locator</parameter>

            </parameters>

       </constructor>

    </constructors>

    <attributes>

        <attribute java-name="prop1" return-type="string"

           script-name="prop1">Prop1</attribute>

        <attribute java-name="prop1" return-type="string"

           script-name="prop1">Prop2</attribute>

    </attributes>

    </object>

</objects>

...

Reply
0 Kudos
aariverbed
Contributor
Contributor

Hi LudicrousSpeed,

Thanks for your reply. My build commands were missing the copying of the external jar files and adding that line fixed the issue.

Reply
0 Kudos