incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satoshi Kobayashi <satosh...@stratosphere.co.jp>
Subject Re: Review Request: Add the dependence library (JNA) for maven exec:java goal
Date Thu, 18 Oct 2012 02:22:49 GMT
Hi Pradeep,

I am sorry that my late reply.

I rebuild development environment. (on 4.0 branch)
http://incubator.apache.org/cloudstack/develop/environment.html

Next, I tried executing of KVM Agent using Maven.
https://cwiki.apache.org/CLOUDSTACK/building-with-maven.html

0. get jar files in "Dependencies" section, and copy them to the deps directory

1. mvn -P deps install
-> OK

2. "./install-non-oss.sh" in the deps directory
-> OK

3. mvn clean compile
-> OK

4. mvn exec:java --projects plugins/hypervisors/kvm \
    -Dexec.mainClass=com.cloud.agent.AgentShell
-> NG

----------8<----------8<----------
…(snip)...
INFO  [cloud.resource.ServerResourceBase]
(com.cloud.agent.AgentShell.main():) Designating private to be nic
eth2
INFO  [resource.virtualnetwork.VirtualRoutingResource]
(com.cloud.agent.AgentShell.main():) VirtualRoutingResource _scriptDir
to use: scripts/network/domr/kvm
[WARNING]
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoClassDefFoundError: com/sun/jna/Callback
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	at com.cloud.hypervisor.kvm.resource.LibvirtConnection.getConnection(LibvirtConnection.java:31)
	at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:652)
	at com.cloud.agent.Agent.<init>(Agent.java:163)
	at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:559)
	at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:514)
	at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:431)
	at com.cloud.agent.AgentShell.start(AgentShell.java:589)
	at com.cloud.agent.AgentShell.main(AgentShell.java:631)
	... 6 more
Caused by: java.lang.ClassNotFoundException: com.sun.jna.Callback
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 25 more
----------8<----------8<----------

I think that "com.sun.jna.Callback" class is not contained in jar
files of "Dependencies" section. Therefore, I added runtime dependence
of it to pom.xml.

I think that there may be a possibly more good method. (For example,
it adds to install-non-oss.sh) Since I am not knowledgeable about
license...

Regards,
Satoshi

2012/10/3 Pradeep Soundararajan <pradeep.soundararajan@citrix.com>:
> I think you can try this:
>
> cd deps/
> ./install-non-oss.sh
> cd ..
>  mvn exec:java --projects plugins/hypervisors/kvm -Dexec.mainClass=com.cloud.agent.AgentShell
>
> Thanks,
> Pradeep.S
>
>
> -----Original Message-----
> From: Satoshi Kobayashi [mailto:satoshi-k@stratosphere.co.jp]
> Sent: Friday, September 28, 2012 7:45 AM
> To: Pradeep Soundararajan
> Cc: cloudstack-dev@incubator.apache.org
> Subject: Re: Review Request: Add the dependence library (JNA) for maven exec:java goal
>
> Hi Pradeep
>
> 2012/9/28 Pradeep Soundararajan <pradeep.soundararajan@citrix.com>:
>> Please let me know what exception has been raised.
>
> I have remembered that it was probably ClassNotFoundException of com.sun.jna package
(Callback class?).
> I do not have environment to replay at right now. I make and check it later.
>
>> I think we have to add the plugin "exec-maven-plugin" in our pom files to execute
exec:java related.  Otherwise, it will throw some warnings during the execution.
>
> I think that a POM configuration is required in order to omit arguments at a command
line. A exception did not be raised in my environment. But, I think that  a POM configuration
is kinder. Since I looked at it in another patch, I did not include it in this patch.
>
>> Thanks,
>> Pradeep.S
>>
>> -----Original Message-----
>> From: Satoshi Kobayashi [mailto:noreply@reviews.apache.org] On Behalf
>> Of Satoshi Kobayashi
>> Sent: Thursday, September 06, 2012 8:52 AM
>> To: cloudstack; Satoshi Kobayashi
>> Subject: Review Request: Add the dependence library (JNA) for maven
>> exec:java goal
>>
>>
>> -----------------------------------------------------------
>> This is an automatically generated e-mail. To reply, visit:
>> https://reviews.apache.org/r/6937/
>> -----------------------------------------------------------
>>
>> Review request for cloudstack.
>>
>>
>> Description
>> -------
>>
>> Add the dependence library (JNA) for maven exec:java goal
>>
>> It is required to run on development environment for KVM Agent
>>
>>
>> Diffs
>> -----
>>
>>   plugins/hypervisors/kvm/pom.xml
>> 8cdaa8681571b5070bfc501014df91c9986479e3
>>
>> Diff: https://reviews.apache.org/r/6937/diff/
>>
>>
>> Testing
>> -------
>>
>> 1) mvn compile -Dnonoss
>> 2) prepare agent.properties
>> 3) mvn exec:java -pl plugins/hypervisors/kvm \
>>   -Dexec.mainClass=com.cloud.agent.AgentShell \
>>   -Dnonoss
>> result: An exception does not be raised.
>>
>>
>> Thanks,
>>
>> Satoshi Kobayashi
>>



-- 
Satoshi Kobayashi <satoshi-k@stratosphere.co.jp>

Mime
View raw message