This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187310 - IllegalArgumentException: "Strange comparison string" with useOSGiDependencies and jdtcore-3.1.0.jar
Summary: IllegalArgumentException: "Strange comparison string" with useOSGiDependencie...
Status: RESOLVED INVALID
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: Jesse Glick
URL: http://forums.netbeans.org/viewtopic....
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-08 07:49 UTC by arittner
Modified: 2011-04-19 23:17 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arittner 2010-06-08 07:49:36 UTC
With enabled useOSGiDependencies configuration and nbm-maven-plugin:3.2 I get this exception:

java.lang.IllegalArgumentException: Strange comparison string: singleton:=true
        at org.openide.modules.Dependency.create(Dependency.java:264)
        at org.netbeans.Module.initDeps(Module.java:663)
        at org.netbeans.Module.parseManifest(Module.java:445)
Caused: org.netbeans.InvalidException: While parsing de.sepix.reports.sXjrxml a dependency attribute
        at org.netbeans.Module.parseManifest(Module.java:447)
        at org.netbeans.StandardModule.<init>(StandardModule.java:133)
        at org.netbeans.ModuleFactory.create(ModuleFactory.java:66)
        at org.netbeans.ModuleManager.create(ModuleManager.java:514)
        at org.netbeans.core.startup.ModuleList$ReadInitial.run(ModuleList.java:1590)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:122)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:539)
        at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:165)
        at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:269)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:168)
        at org.netbeans.core.startup.Main.start(Main.java:299)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:111)


I've a dependency to this artifact:

       <dependency>
            <artifactId>jdtcore</artifactId>
            <groupId>eclipse</groupId>
            <type>jar</type>
            <version>3.1.0</version>
       </dependency> 

The resolved jar is jdtcore-3.1.0.jar. It contains this manifest.mf:

Manifest-Version: 1.0
Main-Class: org.eclipse.jdt.internal.compiler.batch.Main
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true
Bundle-Version: 3.1.0
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.jdt.core.JavaCore
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.jdt.core,
 org.eclipse.jdt.core.compiler,
[... more entries skipped ...]

IMHO the "Bundle-SymbolicName: org.eclipse.jdt.core; singleton:=true" corrupts my MANIFEST.MF in my module:

META-INF/MANIFEST.MF in ...\suites\sXreports\target\netbeans_clusters\reports\modules\de-sepix-reports-sXjrxml.jar 

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: Rittner
Build-Jdk: 1.6.0_20
OpenIDE-Module-Localizing-Bundle: de/sepix/reports/jrxml/Bundle.proper
 ties
OpenIDE-Module-Layer: de/sepix/reports/jrxml/layer.xml
OpenIDE-Module-Specification-Version: 4.2
OpenIDE-Module-Implementation-Version: 4.2-20100607
OpenIDE-Module-Build-Version: 201006070212
OpenIDE-Module: de.sepix.reports.sXjrxml
OpenIDE-Module-Public-Packages: -
OpenIDE-Module-Requires: org.openide.modules.ModuleFormat1
OpenIDE-Module-Display-Category: de.sepix.reports
OpenIDE-Module-Name: S3 V4.2 (reports) Jasper Viewer
OpenIDE-Module-Short-Description: Jasper Reports Engine Viewer
OpenIDE-Module-Long-Description: Jasper Reports Engine Viewer
OpenIDE-Module-Module-Dependencies:  org.apache.commons.beanutils > 1.
 8.0, org.eclipse.jdt.core; singleton:=true > 3.1.0, org.openide.util 
[... more entries skipped ...]


The workaround is to disable the useOSGiDependencies configuration.

br, josh.
Comment 1 Jesse Glick 2010-06-10 15:37:14 UTC
Reproducible in a dev build.
Comment 2 hendrikvanantwerpen 2010-08-10 16:33:07 UTC
Slightly different error on javax.vecmath:
java.lang.IllegalArgumentException: Bad name: javax-vecmath; singleton:=true
        at org.netbeans.core.startup.ModuleList$ReadInitial.run(ModuleList.java:1514)

Disabling OSGI dependencies in pom.xml doesn't reliably solve the problem
for me. It worked the first time I did it, but at the next run I got
the error again.

NB: Netbeans 6.9.1
Comment 3 theunsgerhardus 2010-09-04 14:57:53 UTC
I think i have related problem.

When running my project i get the following while the splash screen is displayed.

java.lang.IllegalArgumentException: Bad name: org-eclipse-jdt-core; singleton:=true
        at org.netbeans.core.startup.ModuleList$ReadInitial.run(ModuleList.java:1514)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:125)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:542)
        at org.netbeans.core.startup.ModuleList.readInitial(ModuleList.java:168)
        at org.netbeans.core.startup.ModuleSystem.readList(ModuleSystem.java:272)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:171)
        at org.netbeans.core.startup.Main.start(Main.java:302)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:114)
        at java.lang.Thread.run(Thread.java:619)


I am using NB 6.9.1
Comment 4 Jesse Glick 2010-10-07 17:24:22 UTC
Needs to be filed on http://jira.codehaus.org/browse/MNBMODULE if still reproducible in 3.3.
Comment 5 Jesse Glick 2010-11-16 21:31:59 UTC
http://jira.codehaus.org/browse/MNBMODULE-125
Comment 7 marciowb 2011-04-19 16:57:24 UTC
The error was partially fixed with 3.5. But now, when running maven with the setting -Dnetbeans.execution=true, like:
mvn -Dmaven.test.skip=true -Dnetbeans.execution=true -Dmaven.repo.local=P:\rep -Dnetbeans.execution=false clean install

