You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Rémi Druilhe <re...@orange.com> on 2012/01/24 15:24:56 UTC
Problem during bundle manipulation in iPOJO
Hello,
I am facing a weird problem/bug when maven-ipojo-plugin start manipulate
one of my bundle. Depending if my code is in a try/catch or not, my
build is successful or there is a fatal error.
Here is the output (code inside the try/catch) :
[INFO] [bundle:bundle {execution: default-bundle}]
[INFO] [ipojo:ipojo-bundle {execution: default}]
[INFO] Start bundle manipulation
[INFO] Metadata file :
/home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/classes/metadata.xml
[INFO] Input Bundle File :
/home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/local-coordinator-0.1-SNAPSHOT.jar
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] java.lang.ClassNotFoundException:
com.olnc.made.homenap.utils.MigrationReader
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.RuntimeException: java.lang.ClassNotFoundException:
com.olnc.made.homenap.utils.MigrationReader
at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
at org.objectweb.asm.ClassWriter.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(Unknown
Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at
org.apache.felix.ipojo.manipulation.Manipulator.manipulate(Manipulator.java:100)
at
org.apache.felix.ipojo.manipulator.ManipulationEngine.generate(ManipulationEngine.java:111)
at
org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:312)
at
org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:198)
at
org.apache.felix.ipojo.plugin.ManipulatorMojo.execute(ManipulatorMojo.java:237)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
I checked and the MigrationReader class is in my bundle. It sounds to be
a problem in ASM, but I wanted to check with you first.
Here is a part of the code :
try {
// Three following instructions can be put outside of the
try and it works.
XMLReader migrationReader = new MigrationReader();
InputSource migrationSource = new
MigrationSource(propertiesList);
Source source = new SAXSource(migrationReader,
migrationSource);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.VERSION, "1.0");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.transform(source, resultat);
} catch (NullPointerException e) {
e.printStackTrace();
} catch (TransformerConfigurationException e) {
e.printStackTrace();
} catch (TransformerException e) {
e.printStackTrace();
}
Thanks,
Regards,
--
*DRUILHE Remi*
*PhD Student @ Orange Labs* *MAPS/SHINE/MADE*
Tel : +33 (0)4 76 76 24 27
Email: remi.druilhe@orange.com <ma...@orange.com>
R&D Grenoble 28 chemin du Vieux Chêne - BP98 38243 Meylan Cedex - France
Re: Problem during bundle manipulation in iPOJO
Posted by Rémi Druilhe <re...@orange.com>.
Ok thanks for the answer :)
Le mer. 25 janv. 2012 10:10:27 CET, Clement Escoffier a écrit :
> Hi,
>
> This is a bug in the manipulator 1.8.2. We're working on it. It takes more time than expected because Java 7 changes the byte code requirements, and those 'small' changes make the manipulation a bit more tricky. So just use the 1.8.0 for now.
>
> Regards,
>
> Clement
>
> On 24.01.2012, at 15:24, Rémi Druilhe wrote:
>
>> Hello,
>>
>> I am facing a weird problem/bug when maven-ipojo-plugin start manipulate one of my bundle. Depending if my code is in a try/catch or not, my build is successful or there is a fatal error.
>>
>> Here is the output (code inside the try/catch) :
>>
>> [INFO] [bundle:bundle {execution: default-bundle}]
>> [INFO] [ipojo:ipojo-bundle {execution: default}]
>> [INFO] Start bundle manipulation
>> [INFO] Metadata file : /home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/classes/metadata.xml
>> [INFO] Input Bundle File : /home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/local-coordinator-0.1-SNAPSHOT.jar
>> [INFO] ------------------------------------------------------------------------
>> [ERROR] FATAL ERROR
>> [INFO] ------------------------------------------------------------------------
>> [INFO] java.lang.ClassNotFoundException: com.olnc.made.homenap.utils.MigrationReader
>> [INFO] ------------------------------------------------------------------------
>> [INFO] Trace
>> java.lang.RuntimeException: java.lang.ClassNotFoundException: com.olnc.made.homenap.utils.MigrationReader
>> at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
>> at org.objectweb.asm.ClassWriter.a(Unknown Source)
>> at org.objectweb.asm.Frame.a(Unknown Source)
>> at org.objectweb.asm.Frame.a(Unknown Source)
>> at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
>> at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(Unknown Source)
>> at org.objectweb.asm.ClassReader.accept(Unknown Source)
>> at org.objectweb.asm.ClassReader.accept(Unknown Source)
>> at org.apache.felix.ipojo.manipulation.Manipulator.manipulate(Manipulator.java:100)
>> at org.apache.felix.ipojo.manipulator.ManipulationEngine.generate(ManipulationEngine.java:111)
>> at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:312)
>> at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:198)
>> at org.apache.felix.ipojo.plugin.ManipulatorMojo.execute(ManipulatorMojo.java:237)
>> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>> at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>>
>> I checked and the MigrationReader class is in my bundle. It sounds to be a problem in ASM, but I wanted to check with you first.
>>
>> Here is a part of the code :
>>
>> try {
>> // Three following instructions can be put outside of the try and it works.
>> XMLReader migrationReader = new MigrationReader();
>> InputSource migrationSource = new MigrationSource(propertiesList);
>> Source source = new SAXSource(migrationReader, migrationSource);
>>
>> TransformerFactory factory = TransformerFactory.newInstance();
>> Transformer transformer = factory.newTransformer();
>>
>> transformer.setOutputProperty(OutputKeys.INDENT, "yes");
>> transformer.setOutputProperty(OutputKeys.VERSION, "1.0");
>> transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
>>
>> transformer.transform(source, resultat);
>> } catch (NullPointerException e) {
>> e.printStackTrace();
>> } catch (TransformerConfigurationException e) {
>> e.printStackTrace();
>> } catch (TransformerException e) {
>> e.printStackTrace();
>> }
>>
>> Thanks,
>>
>> Regards,
>> --
>> *DRUILHE Remi*
>> *PhD Student @ Orange Labs* *MAPS/SHINE/MADE*
>> Tel : +33 (0)4 76 76 24 27
>> Email: remi.druilhe@orange.com<ma...@orange.com>
>> R&D Grenoble 28 chemin du Vieux Chêne - BP98 38243 Meylan Cedex - France
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
--
*DRUILHE Remi*
*PhD Student @ Orange Labs* *MAPS/SHINE/MADE*
Tel : +33 (0)4 76 76 24 27
Email: remi.druilhe@orange.com <ma...@orange.com>
R&D Grenoble 28 chemin du Vieux Ch�ne - BP98 38243 Meylan Cedex - France
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: Problem during bundle manipulation in iPOJO
Posted by Clement Escoffier <cl...@gmail.com>.
Hi,
This is a bug in the manipulator 1.8.2. We're working on it. It takes more time than expected because Java 7 changes the byte code requirements, and those 'small' changes make the manipulation a bit more tricky. So just use the 1.8.0 for now.
Regards,
Clement
On 24.01.2012, at 15:24, Rémi Druilhe wrote:
> Hello,
>
> I am facing a weird problem/bug when maven-ipojo-plugin start manipulate one of my bundle. Depending if my code is in a try/catch or not, my build is successful or there is a fatal error.
>
> Here is the output (code inside the try/catch) :
>
> [INFO] [bundle:bundle {execution: default-bundle}]
> [INFO] [ipojo:ipojo-bundle {execution: default}]
> [INFO] Start bundle manipulation
> [INFO] Metadata file : /home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/classes/metadata.xml
> [INFO] Input Bundle File : /home/xxxx/workspace/These/homenap-ipojo/homenap/local-coordinator/target/local-coordinator-0.1-SNAPSHOT.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] java.lang.ClassNotFoundException: com.olnc.made.homenap.utils.MigrationReader
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.RuntimeException: java.lang.ClassNotFoundException: com.olnc.made.homenap.utils.MigrationReader
> at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
> at org.objectweb.asm.ClassWriter.a(Unknown Source)
> at org.objectweb.asm.Frame.a(Unknown Source)
> at org.objectweb.asm.Frame.a(Unknown Source)
> at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
> at org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(Unknown Source)
> at org.objectweb.asm.ClassReader.accept(Unknown Source)
> at org.objectweb.asm.ClassReader.accept(Unknown Source)
> at org.apache.felix.ipojo.manipulation.Manipulator.manipulate(Manipulator.java:100)
> at org.apache.felix.ipojo.manipulator.ManipulationEngine.generate(ManipulationEngine.java:111)
> at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:312)
> at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:198)
> at org.apache.felix.ipojo.plugin.ManipulatorMojo.execute(ManipulatorMojo.java:237)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
> I checked and the MigrationReader class is in my bundle. It sounds to be a problem in ASM, but I wanted to check with you first.
>
> Here is a part of the code :
>
> try {
> // Three following instructions can be put outside of the try and it works.
> XMLReader migrationReader = new MigrationReader();
> InputSource migrationSource = new MigrationSource(propertiesList);
> Source source = new SAXSource(migrationReader, migrationSource);
>
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transformer = factory.newTransformer();
>
> transformer.setOutputProperty(OutputKeys.INDENT, "yes");
> transformer.setOutputProperty(OutputKeys.VERSION, "1.0");
> transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
>
> transformer.transform(source, resultat);
> } catch (NullPointerException e) {
> e.printStackTrace();
> } catch (TransformerConfigurationException e) {
> e.printStackTrace();
> } catch (TransformerException e) {
> e.printStackTrace();
> }
>
> Thanks,
>
> Regards,
> --
> *DRUILHE Remi*
> *PhD Student @ Orange Labs* *MAPS/SHINE/MADE*
> Tel : +33 (0)4 76 76 24 27
> Email: remi.druilhe@orange.com <ma...@orange.com>
> R&D Grenoble 28 chemin du Vieux Chêne - BP98 38243 Meylan Cedex - France
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org