Expand my Community achievements bar.

SOLVED

MojoExecutionException occurs while doing mvn clean install -PautoInstallBundle

Avatar

Level 1

[ERROR] Bundle com.iiht:iihtfe.core1:bundle:1.0-SNAPSHOT : Got unexpected exception while analyzing:org.apache.felix.scrplugin.SCRDescriptorException: Unable to add methods to com.iiht.iihtfe.core.services.impl.OsgiConfigurationServiceImpl
at org.apache.felix.scrplugin.helper.ClassModifier.addMethods(ClassModifier.java:126)
at org.apache.felix.scrplugin.SCRDescriptorGenerator.generateMethods(SCRDescriptorGenerator.java:274)
at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:201)
at org.apache.felix.scrplugin.bnd.SCRDescriptorBndPlugin.analyzeJar(SCRDescriptorBndPlugin.java:178)
at aQute.bnd.osgi.Analyzer.doPlugins(Analyzer.java:820)
at aQute.bnd.osgi.Analyzer.analyze(Analyzer.java:229)
at aQute.bnd.osgi.Builder.analyze(Builder.java:408)
at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:850)
at aQute.bnd.osgi.Builder.build(Builder.java:116)
at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:972)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:467)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:384)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:375)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
Caused by: java.io.FileNotFoundException: F:\Sufiyans Backup\ALL BACKUP(8thNov2020)\LocalDisk-D\IIHT\iiht-aem\iihtfe\core\target\classes\com\iiht\iihtfe\core\services\impl\OsgiConfigurationServiceImpl.class (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.apache.felix.scrplugin.helper.ClassModifier.addMethods(ClassModifier.java:67)
... 34 more

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@sufiyanp5432 

Please check if you've the latest version of maven and maven-scr-plugin as well as it's dependencies.

Does this exception come only for -PautoInstallBundle or with -PautoInstallPackage as well and any recent changes to the project setup? Please check if maven-scr-plugin is setup as per mentioned here.

https://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/apache-felix-maven-...

Try setting "generateAccessors" to false in the plugin configuration to see if that resolves the issue. It could be related to the annotations used in  OsgiConfigurationServiceImpl

 

 

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @sufiyanp5432 ,

it seems like some file is missing on a path can you please check the below line from your exception.

Caused by: java.io.FileNotFoundException: F:\Sufiyans Backup\ALL BACKUP(8thNov2020)\LocalDisk-D\IIHT\iiht-aem\iihtfe\core\target\classes\com\iiht\iihtfe\core\services\impl\OsgiConfigurationServiceImpl.class (The system cannot find the path specified)

 

Check this and make sure the path is available then only you will get rid off from this issue.

Hope this will help.

Umesh Thakur 

Avatar

Correct answer by
Employee Advisor

@sufiyanp5432 

Please check if you've the latest version of maven and maven-scr-plugin as well as it's dependencies.

Does this exception come only for -PautoInstallBundle or with -PautoInstallPackage as well and any recent changes to the project setup? Please check if maven-scr-plugin is setup as per mentioned here.

https://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/apache-felix-maven-...

Try setting "generateAccessors" to false in the plugin configuration to see if that resolves the issue. It could be related to the annotations used in  OsgiConfigurationServiceImpl

 

 

Avatar

Level 4

Some Issue with your custom class

com.iiht.iihtfe.core.services.impl.OsgiConfigurationServiceImpl

You can revisit code in this class and fix it, its throwing exception in one of its method.

Regards

Praveen