I have got closer to why it is happening. I wrote a small dtrace[1]
script to monitor open system calls for those additional class files. I
attached it to a build m/c and after around 150 builds, once it
occurred. Every time open system call was made with that file handle, I
print the java stack. The output of dtrace is attached here with. That
file got opened three times. As the stack suggests, first by
maven-compiler-plugin, then by maven-bundle-plugin and finally by
maven-jar-plugin. So, it is the compiler-plugin that is responsible for
creating that servlet class in jacc target dir. That is very surprising.
*Why would compiler-plugin compile dependencies? *Any clue?
Thanks,
Sahoo
[1] http://opensolaris.org/os/community/dtrace/
Sahoo wrote:
We are experiencing an issue in our build system and it is not
happening for every one. I used to think it only happens for mvn
2.0.8, but just now a developer told me that they see it mvn 2.0.7 as
well. For whatever reason, sometimes, a jar artifact is containing not
only the classes compiled from the sources that are part of that
artifact, it also contains dependent .class files. It is a very
serious problem for us. Given below is the artifact that's causing
trouble.
<project ...>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.glassfish</groupId>
<artifactId>api-pom</artifactId>
<version>10.0-SNAPSHOT</version>
</parent>
<artifactId>javax.security.jacc</artifactId>
<packaging>jar</packaging>
<name>javax.security.jacc API v.1.2</name>
<dependencies>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.servlet</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
As you can see, it depends on
org.glassfish:javax.servlet:10.0-SNAPSHOT, which is a jar type
artifact and contains javax.servlet classes. I can assure you that in
the source tree of javax.security.jacc module, there is no
javax.servlet class. Yet, javax.security.jacc-10.0-SNAPSHOT.jar
contains a bunch of javax.servlet classes. I should also state that it
only happens when both javax.servlet module and javax.security.jacc
module are part of same maven reactor. The build log produced with -X
option is quite large, so I am supplying log for jacc module portion
only. Pl. see the attachment called build.all.jacc.log. I will be
happy to supply more of it if need be. I should say, I don't
understand something from the log file. I am highlighting it here with
bold letters:
[INFO] Reactor build order:
...
[INFO] javax.servlet API v.3.0
[INFO] javax.security.jacc API v.1.2
...
[INFO]
------------------------------------------------------------------------
[INFO] Building javax.servlet API v.3.0
[INFO] task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
...
[INFO] Installing
/export/v3/v3/web/javax.servlet/target/javax.servlet-10.0-SNAPSHOT-sources.jar
to
/home/mvatkina/.m2/repository/org/glassfish/javax.servlet/10.0-SNAPSHOT/javax.servlet-10.0-SNAPSHOT-sources.jar
[INFO]
------------------------------------------------------------------------
[INFO] Building javax.security.jacc API v.1.2
[INFO] task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
...
[INFO] [clean:clean]
[INFO] Deleting directory
/export/v3/v3/security/javax.security.jacc/target
[DEBUG] org.glassfish:javax.security.jacc:jar:10.0-SNAPSHOT (selected
for null)
[DEBUG] junit:junit:jar:4.3.1:test (selected for test)
[DEBUG] active project artifact:
* artifact =
org.glassfish:javax.servlet:jar:10.0-SNAPSHOT:compile;
project: MavenProject:
org.glassfish:javax.servlet:10.0-SNAPSHOT @
/export/v3/v3/web/javax.servlet/pom.xml (selected for compile)
*
What does this active project artifact mean? By looking at the
attached log file, do you have any suggestion for me?
Thanks,
Sahoo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
0 94114 open64:entry
libc.so.1`__open64+0x15
libc.so.1`open64+0x72
libhpi.so`0xd0f2221b
libjvm.so`JVM_Open+0x3a
libjava.so`0xd0e9c3f0
libjava.so`Java_java_io_FileOutputStream_open+0x2b
java/io/FileOutputStream.open
java/io/FileOutputStream.<init>
java/io/FileOutputStream.<init>
com/sun/tools/javac/jvm/ClassWriter.writeClass
com/sun/tools/javac/main/JavaCompiler.genCode
com/sun/tools/javac/main/JavaCompiler.compile
com/sun/tools/javac/main/Main.compile
com/sun/tools/javac/main/Main.compile
com/sun/tools/javac/Main.compile
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cKReflectionGinvoke6FnTinstanceKlassHandle_nMmethodHandle_nGHandle_inOobjArrayHandle_nJBasicType_4ipnGThread__pnHoopDesc__+0xa18
libjvm.so`__1cKReflectionNinvoke_method6FpnHoopDesc_nGHandle_nOobjArrayHandle_pnGThread__2_+0x196
libjvm.so`JVM_InvokeMethod+0x1f1
libjava.so`Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x21
sun/reflect/NativeMethodAccessorImpl.invoke0
sun/reflect/NativeMethodAccessorImpl.invoke
sun/reflect/DelegatingMethodAccessorImpl.invoke*
java/lang/reflect/Method.invoke*
alignment_frame_return Runtime1 stub
org/codehaus/plexus/compiler/javac/JavacCompiler.compileInProcess
org/codehaus/plexus/compiler/javac/JavacCompiler.compile
org/apache/maven/plugin/AbstractCompilerMojo.execute
org/apache/maven/plugin/CompilerMojo.execute
org/apache/maven/plugin/DefaultPluginManager.executeMojo
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoals
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalWithLifecycle
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoal
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalAndHandleFailures
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeTaskSegments
org/apache/maven/lifecycle/DefaultLifecycleExecutor.execute
org/apache/maven/DefaultMaven.doExecute
org/apache/maven/DefaultMaven.execute
org/apache/maven/cli/MavenCli.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cKReflectionGinvoke6FnTinstanceKlassHandle_nMmethodHandle_nGHandle_inOobjArrayHandle_nJBasicType_4ipnGThread__pnHoopDesc__+0xa18
libjvm.so`__1cKReflectionNinvoke_method6FpnHoopDesc_nGHandle_nOobjArrayHandle_pnGThread__2_+0x196
libjvm.so`JVM_InvokeMethod+0x1f1
libjava.so`Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x21
sun/reflect/NativeMethodAccessorImpl.invoke0
sun/reflect/NativeMethodAccessorImpl.invoke
sun/reflect/DelegatingMethodAccessorImpl.invoke
java/lang/reflect/Method.invoke
org/codehaus/classworlds/Launcher.launchEnhanced
org/codehaus/classworlds/Launcher.launch
org/codehaus/classworlds/Launcher.mainWithExitCode
org/codehaus/classworlds/Launcher.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_+0x180
libjvm.so`jni_CallStaticVoidMethod+0x14c
java`main+0xaf4
java`0x80512fa
0 94114 open64:entry
libc.so.1`__open64+0x15
libc.so.1`open64+0x72
libhpi.so`0xd0f2221b
libjvm.so`JVM_Open+0x3a
libjava.so`0xd0e9c3f0
libjava.so`Java_java_io_FileInputStream_open+0x28
java/io/FileInputStream.open
java/io/FileInputStream.<init>
aQute/lib/osgi/FileResource.openInputStream
aQute/lib/osgi/Processor.analyzeJar
aQute/lib/osgi/Processor.analyzeBundleClasspath
org/apache/felix/bundleplugin/PackageVersionAnalyzer.analyzeBundleClasspath
aQute/lib/osgi/Analyzer.analyze
aQute/lib/osgi/Builder.analyze
aQute/lib/osgi/Analyzer.calcManifest
org/apache/felix/bundleplugin/ManifestPlugin.getAnalyzer
org/apache/felix/bundleplugin/ManifestPlugin.getManifest
org/apache/felix/bundleplugin/ManifestPlugin.execute
org/apache/felix/bundleplugin/BundlePlugin.execute
org/apache/felix/bundleplugin/BundlePlugin.execute
org/apache/maven/plugin/DefaultPluginManager.executeMojo
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoals
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalWithLifecycle
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoal
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalAndHandleFailures
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeTaskSegments
org/apache/maven/lifecycle/DefaultLifecycleExecutor.execute
org/apache/maven/DefaultMaven.doExecute
org/apache/maven/DefaultMaven.execute
org/apache/maven/cli/MavenCli.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cKReflectionGinvoke6FnTinstanceKlassHandle_nMmethodHandle_nGHandle_inOobjArrayHandle_nJBasicType_4ipnGThread__pnHoopDesc__+0xa18
libjvm.so`__1cKReflectionNinvoke_method6FpnHoopDesc_nGHandle_nOobjArrayHandle_pnGThread__2_+0x196
libjvm.so`JVM_InvokeMethod+0x1f1
libjava.so`Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x21
sun/reflect/NativeMethodAccessorImpl.invoke0
sun/reflect/NativeMethodAccessorImpl.invoke
sun/reflect/DelegatingMethodAccessorImpl.invoke
java/lang/reflect/Method.invoke
org/codehaus/classworlds/Launcher.launchEnhanced
org/codehaus/classworlds/Launcher.launch
org/codehaus/classworlds/Launcher.mainWithExitCode
org/codehaus/classworlds/Launcher.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_+0x180
libjvm.so`jni_CallStaticVoidMethod+0x14c
java`main+0xaf4
java`0x80512fa
0 94114 open64:entry
libc.so.1`__open64+0x15
libc.so.1`open64+0x72
libhpi.so`0xd0f2221b
libjvm.so`JVM_Open+0x3a
libjava.so`0xd0e9c3f0
libjava.so`Java_java_io_FileInputStream_open+0x28
java/io/FileInputStream.open
java/io/FileInputStream.<init>
org/codehaus/plexus/archiver/zip/AbstractZipArchiver.zipFile
org/codehaus/plexus/archiver/zip/AbstractZipArchiver.addResources
org/codehaus/plexus/archiver/zip/AbstractZipArchiver.createArchiveMain
org/codehaus/plexus/archiver/zip/AbstractZipArchiver.execute
org/codehaus/plexus/archiver/AbstractArchiver.createArchive
org/apache/maven/archiver/MavenArchiver.createArchive
org/apache/maven/plugin/jar/AbstractJarMojo.createArchive
org/apache/maven/plugin/jar/AbstractJarMojo.execute
org/apache/maven/plugin/DefaultPluginManager.executeMojo
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoals
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalWithLifecycle
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoal
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeGoalAndHandleFailures
org/apache/maven/lifecycle/DefaultLifecycleExecutor.executeTaskSegments
org/apache/maven/lifecycle/DefaultLifecycleExecutor.execute
org/apache/maven/DefaultMaven.doExecute
org/apache/maven/DefaultMaven.execute
org/apache/maven/cli/MavenCli.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cKReflectionGinvoke6FnTinstanceKlassHandle_nMmethodHandle_nGHandle_inOobjArrayHandle_nJBasicType_4ipnGThread__pnHoopDesc__+0xa18
libjvm.so`__1cKReflectionNinvoke_method6FpnHoopDesc_nGHandle_nOobjArrayHandle_pnGThread__2_+0x196
libjvm.so`JVM_InvokeMethod+0x1f1
libjava.so`Java_sun_reflect_NativeMethodAccessorImpl_invoke0+0x21
sun/reflect/NativeMethodAccessorImpl.invoke0
sun/reflect/NativeMethodAccessorImpl.invoke
sun/reflect/DelegatingMethodAccessorImpl.invoke
java/lang/reflect/Method.invoke
org/codehaus/classworlds/Launcher.launchEnhanced
org/codehaus/classworlds/Launcher.launch
org/codehaus/classworlds/Launcher.mainWithExitCode
org/codehaus/classworlds/Launcher.main
StubRoutines (1)
libjvm.so`__1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x187
libjvm.so`__1cCosUos_exception_wrapper6FpFpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v2468_v_+0x14
libjvm.so`__1cJJavaCallsEcall6FpnJJavaValue_nMmethodHandle_pnRJavaCallArguments_pnGThread__v_+0x28
libjvm.so`__1cRjni_invoke_static6FpnHJNIEnv__pnJJavaValue_pnI_jobject_nLJNICallType_pnK_jmethodID_pnSJNI_ArgumentPusher_pnGThread__v_+0x180
libjvm.so`jni_CallStaticVoidMethod+0x14c
java`main+0xaf4
java`0x80512fa
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]