the maven claims about several not found (java.lang.NoClassDefFoundError) classes, starting by org.apache.tools.ant.Project. I tried to manually add it to the nbm plugin as a dependency, but whe I did, others classes are not found. 

The full (but non detailed) log, is:
NetBeans: Executing 'mvn.bat -Dmaven.test.skip=true -Dnetbeans.execution=true -Dmaven.repo.local=P:\rep -Dnetbeans.execution=true clean install'
NetBeans:      JAVA_HOME=C:\progs\java\jdk\64\1-6-0_24
Scanning for projects...
[WARNING] The POM for org.codehaus.mojo:nbm-maven-plugin:jar:3.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Building with 8 threads
                                                                        
------------------------------------------------------------------------
Building Geotoolkit.org 3.17
------------------------------------------------------------------------
[WARNING] The POM for org.codehaus.mojo:nbm-maven-plugin:jar:3.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project      *
[WARNING] * contains the following plugin(s) that are not marked as       *
[WARNING] * @threadSafe to support parallel building.                     *
[WARNING] * While this /may/ work fine, please look for plugin updates    *
[WARNING] * and/or request plugins be made thread-safe.                   *
[WARNING] * If reporting an issue, report it against the plugin in        *
[WARNING] * question, not against maven-core                              *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in Geotoolkit.org:
[WARNING] org.codehaus.mojo:nbm-maven-plugin:3.5
[WARNING] *****************************************************************

--- maven-clean-plugin:2.4.1:clean (default-clean) @ geotoolkit ---
Deleting P:\devel\projects\marciowb\bemtevi2\geotklib\target

--- maven-resources-plugin:2.5:resources (default-resources) @ geotoolkit ---
[debug] execute contextualize
Using 'UTF-8' encoding to copy filtered resources.
Copying 73 resources

--- maven-compiler-plugin:2.3.2:compile (default-compile) @ geotoolkit ---
Compiling 1426 source files to P:\devel\projects\marciowb\bemtevi2\geotklib\target\classes

--- nbm-maven-plugin:3.5:manifest (default-manifest) @ geotoolkit ---
[WARNING] The POM for org.codehaus.mojo:nbm-maven-plugin:jar:3.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Apr 19, 2011 1:50:10 PM org.sonatype.guice.bean.reflect.LoadedClass
WARNING: Error injecting: org.codehaus.mojo.nbm.NetbeansManifestUpdateMojo
java.lang.NoClassDefFoundError: org/apache/tools/ant/Project
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethods(Class.java:1791)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:662)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:356)
        at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:151)
        at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:584)
        at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:542)
        at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:528)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:837)
        at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:769)
        at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:254)
        at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
        at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:843)
        at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:957)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:990)
        at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:951)
        at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1003)
        at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:47)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
        at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:968)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1014)
        at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:964)
        at com.google.inject.Scopes$1$1.get(Scopes.java:59)
        at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
        at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
        at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:235)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleThreadedBuilder$1.call(LifecycleThreadedBuilder.java:167)
        at org.apache.maven.lifecycle.internal.LifecycleThreadedBuilder$1.call(LifecycleThreadedBuilder.java:164)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Project
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
        ... 44 more
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 22.879s (Wall Clock)
Finished at: Tue Apr 19 13:50:10 BRT 2011
Final Memory: 31M/600M
------------------------------------------------------------------------
[ERROR]Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.5:manifest (default-manifest) on project geotoolkit: Execution default-manifest of goal org.codehaus.mojo:nbm-maven-plugin:3.5:manifest failed: Unable to load the mojo 'manifest' in the plugin 'org.codehaus.mojo:nbm-maven-plugin:3.5'. A required class is missing: org/apache/tools/ant/Project
[ERROR]-----------------------------------------------------
[ERROR]realm =    plugin>org.codehaus.mojo:nbm-maven-plugin:3.5
[ERROR]strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR]urls[0] = file:/P:/rep/org/codehaus/mojo/nbm-maven-plugin/3.5/nbm-maven-plugin-3.5.jar
[ERROR]urls[1] = file:/P:/rep/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR]Number of foreign imports: 1
[ERROR]import: Entry[import  from realm ClassRealm[project>org.geotoolkit:geotoolkit:3.17, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR]-----------------------------------------------------: org.apache.tools.ant.Project
[ERROR]-> [Help 1]
[ERROR]
[ERROR]To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR]For more information about the errors and possible solutions, please read the following articles:
[ERROR][Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

To workarround the problem, add the following property to maven: -Dnetbeans.execution=false

As I tell above, if netbeans.execution is true, the problem occurs.

Sorry if this is really a non related error with the original problem, but was following the tip to use the nbm 3.5, instead the older versions, that this problem appears.

Regards,
Marcio Wesley Borges
http://marciowb.info
Comment 8 Jesse Glick 2011-04-19 23:17:54 UTC
A profile activated by -Dnetbeans.execution=true is used as a hack to make code completion work on the nbm-maven-plugin source project even though harness/tasks.jar from a NB installation is not present in the Maven repository as an independent artifact (since NB itself is built using Ant). Unfortunately Maven deployment copies that hack into the deployed POM; so, do not set this property when running Maven on a project using the plugin. (NB 7.0 does not set it when running Maven.)

Anyway, do not reopen this issue for unrelated problems.