[jboss-cvs] JBossAS SVN: r101284 - in branches/vfs3-int: build and 36 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 22 18:09:04 EST 2010
Author: johnbailey
Date: 2010-02-22 18:09:01 -0500 (Mon, 22 Feb 2010)
New Revision: 101284
Added:
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/SimpleCdiClassloaderLeakTestCase.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiIntrospectSession.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiInvalidateSession.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleSessionBean.java
branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/beans.xml
branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/web-cdi.xml
branches/vfs3-int/webservices/src/assembly/jbossws-jboss60-jaxrpc-deployer.xml
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Removed:
branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml
branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Modified:
branches/vfs3-int/build/build.xml
branches/vfs3-int/build/pom.xml
branches/vfs3-int/build/src/assembly/jboss-dist.xml
branches/vfs3-int/component-matrix/pom.xml
branches/vfs3-int/ejb3/.classpath
branches/vfs3-int/ejb3/.project
branches/vfs3-int/main/pom.xml
branches/vfs3-int/main/src/main/java/org/jboss/Main.java
branches/vfs3-int/main/src/resources/org/jboss/version.properties
branches/vfs3-int/messaging/src/etc/examples/web-service/build.xml
branches/vfs3-int/pom.xml
branches/vfs3-int/profileservice/src/main/java/org/jboss/profileservice/web/DebugServlet.java
branches/vfs3-int/resteasy-int/pom.xml
branches/vfs3-int/resteasy-int/test/pom.xml
branches/vfs3-int/resteasy-int/zip/pom.xml
branches/vfs3-int/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml
branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java
branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java
branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java
branches/vfs3-int/system/src/main/java/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
branches/vfs3-int/testsuite/build.xml
branches/vfs3-int/testsuite/imports/sections/classloader.xml
branches/vfs3-int/testsuite/imports/server-config.xml
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/ClassLoaderStore.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/LeakAnalyzer.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamVFSClassloadingUnitTestCase.java
branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
branches/vfs3-int/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
branches/vfs3-int/varia/src/main/java/org/jboss/security/srp/jaas/SRPLoginModule.java
branches/vfs3-int/webservices/build.xml
branches/vfs3-int/webservices/src/assembly/assembly-resources.xml
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java
branches/vfs3-int/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
Merged changes from trunk -r 100917:101283
Modified: branches/vfs3-int/build/build.xml
===================================================================
--- branches/vfs3-int/build/build.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/build/build.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1734,6 +1734,7 @@
<antcall target="install-jbossws-to-endorsed" inheritRefs="true"/>
<antcall target="install-jbossws-to-deploy" inheritRefs="true"/>
<antcall target="install-jbossws-to-deployers" inheritRefs="true"/>
+ <antcall target="install-jbossws-jaxrpc-deployers" inheritRefs="true"/>
</target>
<target name="install-jbossws-to-endorsed">
@@ -1762,6 +1763,8 @@
<fileset refid="sun-fi:FastInfoset:jar"/>
<fileset refid="jboss.jaxbintros:jboss-jaxb-intros:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-core:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-factories:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-services:jar"/>
<fileset refid="org.codehaus.jettison:jettison:jar"/>
<fileset refid="org.jboss.netty:netty:jar"/>
<fileset refid="org.apache.ws.policy:wscommons-policy:jar"/>
@@ -1772,12 +1775,24 @@
<unzip src="${org.jboss.ws.native:jbossws-native-resources:jar}"
dest="${webservices.module.output}/jbossws-native-resources"/>
<copy todir="${install.all.deployers}/jbossws.deployer">
- <fileset dir="${webservices.module.output}/jbossws-native-resources/resources/jbossws-jboss600/jbossws.beans">
+ <fileset dir="${webservices.module.output}/jbossws-native-resources/resources/jbossws-jboss601/jbossws.beans">
<include name="META-INF/**"/>
</fileset>
</copy>
</target>
+ <target name="install-jbossws-jaxrpc-deployers">
+ <!-- Install JBossWS jaxrpc deployers -->
+ <mkdir dir="${install.all.deployers}/jbossws-jaxrpc.deployer"/>
+ <unzip dest="${install.all.deployers}/jbossws-jaxrpc.deployer"
+ src="${webservices.module.output}/jboss-as-webservices-jbossws-jboss60-jaxrpc-deployer.zip"/>
+ <copy todir="${install.all.deployers}/jbossws-jaxrpc.deployer" flatten="true" overwrite="true">
+ <fileset refid="org.jboss.ws.native:jbossws-native-factories:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-services:jar"/>
+ <mapper refid="remove-versions" />
+ </copy>
+ </target>
+
<target name="module-webservices-all">
<!-- Copy the generated javadocs -->
<mkdir dir="${install.api}/${webservices.module.name}"/>
@@ -1889,6 +1904,8 @@
<fileset refid="org.jboss.ws:jbossws-common:jar"/>
<fileset refid="org.jboss.ws:jbossws-framework:jar"/>
<fileset refid="org.jboss.ws:jbossws-spi:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-core:jar"/>
+ <fileset refid="org.jboss.netty:netty:jar"/>
<fileset refid="commons-beanutils:commons-beanutils:jar"/>
<fileset refid="antlr:antlr:jar"/>
<fileset refid="commons-collections:commons-collections:jar"/>
@@ -2062,6 +2079,8 @@
<fileset refid="org.jboss.aop:jboss-aop-asintegration-mc:jar"/>
<fileset refid="org.jboss.aop:jboss-aop-deployers:jar"/>
<fileset refid="gnu-getopt:getopt:jar"/>
+ <fileset refid="xerces:xercesImpl:jar"/>
+ <fileset refid="apache-xerces:resolver:jar"/>
<fileset refid="org.jboss:jbossxb:jar"/>
<mapper refid="remove-versions" />
</copy>
@@ -2072,6 +2091,8 @@
<fileset refid="antlr:antlr:jar"/>
<fileset refid="apache-xalan:xalan:jar"/>
<fileset refid="apache-xalan:serializer:jar"/>
+ <fileset refid="xerces:xercesImpl:jar"/>
+ <fileset refid="apache-xerces:resolver:jar"/>
<fileset refid="org.apache:xmlsec:jar"/>
<fileset refid="wsdl4j:wsdl4j:jar"/>
<fileset refid="javassist:javassist:jar"/>
@@ -2113,6 +2134,8 @@
<fileset refid="javax.jws:jsr181-api:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-client:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-core:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-services:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-factories:jar"/>
<fileset refid="javax.xml:jaxrpc-api:jar"/>
<fileset refid="javax.xml.soap:saaj-api:jar"/>
<fileset refid="org.jboss.ws:jbossws-common:jar"/>
@@ -2169,8 +2192,6 @@
<!-- Copy thirdparty code to lib/endorsed -->
<mkdir dir="${install.lib}/endorsed"/>
<copy todir="${install.lib}/endorsed" filtering="no">
- <fileset refid="xerces:xercesImpl:jar"/>
- <fileset refid="apache-xerces:resolver:jar"/>
<fileset refid="sun-jaxb:jaxb-api:jar"/>
<fileset refid="javax.activation:activation:jar"/>
<fileset refid="stax:stax-api:jar"/>
Modified: branches/vfs3-int/build/pom.xml
===================================================================
--- branches/vfs3-int/build/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/build/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -622,6 +622,11 @@
<optional>true</optional>
</dependency>
<dependency>
+ <groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-services</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<optional>true</optional>
@@ -749,6 +754,7 @@
<goals>
<goal>download-licenses</goal>
</goals>
+ <phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/jboss-${project.version}/docs/licenses</outputDirectory>
<licenseSummaryFile>${project.build.directory}/jboss-${project.version}/docs/licenses/licenses.xml</licenseSummaryFile>
@@ -821,6 +827,49 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>version-jars</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="jboss.dist.dir" value="${project.build.directory}/jboss-${project.version}" />
+ <javac destdir="${project.build.directory}" executable="${env.JAVA_HOME}/bin/javac"
+ fork="true">
+ <src path="."/>
+ <classpath>
+ <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
+ </classpath>
+ <include name="VersionRelease.java"/>
+ </javac>
+ <echo message="Versioning: jboss-${project.version}"/>
+ <java classname="VersionRelease">
+ <arg value="${jboss.dist.dir}"/>
+ <classpath>
+ <pathelement location="${project.build.directory}"/>
+ <pathelement location="${jboss.dist.dir}/lib/dom4j.jar"/>
+ </classpath>
+ <sysproperty key="specification.title" value="${project.name}"/>
+ <sysproperty key="specification.vendor" value="${project.organization.name}"/>
+ <sysproperty key="specification.version" value="${project.version}"/>
+ <sysproperty key="implementation.title" value="${project.name}"/>
+ <sysproperty key="implementation.vendor" value="${project.organization.name}"/>
+ <sysproperty key="implementation.vendor.id" value="${project.groupId}"/>
+ <sysproperty key="implementation.version" value="${project.version}"/>
+ <sysproperty key="implementation.url" value="${project.url}"/>
+ </java>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>false</inherited>
<executions>
Modified: branches/vfs3-int/build/src/assembly/jboss-dist.xml
===================================================================
--- branches/vfs3-int/build/src/assembly/jboss-dist.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/build/src/assembly/jboss-dist.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -6,7 +6,7 @@
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
- <directory>output/jboss-${project.version}</directory>
+ <directory>${project.build.directory}/jboss-${project.version}</directory>
<outputDirectory>/jboss-${project.version}</outputDirectory>
<excludes>
<exclude>**/data/**</exclude>
Modified: branches/vfs3-int/component-matrix/pom.xml
===================================================================
--- branches/vfs3-int/component-matrix/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/component-matrix/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -44,10 +44,10 @@
<version.jaxws.api>2.2</version.jaxws.api>
<version.jboss.jaxr>2.0.1</version.jboss.jaxr>
<version.jboss.jbossts>4.9.0.GA</version.jboss.jbossts>
- <version.jboss.jbossws>3.3.0.Beta3</version.jboss.jbossws>
- <version.jboss.jbossws-common>1.3.0.Beta2</version.jboss.jbossws-common>
- <version.jboss.jbossws-framework>3.3.0.Beta2</version.jboss.jbossws-framework>
- <version.jboss.jbossws-spi>1.3.0.Beta2</version.jboss.jbossws-spi>
+ <version.jboss.jbossws>3.3.0.Beta4</version.jboss.jbossws>
+ <version.jboss.jbossws-common>1.3.0.Beta3</version.jboss.jbossws-common>
+ <version.jboss.jbossws-framework>3.3.0.Beta3</version.jboss.jbossws-framework>
+ <version.jboss.jbossws-spi>1.3.0.Beta3</version.jboss.jbossws-spi>
<version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
<version.jboss.messaging>1.4.6.GA</version.jboss.messaging>
<version.jboss.web>3.0.0-beta-2</version.jboss.web>
@@ -935,6 +935,12 @@
<dependency>
<groupId>org.jboss.ws.native</groupId>
+ <artifactId>jbossws-native-services</artifactId>
+ <version>${version.jboss.jbossws}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
<version>${version.jboss.jbossws}</version>
</dependency>
Modified: branches/vfs3-int/ejb3/.classpath
===================================================================
--- branches/vfs3-int/ejb3/.classpath 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/ejb3/.classpath 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: branches/vfs3-int/ejb3/.project
===================================================================
--- branches/vfs3-int/ejb3/.project 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/ejb3/.project 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1,31 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jboss-as-ejb3</name>
- <comment>JBoss Application Server (ejb3 module)</comment>
- <projects>
- <project>jboss-as-connector</project>
- <project>jboss-as-deployment</project>
- <project>jboss-as-iiop</project>
- <project>jboss-as-main</project>
- <project>jboss-as-security</project>
- <project>jboss-as-server</project>
- <project>jboss-as-system</project>
- <project>jboss-as-system-jmx</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-as-ejb3</name>
+ <comment>JBoss Application Server (ejb3 module)</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Modified: branches/vfs3-int/main/pom.xml
===================================================================
--- branches/vfs3-int/main/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/main/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -47,6 +47,7 @@
</goals>
<phase>validate</phase>
<configuration>
+ <revisionOnScmFailure>unavailable</revisionOnScmFailure>
<timestampFormat>{0, date, yyyyMMdd}</timestampFormat>
<timestampPropertyName>today</timestampPropertyName>
</configuration>
Modified: branches/vfs3-int/main/src/main/java/org/jboss/Main.java
===================================================================
--- branches/vfs3-int/main/src/main/java/org/jboss/Main.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/main/src/main/java/org/jboss/Main.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -96,6 +96,8 @@
"jboss-logging-logmanager.jar",
// Common jars
"jboss-common-core.jar",
+ "resolver.jar",
+ "xercesImpl.jar",
"jbossxb.jar",
// Bootstrap
"jboss-bootstrap-spi.jar", "jboss-bootstrap-spi-as.jar", "jboss-bootstrap-spi-mc.jar",
Modified: branches/vfs3-int/main/src/resources/org/jboss/version.properties
===================================================================
--- branches/vfs3-int/main/src/resources/org/jboss/version.properties 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/main/src/resources/org/jboss/version.properties 2010-02-22 23:09:01 UTC (rev 101284)
@@ -12,7 +12,7 @@
version.revision=${parsedVersion.incrementalVersion}
version.tag=${parsedVersion.qualifier}
version.name=${project.version.name}
-version.cvstag=JBoss_${project.version}
+version.cvstag=JBoss_${parsedVersion.majorVersion}_${parsedVersion.minorVersion}_${parsedVersion.incrementalVersion}_${parsedVersion.qualifier}
# Build identifiers
build.number=r${buildNumber}
Modified: branches/vfs3-int/messaging/src/etc/examples/web-service/build.xml
===================================================================
--- branches/vfs3-int/messaging/src/etc/examples/web-service/build.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/messaging/src/etc/examples/web-service/build.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -35,7 +35,7 @@
<pathelement location="${messaging.client.jar.path}/${messaging.client.jar.name}"/>
<!-- all this stuff for WebServices -->
- <pathelement location="${jboss.home}/lib/endorsed/xercesImpl.jar"/>
+ <pathelement location="${jboss.client}/xercesImpl.jar"/>
<pathelement location="${jboss.client}/activation.jar"/>
<pathelement location="${jboss.client}/commons-logging.jar"/>
<pathelement location="${jboss.client}/javassist.jar"/>
@@ -72,7 +72,7 @@
<pathelement location="${jboss.client}/jboss-saaj.jar"/>
<pathelement location="${jboss.client}/wsdl4j.jar"/>
<pathelement location="${jboss.client}/jaxb-api.jar"/>
- <pathelement location="${jboss.home}/lib/endorsed/xercesImpl.jar"/>
+ <pathelement location="${jboss.client}/xercesImpl.jar"/>
<pathelement location="${messaging.client.jar.name}"/>
Modified: branches/vfs3-int/pom.xml
===================================================================
--- branches/vfs3-int/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -9,7 +9,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-parent</artifactId>
- <version>6.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Application Server Parent POM</name>
<url>http://www.jboss.org/jbossas</url>
Modified: branches/vfs3-int/profileservice/src/main/java/org/jboss/profileservice/web/DebugServlet.java
===================================================================
--- branches/vfs3-int/profileservice/src/main/java/org/jboss/profileservice/web/DebugServlet.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/profileservice/src/main/java/org/jboss/profileservice/web/DebugServlet.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -35,9 +35,13 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.log4j.Logger;
import org.jboss.deployers.spi.management.ManagementView;
import org.jboss.managed.api.ManagedComponent;
import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.SimpleValue;
import org.jboss.profileservice.spi.ProfileService;
/**
@@ -46,8 +50,10 @@
*/
public class DebugServlet extends HttpServlet
{
+ private static final Logger log = Logger.getLogger("org.jboss.profileservice.debug");
+
private static final long serialVersionUID = 1;
- @Resource(mappedName = "java:ProfileService")
+ @Resource(mappedName = "ProfileService")
private ProfileService ps;
private ManagementView mgtView;
@@ -69,7 +75,7 @@
try
{
InitialContext ctx = new InitialContext();
- ps = (ProfileService) ctx.lookup("java:ProfileService");
+ ps = (ProfileService) ctx.lookup("ProfileService");
}
catch (NamingException e)
{
@@ -141,11 +147,37 @@
tmp.append(mc.getComponentName());
tmp.append(", attachment: ");
tmp.append(mc.getAttachmentName());
- tmp.append("\n++++++ properties: ");
- tmp.append(mc.getPropertyNames());
+ tmp.append("\n++++++ properties: {");
+ for(ManagedProperty property : mc.getProperties().values())
+ {
+ try
+ {
+ tmp.append(property.getName()).append("=");
+ if(property.getValue() != null && property.getMetaType().isSimple())
+ {
+ tmp.append(SimpleValue.class.cast(property.getValue()).getValue());
+ }
+ else if(property.getValue() != null && property.getMetaType().isEnum())
+ {
+ tmp.append(EnumValue.class.cast(property.getValue()).getValue());
+ }
+ else
+ {
+ tmp.append(property.getValue());
+ }
+ tmp.append(", ");
+ }
+ catch(Exception e)
+ {
+ // Debug runtime property failures
+ log.debug("failed to get value for property "+ property.getName(), e.getCause());
+ }
+ }
+ tmp.append("}");
tmp.append('\n');
}
}
+ tmp.append("\n");
}
}
catch(Exception e)
Modified: branches/vfs3-int/resteasy-int/pom.xml
===================================================================
--- branches/vfs3-int/resteasy-int/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/resteasy-int/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -8,7 +8,7 @@
<name>RESTEasy JBoss AS Integration</name>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.resteasy</groupId>
+ <groupId>org.jboss.jbossas</groupId>
<artifactId>resteasy-int-pom</artifactId>
<packaging>pom</packaging>
Modified: branches/vfs3-int/resteasy-int/test/pom.xml
===================================================================
--- branches/vfs3-int/resteasy-int/test/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/resteasy-int/test/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -8,7 +8,7 @@
<name>Resteasy JBoss AS Integration Testing</name>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.resteasy</groupId>
+ <groupId>org.jboss.jbossas</groupId>
<artifactId>resteasy-int-testing-pom</artifactId>
<packaging>pom</packaging>
Modified: branches/vfs3-int/resteasy-int/zip/pom.xml
===================================================================
--- branches/vfs3-int/resteasy-int/zip/pom.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/resteasy-int/zip/pom.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -6,6 +6,7 @@
<version>6.0.0-SNAPSHOT</version>
</parent>
+ <groupId>org.jboss.jbossas</groupId>
<artifactId>resteasy-int-dist</artifactId>
<packaging>pom</packaging>
<name>RESTEasy JBoss AS Integration Distribution</name>
Modified: branches/vfs3-int/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml
===================================================================
--- branches/vfs3-int/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/server/src/etc/conf/all/bindingservice.beans/META-INF/bindings-jboss-beans.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -471,7 +471,7 @@
<xsl:when test="(name() = 'port' and . = '8009')">
<xsl:attribute name="port"><xsl:value-of select="$portAJP" /></xsl:attribute>
</xsl:when>
- <xsl:when test="(name() = 'redirectPort')">
+ <xsl:when test="(name() = 'redirectPort' and . = '8443')">
<xsl:attribute name="redirectPort"><xsl:value-of select="$portHttps" /></xsl:attribute>
</xsl:when>
<xsl:when test="(name() = 'port' and . = '8443')">
Modified: branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java
===================================================================
--- branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -39,6 +39,7 @@
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.deployment.AnnotationMetaDataDeployer;
import org.jboss.metadata.ear.jboss.JBossAppMetaData;
+import org.jboss.metadata.javaee.spec.EmptyMetaData;
import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.AbsoluteOrderingMetaData;
@@ -368,6 +369,8 @@
if (webFragmentMetaData == null)
{
webFragmentMetaData = new WebFragmentMetaData();
+ // Add non overriding default distributable flag
+ webFragmentMetaData.setDistributable(new EmptyMetaData());
}
key = AnnotationMetaDataDeployer.WEB_ANNOTATED_ATTACHMENT_NAME + ":" + jar;
WebMetaData jarAnnotatedMetaData = unit.getAttachment(key, WebMetaData.class);
@@ -399,6 +402,8 @@
for (String jar : jarsSet)
{
WebFragmentMetaData webFragmentMetaData = new WebFragmentMetaData();
+ // Add non overriding default distributable flag
+ webFragmentMetaData.setDistributable(new EmptyMetaData());
key = AnnotationMetaDataDeployer.WEB_ANNOTATED_ATTACHMENT_NAME + ":" + jar;
WebMetaData jarAnnotatedMetaData = unit.getAttachment(key, WebMetaData.class);
if (jarAnnotatedMetaData != null)
Modified: branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java
===================================================================
--- branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/ServletContainerInitializerDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -38,6 +38,7 @@
import javax.servlet.annotation.HandlesTypes;
import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.annotations.ScanningMetaData;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -77,6 +78,7 @@
{
setStage(DeploymentStages.POST_CLASSLOADER);
setInput(JBossWebMetaData.class);
+ addInput(ScanningMetaData.class);
addInput(MergedJBossWebMetaDataDeployer.WEB_ORDER_ATTACHMENT_NAME);
addInput(MergedJBossWebMetaDataDeployer.WEB_SCIS_ATTACHMENT_NAME);
addOutput(SCI_ATTACHMENT_NAME);
@@ -172,6 +174,7 @@
}
}
+ ScanningMetaData scanningMetaData = unit.getAttachment(ScanningMetaData.class);
Class<?>[] typesArray = typesMap.keySet().toArray(new Class<?>[0]);
// Find classes which extend, implement, or are annotated by HandlesTypes
if (typesArray.length > 0 && unit instanceof VFSDeploymentUnit)
@@ -182,9 +185,14 @@
{
for (VirtualFile classpathItem : classpath)
{
- HandlesTypesClassFilter classVisitor = new HandlesTypesClassFilter(vfsUnit, unit.getClassLoader(),
- classpathItem, typesArray, typesMap, handlesTypes);
- classpathItem.visit(classVisitor);
+ if (scanningMetaData == null
+ || !(scanningMetaData.getPaths() == null
+ || !scanningMetaData.getPaths().contains(classpathItem.getName())))
+ {
+ HandlesTypesClassFilter classVisitor = new HandlesTypesClassFilter(vfsUnit, unit.getClassLoader(),
+ classpathItem, typesArray, typesMap, handlesTypes);
+ classpathItem.visit(classVisitor);
+ }
}
}
catch (Exception e)
Modified: branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java
===================================================================
--- branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/server/src/main/java/org/jboss/web/deployers/WarAnnotationMetaDataDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -29,6 +29,7 @@
import java.util.Map;
import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.annotations.ScanningMetaData;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -57,6 +58,7 @@
{
setStage(DeploymentStages.POST_CLASSLOADER);
addInput(WebMetaData.class);
+ addInput(ScanningMetaData.class);
addOutput(WEB_ANNOTATED_ATTACHMENT_NAME);
}
@@ -131,15 +133,21 @@
*/
protected void processMetaData(VFSDeploymentUnit unit, List<VirtualFile> classpath) throws Exception
{
+ ScanningMetaData scanningMetaData = unit.getAttachment(ScanningMetaData.class);
Map<VirtualFile, Collection<Class<?>>> classesPerJar = new HashMap<VirtualFile, Collection<Class<?>>>();
boolean foundAnnotations = false;
for (VirtualFile path : classpath)
{
- Collection<Class<?>> currentClasses = getClasses(unit, path);
- classesPerJar.put(path, currentClasses);
- if (currentClasses.size() > 0)
+ if (scanningMetaData == null
+ || !(scanningMetaData.getPaths() == null
+ || !scanningMetaData.getPaths().contains(path.getName())))
{
- foundAnnotations = true;
+ Collection<Class<?>> currentClasses = getClasses(unit, path);
+ classesPerJar.put(path, currentClasses);
+ if (currentClasses.size() > 0)
+ {
+ foundAnnotations = true;
+ }
}
}
if (foundAnnotations)
Modified: branches/vfs3-int/system/src/main/java/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
===================================================================
--- branches/vfs3-int/system/src/main/java/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/system/src/main/java/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -27,12 +27,14 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
import org.jboss.logging.Logger;
+import org.jboss.profileservice.spi.DeploymentRepository;
import org.jboss.profileservice.spi.ModificationInfo;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.NoSuchProfileException;
@@ -44,6 +46,7 @@
import org.jboss.system.server.profileservice.repository.HotDeploymentRepository;
import org.jboss.system.server.profileservice.repository.TypedProfileRepository;
import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.util.PathTokenizer;
/**
* Profile deployment repository adapter.
@@ -175,6 +178,21 @@
Collection<URI> uris = profile.getURIs();
if (uris.contains(uri) == false)
{
+ try
+ {
+ // Check whether it's a uri relative to a managed repository URI
+ // in case it is managed we just skip it
+ if(checkRelative(uri))
+ {
+ log.debug("ignoring already managed uri: " + uri);
+ return;
+ }
+ }
+ catch(Exception e)
+ {
+ log.debug(e);
+ return;
+ }
uris.add(uri);
}
}
@@ -226,9 +244,66 @@
}
}
}
-
return urls.toArray(new String[urls.size()]);
}
+
+ /**
+ * Check all deployment repositories, if the they manage the relative
+ * deployment path - so we don't need to add to this profile.
+ *
+ * @param deploymentURI the deployment URI
+ * @return true if the relative path can be determined
+ * @throws Exception
+ */
+ boolean checkRelative(URI deploymentURI) throws Exception
+ {
+ for(ProfileKey key : this.repositories.getProfileKeys())
+ {
+ DeploymentRepository repository = this.repositories.getProfileDeploymentRepository(key);
+ URI[] uris = repository.getRepositoryURIs();
+ if(uris != null && uris.length > 0)
+ {
+ for(URI uri : uris)
+ {
+ if(isRelative(uri.getPath(), deploymentURI.getPath()))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check whether a path is relative to another.
+ *
+ * @param root the root path
+ * @param relative the relative path
+ * @return true or false
+ */
+ boolean isRelative(String root, String relative)
+ {
+ List<String> roots = PathTokenizer.getTokens(root);
+ List<String> relatives = PathTokenizer.getTokens(relative);
+ Iterator<String> rootsIterator = roots.iterator();
+ Iterator<String> relativesIterator = relatives.iterator();
+ while(rootsIterator.hasNext())
+ {
+ if(relativesIterator.hasNext() == false)
+ {
+ // Would recursively redeploy
+ return true;
+ }
+ String r = rootsIterator.next();
+ String o = relativesIterator.next();
+ if(r.equals(o) == false)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
public static class DeploymentScannerProfile extends HotDeploymentRepository implements MutableProfile
{
Modified: branches/vfs3-int/testsuite/build.xml
===================================================================
--- branches/vfs3-int/testsuite/build.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/build.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -19,8 +19,8 @@
<dirname property="project.root" file="${basedir}"/>
<property name="project.tools" value="${project.root}/tools"/>
- <xmlproperty file="../pom.xml" prefix="pom"/>
- <property name="version" value="${pom.project.version}"/>
+ <xmlproperty file="pom.xml" prefix="pom"/>
+ <property name="version" value="${pom.project.parent.version}"/>
<!-- Set junit.jvm home to same jre used by Ant -->
<property name="junit.jvm" location="${java.home}/bin/java"/>
@@ -287,6 +287,7 @@
<fileset refid="org.jboss.ws.native:jbossws-native-management:war"/>
<fileset refid="org.jboss.ws.native:jbossws-native-resources:jar"/>
<fileset refid="org.jboss.ws.native:jbossws-native-factories:jar"/>
+ <fileset refid="org.jboss.ws.native:jbossws-native-services:jar"/>
<fileset refid="javax.xml:jaxrpc-api:jar"/>
<fileset refid="javax.xml.soap:saaj-api:jar"/>
<fileset refid="org.jboss:jbossxb:jar"/>
Modified: branches/vfs3-int/testsuite/imports/sections/classloader.xml
===================================================================
--- branches/vfs3-int/testsuite/imports/sections/classloader.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/imports/sections/classloader.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -303,11 +303,23 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/classloader/leak/web/*"/>
<exclude name="org/jboss/test/classloader/leak/web/Ejb*"/>
+ <exclude name="org/jboss/test/classloader/leak/web/Cdi*"/>
</classes>
<fileset dir="${build.resources}/classloader/leak/war">
<include name="simple.jsp"/>
</fileset>
</war>
+ <war destfile="${build.lib}/classloader-leak-simple-cdi.war"
+ webxml="${build.resources}/classloader/leak/war/WEB-INF/web-cdi.xml">
+ <webinf dir="${build.resources}/classloader/leak/war/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="beans.xml"/>
+ </webinf>
+ <classes dir="${build.classes}">
+ <include name="org/jboss/test/classloader/leak/web/Cdi*"/>
+ <include name="org/jboss/test/classloader/leak/web/SimpleSessionBean*"/>
+ </classes>
+ </war>
<war destfile="${build.lib}/classloader-leak-in-war.war"
webxml="${build.resources}/classloader/leak/war/WEB-INF/web.xml">
<webinf dir="${build.resources}/classloader/leak/war/WEB-INF">
@@ -316,6 +328,7 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/classloader/leak/web/*"/>
<exclude name="org/jboss/test/classloader/leak/web/Ejb*"/>
+ <exclude name="org/jboss/test/classloader/leak/web/Cdi*"/>
</classes>
<fileset dir="${build.resources}/classloader/leak/war">
<include name="simple.jsp"/>
@@ -340,6 +353,7 @@
<classes dir="${build.classes}">
<include name="org/jboss/test/classloader/leak/web/*"/>
<exclude name="org/jboss/test/classloader/leak/web/Ejb3Servlet"/>
+ <exclude name="org/jboss/test/classloader/leak/web/Cdi*"/>
</classes>
<fileset dir="${build.resources}/classloader/leak/war">
<include name="*.jsp"/>
Modified: branches/vfs3-int/testsuite/imports/server-config.xml
===================================================================
--- branches/vfs3-int/testsuite/imports/server-config.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/imports/server-config.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -796,7 +796,7 @@
<jvmarg value="-XX:MaxPermSize=256m" />
<jvmarg value="-XX:-UseGCOverheadLimit" />
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
- <!-- Use -D to set ${jboss.jvm.agentlib} to "-agentlib:jbossAgent" or
+ <!-- Use -D to set ${jboss.profiler.cmdline} to "-agentlib:jbossAgent" or
"-agentlib:jbossAgent -d64" to use JBoss Profiler to analyze heap
The default value is "" turning the following into a no-op -->
<jvmarg value="${jboss.profiler.cmdline}"/>
@@ -810,7 +810,7 @@
<jvmarg value="-XX:MaxPermSize=256m" />
<jvmarg value="-XX:-UseGCOverheadLimit" />
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
- <!-- Use -D to set ${jboss.jvm.agentlib} to "-agentlib:jbossAgent" or
+ <!-- Use -D to set ${jboss.profiler.cmdline} to "-agentlib:jbossAgent" or
"-agentlib:jbossAgent -d64" to use JBoss Profiler to analyze heap
The default value is "" turning the following into a no-op -->
<jvmarg value="${jboss.profiler.cmdline}"/>
Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/ClassLoaderStore.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/ClassLoaderStore.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/ClassLoaderStore.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -46,6 +46,8 @@
private final Map<String, WeakReference<ClassLoader>> classloaders = new HashMap<String, WeakReference<ClassLoader>>();
private final int depth = Integer.parseInt(System.getProperty("jboss.classloader.leak.test.depth", "12"));
+
+ private final boolean verbose = Boolean.getBoolean("jboss.classloader.leak.test.verbose");
private ClassLoaderStore()
{
@@ -156,7 +158,7 @@
Thread.sleep(20);
- String report = leakAnalyzer.exploreObjectReferences(datapoints, weakReferenceOnLoader.get(), this.depth, true, false);
+ String report = leakAnalyzer.exploreObjectReferences(datapoints, weakReferenceOnLoader.get(), this.depth, true, !verbose);
log.info(report);
if (reportHTMLFile != null)
{
Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/LeakAnalyzer.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/LeakAnalyzer.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/clstore/LeakAnalyzer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -29,7 +29,6 @@
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -50,6 +49,8 @@
{
private static final Logger log = Logger.getLogger(LeakAnalyzer.class);
+ private static final String SEP = System.getProperty("line.separator");
+ private Object root;
/**
* Create a new LeakAnalyzer.
*
@@ -83,35 +84,36 @@
public String exploreObjectReferences(HashMap<Long, List<ReferenceDataPoint>> referencesMap, Object thatObject, int maxLevel, boolean useToString,
boolean condensed)
{
+ this.root = thatObject;
+
ReferenceReportNode root = new ReferenceReportNode(callToString(thatObject, useToString));
Set<ReferenceReportNode> prunableLeaves = new HashSet<ReferenceReportNode>();
- CharArrayWriter charArray = new CharArrayWriter();
- PrintWriter out = new PrintWriter(charArray);
+ StringBuilder sb = new StringBuilder();
try
{
exploreObject(root, thatObject, 0, maxLevel, useToString, false, referencesMap, new HashSet<String>(), prunableLeaves);
- for (Iterator<ReferenceReportNode> it = prunableLeaves.iterator(); it.hasNext();)
+ for (ReferenceReportNode nonCrit : prunableLeaves)
{
- ReferenceReportNode nonCrit = it.next();
nonCrit.markNonCritical();
if (condensed)
nonCrit.removeBranch();
}
- writeReport(root, 0, out);
+ writeReport(root, 0, condensed, sb);
}
catch (Exception e)
{
- charArray = new CharArrayWriter();
- out = new PrintWriter(charArray);
+ CharArrayWriter charArray = new CharArrayWriter();
+ PrintWriter out = new PrintWriter(charArray);
e.printStackTrace(out);
+ sb = new StringBuilder(charArray.toString());
}
- return charArray.toString();
+ return sb.toString();
}
@@ -146,109 +148,69 @@
alreadyExplored.add(index);
- log.info("resolving references of " + callToString(source, useToString) + "...");
+// log.info("resolving references of " + callToString(source, useToString) + "...");
+ log.info(currentLevel + " -- resolving references of " + source.getClass());
Long sourceTag = new Long(this.getTagOnObject(source));
List<ReferenceDataPoint> listPoints = mapDataPoints.get(sourceTag);
if (listPoints == null)
{
- log.info("didn't find references");
+ log.debug("didn't find references");
return;
}
- log.info("References found");
+ log.debug("References found");
for (ReferenceDataPoint point : listPoints)
{
ReferenceReportNode child = new ReferenceReportNode();
- Object nextReference = treatReference(child, point, useToString);
-
- if (nextReference != null && !weakAndSoft)
- {
- if (nextReference instanceof Reference<?>)
- {
- // WeakHashMap$Entry and ThreadLocal$ThreadLocalMap$Entry are
- // special cases, where the Entry key is a weak ref, but the
- // value is strong. We don't want to ignore similar cases. So
- // only mark as prunable if the ref is the standard
- // java.lang.ref.Referent.referent -- all others are potential
- // strong references
- // We also don't stop at SoftReferences, since if they survive
- // our attempts at flushing them out, we want to know about them
- String msg = child.getMessage();
- if (msg.indexOf("FieldReference private java.lang.Object java.lang.ref.Reference.referent=") >= 0
- && !(nextReference instanceof SoftReference<?>))
- {
- if (nextReference instanceof Map.Entry<?,?>)
- {
- // WeakHashMap$Entry is suspicious.
- // Put in some more info about the entry
- @SuppressWarnings("unchecked")
- Map.Entry entry = (Entry) nextReference;
- Object key = entry.getKey();
- msg += " KEY=" + (key == null ? " null" : key.getClass().getName() + "@" + System.identityHashCode(key));
- Object val= entry.getValue();
- msg += " VALUE=" + (val == null ? " null" : val.getClass().getName() + "@" + System.identityHashCode(val));
- child.setMessage(msg);
- }
-
- prunableLeaves.add(child);
- nextReference = null;
- }
- else if (msg.indexOf("java.lang.ThreadLocal$ThreadLocalMap$Entry") >= 0)
- {
- // Get the key and follow that to see why it isn't released
- nextReference = ((Reference<?>) nextReference).get();
- }
- // else just keep going
-
-
- }
- }
-
+ Object nextReference = treatReference(child, point, useToString, weakAndSoft, prunableLeaves);
+
if (nextReference != null)
{
exploreObject(child, nextReference, currentLevel + 1, maxLevel, useToString, weakAndSoft, mapDataPoints,
alreadyExplored, prunableLeaves);
- }
+ }
if (child.getMessage() != null || child.getChildren().size() > 0)
- node.addChild(child);
-
+ node.addChild(child);
}
}
- private void writeReport(ReferenceReportNode node, int level, PrintWriter out)
+ private static void writeReport(ReferenceReportNode node, int level, boolean condensed, StringBuilder sb)
{
- out.print("<br>");
- out.print(writeLevel(level));
- if (node.isCritical())
+ sb.append("<br>");
+ writeLevel(level, sb);
+ if (condensed || node.isCritical())
{
- out.print("<b>");
- if (node.isLeaf())
+ sb.append("<b>");
+ boolean leaf = node.isLeaf();
+ if (leaf)
{
- out.print("<font color=\"red\">");
+ sb.append("<font color=\"red\">");
}
- out.print(node.getMessage());
- if (node.isLeaf())
+ sb.append(node.getMessage());
+ if (leaf)
{
- out.print("</font>");
+ sb.append("</font>");
}
- out.println("</b>");
+ sb.append("</b>");
}
else
{
- out.println(node.getMessage());
+ sb.append(node.getMessage());
}
+
+ sb.append(SEP);
- for (Iterator<ReferenceReportNode> it = node.getChildren().iterator(); it.hasNext();)
+ for (ReferenceReportNode child : node.getChildren())
{
- writeReport(it.next(), level + 1, out);
+ writeReport(child, level + 1, condensed, sb);
}
}
- private String callToString(Object obj, boolean callToString)
+ private static String callToString(Object obj, boolean callToString)
{
try
{
@@ -274,7 +236,7 @@
}
}
- private Object treatReference(ReferenceReportNode node, ReferenceDataPoint point, boolean useToString)
+ private Object treatReference(ReferenceReportNode node, ReferenceDataPoint point, boolean useToString, boolean weakAndSoft, Set<ReferenceReportNode> prunableLeaves)
{
Object referenceHolder = null;
if (point.getReferenceHolder() == 0 || point.getReferenceHolder() == -1)
@@ -287,15 +249,14 @@
}
Object nextReference = null;
- CharArrayWriter charArray = new CharArrayWriter();
- PrintWriter out = new PrintWriter(charArray);
+ StringBuilder sb = new StringBuilder();
switch (point.getReferenceType())
{
case JVMTICallBack.JVMTI_REFERENCE_CLASS :
// Reference from an object to its class.
- out.print("InstanceOfReference:");
- out.println("ToString=" + callToString(referenceHolder, useToString));
+ sb.append("InstanceOfReference: ");
+ sb.append(callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
@@ -336,7 +297,7 @@
fieldName = field.toString();
}
}
- out.print("FieldReference " + fieldName + "=" + callToString(referenceHolder, useToString));
+ sb.append("FieldReference ").append(fieldName).append("=").append(callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
}
@@ -347,33 +308,33 @@
if (referenceHolder == null)
{
- out.println("arrayRef Position " + point.getIndex() + " is gone");
+ sb.append("arrayRef Position " + point.getIndex() + " is gone");
}
else
{
- out.println("arrayRef " + referenceHolder.getClass().getName() + "[" + point.getIndex()
+ sb.append("arrayRef " + referenceHolder.getClass().getName() + "[" + point.getIndex()
+ "] id=@" + System.identityHashCode(referenceHolder));
}
nextReference = referenceHolder;
break;
case JVMTICallBack.JVMTI_REFERENCE_CLASS_LOADER :
// Reference from a class to its class loader.
- out.println("ClassLoaderReference @ " + callToString(referenceHolder, useToString));
+ sb.append("ClassLoaderReference @ " + callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
case JVMTICallBack.JVMTI_REFERENCE_SIGNERS :
// Reference from a class to its signers array.
- out.println("ReferenceSigner@" + callToString(referenceHolder, useToString));
+ sb.append("ReferenceSigner@" + callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
case JVMTICallBack.JVMTI_REFERENCE_PROTECTION_DOMAIN :
// Reference from a class to its protection domain.
- out.println("ProtectionDomain@" + callToString(referenceHolder, useToString));
+ sb.append("ProtectionDomain@" + callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
case JVMTICallBack.JVMTI_REFERENCE_INTERFACE :
// Reference from a class to one of its interfaces.
- out.println("ReferenceInterface@" + callToString(referenceHolder, useToString));
+ sb.append("ReferenceInterface@" + callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
case JVMTICallBack.JVMTI_REFERENCE_STATIC_FIELD :// Reference from a
@@ -412,7 +373,24 @@
{
fieldName = field.toString();
}
- out.println("StaticFieldReference " + fieldName);
+ sb.append("StaticFieldReference " + fieldName);
+
+ // A static field reference is either a leak or a cycle, depending
+ // on whether the field's class was loaded by our root CL Check for this
+ // and cut short the analysis of this tree by simply recording
+ // its ClassLoader
+ ClassLoader cl = clazz.getClassLoader();
+ if (root.equals(cl))
+ {
+ prunableLeaves.add(node);
+ }
+ else
+ {
+ log.info("Found a static reference leak to class " + clazz);
+ ReferenceReportNode child = new ReferenceReportNode();
+ child.setMessage("ClassLoaderReference @ " + callToString(cl, useToString));
+ node.addChild(child);
+ }
nextReference = null;
break;
}
@@ -423,11 +401,11 @@
// is the index into constant pool table of the class, starting
// at 1. See The Constant Pool in the Java Virtual Machine
// Specification.
- out.println(" ReferenceInterface@" + callToString(referenceHolder, useToString));
+ sb.append(" ReferenceInterface@" + callToString(referenceHolder, useToString));
nextReference = referenceHolder;
break;
case JVMTICallBack.ROOT_REFERENCE :
- out.println("Root");
+ sb.append("Root");
nextReference = null;
break;
case JVMTICallBack.THREAD_REFERENCE :
@@ -450,7 +428,11 @@
*/
String methodName = this.getMethodName(point.getMethod());
- out.println("Reference inside a method - " + className + "::" + methodName);
+ sb.append("Reference inside a method - " + className + "::" + methodName);
+ if (methodClass.isAssignableFrom(getClass()))
+ {
+ prunableLeaves.add(node);
+ }
}
nextReference = null;
break;
@@ -458,20 +440,59 @@
log.warn("unexpected reference " + point);
}
- String msg = charArray.toString();
- if (msg.trim().length() > 0)
- node.setMessage(msg);
+ if (sb.length() > 0)
+ node.setMessage(sb.toString());
+ if (nextReference != null && !weakAndSoft)
+ {
+ if (nextReference instanceof Reference<?>)
+ {
+ // WeakHashMap$Entry and ThreadLocal$ThreadLocalMap$Entry are
+ // special cases, where the Entry key is a weak ref, but the
+ // value is strong. We don't want to ignore similar cases. So
+ // only mark as prunable if the ref is the standard
+ // java.lang.ref.Referent.referent -- all others are potential
+ // strong references
+ // We also don't stop at SoftReferences, since if they survive
+ // our attempts at flushing them out, we want to know about them
+ String msg = node.getMessage();
+ if (msg.indexOf("FieldReference private java.lang.Object java.lang.ref.Reference.referent=") >= 0
+ && !(nextReference instanceof SoftReference<?>))
+ {
+ if (nextReference instanceof Map.Entry<?,?>)
+ {
+ // WeakHashMap$Entry is suspicious.
+ // Put in some more info about the entry
+ @SuppressWarnings("unchecked")
+ Map.Entry entry = (Entry) nextReference;
+ Object key = entry.getKey();
+ msg += " KEY=" + (key == null ? " null" : key.getClass().getName() + "@" + System.identityHashCode(key));
+ Object val= entry.getValue();
+ msg += " VALUE=" + (val == null ? " null" : val.getClass().getName() + "@" + System.identityHashCode(val));
+ node.setMessage(msg);
+ }
+
+ prunableLeaves.add(node);
+ nextReference = null;
+ }
+ else if (msg.indexOf("java.lang.ThreadLocal$ThreadLocalMap$Entry") >= 0)
+ {
+ // Get the key and follow that to see why it isn't released
+ nextReference = ((Reference<?>) nextReference).get();
+ }
+ // else just keep going
+
+ }
+ }
+
return nextReference;
}
- private static String writeLevel(int level)
+ private static void writeLevel(int level, StringBuilder sb)
{
- StringBuffer levelSb = new StringBuffer();
for (int i = 0; i <= level; i++)
{
- levelSb.append("!--");
+ sb.append("!--");
}
- return levelSb.toString();
}
}
Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/ClassloaderLeakTestBase.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -132,7 +132,7 @@
}
}
- private void deployComponent(String deployment) throws Exception
+ protected void deployComponent(String deployment) throws Exception
{
deploy(deployment);
deployments.add(deployment);
@@ -321,7 +321,7 @@
}
}
- private void flushSecurityCache(String domain) throws Exception
+ protected void flushSecurityCache(String domain) throws Exception
{
log.debug("Flushing security cache " + domain);
MBeanServerConnection adaptor = delegate.getServer();
@@ -331,7 +331,7 @@
adaptor.invoke(on, "flushSecurityCache", params, signature);
}
- private void makeWebRequest(String url, String responseContent)
+ protected void makeWebRequest(String url, String responseContent)
{
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
Copied: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/SimpleCdiClassloaderLeakTestCase.java (from rev 101283, trunk/testsuite/src/main/org/jboss/test/classloader/leak/test/SimpleCdiClassloaderLeakTestCase.java)
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/SimpleCdiClassloaderLeakTestCase.java (rev 0)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/test/SimpleCdiClassloaderLeakTestCase.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.test.classloader.leak.test;
+
+import junit.framework.Test;
+
+/**
+ * <p>
+ * Test for classloader leaks following deployment, use and undeployment of a
+ * simple war using Weld.
+ * <p/>
+ * <p>
+ * If these tests are run with JBoss Profiler's jbossAgent (.dll or .so) on the
+ * path and the AS is started with -agentlib:jbossAgent, in case of classloader
+ * leakage an extensive report will be logged to the server log, showing the
+ * path to root of all references to the classloader.
+ * </p>
+ *
+ * @author David Allen
+ */
+public class SimpleCdiClassloaderLeakTestCase extends J2EEClassloaderLeakTestBase
+{
+
+ private static final String SIMPLE_CDI_WAR = "classloader-leak-simple-cdi.war";
+ private static final String WELD = "WELD";
+ private static final String[] CLASS_LOADERS = { SERVLET, SERVLET_TCCL, WELD };
+
+ public SimpleCdiClassloaderLeakTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(SimpleCdiClassloaderLeakTestCase.class, "classloader-leak-test.sar");
+ }
+
+ public void testSimpleCdiWar() throws Exception
+ {
+ // Ensure we are starting with a clean slate
+ checkCleanKeys(CLASS_LOADERS);
+
+ deployComponent(SIMPLE_CDI_WAR);
+
+ makeWebRequest(baseURL + "IntrospectCDISession", WEBAPP);
+ makeWebRequest(baseURL + "InvalidateCDISession", WEBAPP);
+
+ // Make sure the expected registrations were done
+ checkKeyRegistration(CLASS_LOADERS);
+
+ // This sleep is a workaround to JBAS-4060
+ sleep(500);
+
+ undeployComponent(SIMPLE_CDI_WAR, true);
+
+ // TODO - probably not needed anymore; remove
+ flushSecurityCache("HsqlDbRealm");
+
+ sleep(500);
+
+ // Confirm the classloaders were released
+ String unregistered = checkClassLoaderRelease(CLASS_LOADERS);
+
+ if (unregistered.trim().length() > 0)
+ {
+ fail("Classloaders unregistered: " + unregistered);
+ }
+ }
+}
Copied: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiIntrospectSession.java (from rev 101283, trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiIntrospectSession.java)
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiIntrospectSession.java (rev 0)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiIntrospectSession.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.test.classloader.leak.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.inject.Inject;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Registers the relevant classloaders to monitor leaks. Uses at least a session context
+ * bean to force use of the session context and management infrastructure in Weld.
+ *
+ * @author David Allen
+ *
+ */
+public class CdiIntrospectSession extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Inject
+ private SimpleSessionBean simpleSessionBean;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET", getClass().getClassLoader());
+ org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET_TCCL", Thread.currentThread().getContextClassLoader());
+ org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("WELD", simpleSessionBean.getClass().getClassLoader());
+
+ Log log = LogFactory.getLog("WEBAPP");
+ log.info("Logging from " + getClass().getName());
+
+ simpleSessionBean.hashCode();
+ resp.setContentType("text/text");
+ PrintWriter writer = resp.getWriter();
+ writer.println("WEBAPP");
+ writer.flush();
+ }
+
+}
Copied: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiInvalidateSession.java (from rev 101283, trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiInvalidateSession.java)
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiInvalidateSession.java (rev 0)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/CdiInvalidateSession.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.test.classloader.leak.web;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class CdiInvalidateSession extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ Log log = LogFactory.getLog("WEBAPP");
+ log.info("Logging from " + getClass().getName());
+
+ SimpleSessionBean.setBeanDestroyed(false);
+ req.getSession().invalidate();
+
+ resp.setContentType("text/text");
+ PrintWriter writer = resp.getWriter();
+ writer.println("WEBAPP");
+ writer.flush();
+ }
+}
Copied: branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleSessionBean.java (from rev 101283, trunk/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleSessionBean.java)
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleSessionBean.java (rev 0)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/classloader/leak/web/SimpleSessionBean.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.test.classloader.leak.web;
+
+import java.io.Serializable;
+
+import javax.annotation.PreDestroy;
+import javax.enterprise.context.SessionScoped;
+
+ at SessionScoped
+class SimpleSessionBean implements Serializable
+{
+
+ private static final long serialVersionUID = 1L;
+ private static boolean beanDestroyed = false;
+
+ @PreDestroy
+ public void destroyBean()
+ {
+ beanDestroyed = true;
+ }
+
+ public static boolean isBeanDestroyed()
+ {
+ return beanDestroyed;
+ }
+
+ public static void setBeanDestroyed(boolean beanDestroyed)
+ {
+ SimpleSessionBean.beanDestroyed = beanDestroyed;
+ }
+}
Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamVFSClassloadingUnitTestCase.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamVFSClassloadingUnitTestCase.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamVFSClassloadingUnitTestCase.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -22,10 +22,14 @@
package org.jboss.test.deployers.seam.test;
import java.io.IOException;
+import java.io.Closeable;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
import junit.framework.Test;
@@ -33,8 +37,10 @@
import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
import org.jboss.mx.loading.UnifiedLoaderRepository3;
import org.jboss.test.JBossTestCase;
+import org.jboss.vfs.TempFileProvider;
import org.jboss.vfs.VFS;
import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.VFSUtils;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
@@ -43,6 +49,9 @@
*/
public class SeamVFSClassloadingUnitTestCase extends JBossTestCase
{
+ private TempFileProvider provider;
+ private List<Closeable> handles;
+
public SeamVFSClassloadingUnitTestCase(String string)
{
super(string);
@@ -53,6 +62,18 @@
return suite(SeamVFSClassloadingUnitTestCase.class);
}
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ provider = TempFileProvider.create("test", new ScheduledThreadPoolExecutor(2));
+ }
+
+ public void tearDown() throws Exception
+ {
+ VFSUtils.safeClose(handles);
+ }
+
/*
jboss-seam-booking.ear contents
META-INF/application.xml
@@ -82,14 +103,15 @@
jboss-seam-booking.war/WEB-INF/pages.xml
jboss-seam-booking.war/WEB-INF/web.xml
*/
- protected VirtualFile getRoot(boolean noCopy) throws IOException, URISyntaxException
+ protected VirtualFile getRoot() throws IOException, URISyntaxException
{
URL url = getDeployURL("jboss-seam-booking.ear");
- if(noCopy)
- url = new URL(url.toExternalForm() + "?useNoCopyJarHandler=true");
assertNotNull(url);
VirtualFile vf = VFS.getChild(url);
- assertNotNull(vf);
+
+ handles = recursiveMount(vf);
+
+ assertTrue(vf.exists());
return vf;
}
protected URL[] getEarClassPath(VirtualFile ear)
@@ -117,18 +139,14 @@
public void testURLClassLoader() throws Exception
{
- VirtualFile ear = getRoot(false);
+ VirtualFile ear = getRoot();
testURLClassLoader(ear);
}
- public void testURLClassLoaderNoCopy() throws Exception
- {
- VirtualFile ear = getRoot(true);
- testURLClassLoader(ear);
- }
+
protected void testURLClassLoader(VirtualFile ear) throws Exception
{
URL[] cp = getEarClassPath(ear);
- log.debug("ear classpath: "+Arrays.asList(cp));
+ log.error("ear classpath: "+Arrays.asList(cp));
URLClassLoader loader = new URLClassLoader(cp);
loader.loadClass("org.jboss.seam.example.booking.Hotel");
loader.loadClass("org.jboss.seam.debug.Contexts");
@@ -136,14 +154,10 @@
public void testULRClassloading() throws Exception
{
- VirtualFile ear = getRoot(false);
+ VirtualFile ear = getRoot();
testULRClassloading(ear);
}
- public void testULRClassloadingNoCopy() throws Exception
- {
- VirtualFile ear = getRoot(true);
- testULRClassloading(ear);
- }
+
public void testULRClassloading(VirtualFile ear) throws Exception
{
URL[] cp = getEarClassPath(ear);
@@ -157,13 +171,28 @@
public void testVFSPolicy() throws Exception
{
- VirtualFile vf = getRoot(false);
- VirtualFile child = vf.getChild("jboss-seam-booking.war/WEB-INF/lib/jboss-seam-debug.jar");
- assertNotNull(child);
+ VirtualFile vf = getRoot();
+ VirtualFile childWar = vf.getChild("jboss-seam-booking.war");
+ VirtualFile child = childWar.getChild("/WEB-INF/lib/jboss-seam-debug.jar");
+ assertTrue(child.exists());
VirtualFile[] roots = {child};
ClassLoaderPolicy policy = new VFSClassLoaderPolicy(roots);
URL url = policy.getResource("org/jboss/seam/debug/Contexts.class");
log.info(url);
assertNotNull(url);
}
+
+ public List<Closeable> recursiveMount(VirtualFile file) throws IOException
+ {
+ ArrayList<Closeable> mounts = new ArrayList<Closeable>();
+
+ if (!file.isDirectory() && file.getName().matches("^.*\\.([EeWwJj][Aa][Rr]|[Zz][Ii][Pp])$"))
+ mounts.add(VFS.mountZip(file, file, provider));
+
+ if (file.isDirectory())
+ for (VirtualFile child : file.getChildren())
+ mounts.addAll(recursiveMount(child));
+
+ return mounts;
+ }
}
Modified: branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -27,7 +27,6 @@
import javax.naming.NameNotFoundException;
import org.jboss.logging.Logger;
-import org.jboss.naming.NamingServiceMBean;
import org.jnp.interfaces.MarshalledValuePair;
import org.jnp.interfaces.Naming;
import org.jnp.interfaces.NamingParser;
@@ -48,12 +47,12 @@
public static final String SUBCONTEXT_NAME = "LocalSubcontext";
// private String providerURL;
private NamingParser parser = new NamingParser();
- private NamingServiceMBean naming;
+ private Naming naming;
/* (non-Javadoc)
* @see org.jboss.test.naming.restart.ObjectBinderMBean#setNamingService(org.jboss.naming.NamingServiceMBean)
*/
- public void setNamingService(NamingServiceMBean naming)
+ public void setNaming(Naming naming)
{
// this.providerURL = (naming == null)
// ? null
@@ -86,22 +85,21 @@
// Context ctx = new InitialContext(env);
// ctx.bind(NAME, VALUE);
- Naming namingServer = naming.getNamingInstance();
- namingServer.bind(parser.parse(NAME),
+ naming.bind(parser.parse(NAME),
new MarshalledValuePair(VALUE),
VALUE.getClass().getName());
- log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
- Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
+ log.info("Bound " + VALUE + " to " + naming + " under " + NAME);
+ Context sub = naming.createSubcontext(parser.parse(SUBCONTEXT_NAME));
sub.bind(parser.parse(NAME), VALUE);
log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
// NOTE: we must bind the NonDeserializable directly, or else the
// NamingContext will wrap it in a MarshalledValuePair, which will
// defeat the test by triggering deserialization too late
- namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
+ naming.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
NonDeserializable.class.getName());
- log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
+ log.info("Bound a NonDeserializable to " + naming + " under " + BAD_BINDING);
}
@@ -129,11 +127,10 @@
// Context ctx = new InitialContext(env);
// ctx.unbind(NAME);
- Naming namingServer = naming.getNamingInstance();
try
{
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
+ naming.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -141,8 +138,8 @@
}
try
{
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
+ naming.unbind(parser.parse(SUBCONTEXT_NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -150,8 +147,8 @@
}
try
{
- namingServer.unbind(parser.parse(NAME));
- log.info("Unbound " + NAME + " from " + namingServer);
+ naming.unbind(parser.parse(NAME));
+ log.info("Unbound " + NAME + " from " + naming);
}
catch (NameNotFoundException ignored)
{
@@ -159,8 +156,8 @@
}
try
{
- namingServer.unbind(parser.parse(BAD_BINDING));
- log.info("Unbound " + BAD_BINDING + " from " + namingServer);
+ naming.unbind(parser.parse(BAD_BINDING));
+ log.info("Unbound " + BAD_BINDING + " from " + naming);
}
catch (NameNotFoundException ignored)
{
Deleted: branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
===================================================================
--- branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.naming.restart;
-
-import java.rmi.server.UnicastRemoteObject;
-
-import org.jboss.naming.NamingService;
-import org.jnp.server.Main;
-
-/**
- * Overrides NamingService in startService() to not use the AS's statically
- * cached NamingServer and to unexport the naming stub in stopService().
- * Used to test what happens when this is done, which is a better simulation
- * of the normal way a NamingService is restarted -- via a full server
- * restart.
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class RestartNamingService extends NamingService
-{
- @Override
- protected void startService() throws Exception
- {
- Main main = getNamingServer();
- main.setUseGlobalService(false);
- main.setInstallGlobalService(false);
-
- super.startService();
- }
-
- @Override
- protected void stopService() throws Exception
- {
- super.stopService();
- UnicastRemoteObject.unexportObject(getNamingInstance(), true);
- }
-}
Copied: branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/beans.xml (from rev 101283, trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/beans.xml)
===================================================================
Copied: branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/web-cdi.xml (from rev 101283, trunk/testsuite/src/resources/classloader/leak/war/WEB-INF/web-cdi.xml)
===================================================================
--- branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/web-cdi.xml (rev 0)
+++ branches/vfs3-int/testsuite/src/resources/classloader/leak/war/WEB-INF/web-cdi.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <description>Test servlets used to test session contexts.</description>
+ <display-name>Session Context Tests</display-name>
+ <servlet>
+ <display-name>Introspection Service for Sessions</display-name>
+ <servlet-name>sessionIntrospector</servlet-name>
+ <servlet-class>org.jboss.test.classloader.leak.web.CdiIntrospectSession</servlet-class>
+ </servlet>
+ <servlet>
+ <display-name>Session Invalidation</display-name>
+ <servlet-name>invalidator</servlet-name>
+ <servlet-class>org.jboss.test.classloader.leak.web.CdiInvalidateSession</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>sessionIntrospector</servlet-name>
+ <url-pattern>/IntrospectCDISession</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>invalidator</servlet-name>
+ <url-pattern>/InvalidateCDISession</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified: branches/vfs3-int/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml
===================================================================
--- branches/vfs3-int/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/testsuite/src/resources/naming/restart/naming-restart-jboss-beans.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -21,7 +21,7 @@
</queueless-thread-pool-executor>
</threads>
- <bean name="RestartNamingBean" class="org.jnp.server.NamingBeanImpl">
+ <bean name="RestartLocalNamingBean" class="org.jnp.server.NamingBeanImpl">
<!-- IMPORTANT Ensure we use our own NamingServer and don't screw up the
static ref to the std one in the server-side NamingContext class -->
@@ -30,19 +30,39 @@
</bean>
- <!-- Use our own NamingService subclass that unexports the NamingServer
- in stopService(). This better simulates a server shutdown.
- We don't really want to test a non-shutdown redeploy of the naming
- service as that is a highly unlikely usage. -->
- <bean name="RestartNamingService" class="org.jboss.test.naming.restart.RestartNamingService">
-
- <property name="callByValue">false</property>
- <property name="port">19099</property>
- <property name="bindAddress">${jboss.bind.address}</property>
- <property name="rmiPort">0</property>
- <property name="rmiBindAddress">${jboss.bind.address}</property>
- <property name="lookupPool"><inject bean="RestartNamingThreadPool"/></property>
- <property name="naming"><inject bean="RestartNamingBean"/></property>
+ <bean name="RestartRemoteNamingBean" class="org.jnp.server.Main">
+
+ <property name="namingInfo"><inject bean="RestartLocalNamingBean"/></property>
+
+ <!-- The call by value mode. true if all lookups are unmarshalled using
+ the caller's TCL, false if in VM lookups return the value by reference. -->
+ <property name="callByValue">false</property>
+
+ <!-- The listening port for the bootstrap JNP service. Set this to -1
+ to run the NamingService without the JNP invoker listening port. -->
+ <property name="port">19099</property>
+
+ <!-- The bootstrap JNP server bind address. This also sets the default
+ RMI service bind address. Empty == all addresses -->
+ <property name="bindAddress">${jboss.bind.address:localhost}</property>
+
+ <!-- The port of the RMI naming service, 0 == anonymous -->
+ <property name="rmiPort">0</property>
+
+ <!-- The RMI service bind address. Empty == all addresses -->
+ <property name="rmiBindAddress">${jboss.bind.address:localhost}</property>
+
+ <!-- Set the java.rmi.server.hostname system property to rmiBindAddress -->
+ <property name="enableRmiServerHostname">true</property>
+
+ <!-- The thread pool service used to control the bootstrap lookups -->
+ <property name="lookupExector"><inject bean="RestartNamingThreadPool"/></property>
+ </bean>
+
+ <bean name="RestartNamingService" class="org.jboss.naming.NamingService">
+ <property name="namingInfo"><inject bean="RestartRemoteNamingBean"/></property>
+ <!-- Do not start the injected naming bean -->
+ <property name="startNamingBean">false</property>
</bean>
<!-- Our own HA-JNDI that we can redeploy. Subclasses std HA-JNDI service
@@ -61,7 +81,7 @@
</bean>
</property>
- <property name="localNamingInstance"><inject bean="RestartNamingBean" property="namingInstance"/></property>
+ <property name="localNamingInstance"><inject bean="RestartLocalNamingBean" property="namingInstance"/></property>
<!-- Bind address of bootstrap endpoint -->
<property name="bindAddress">${jboss.bind.address}</property>
@@ -90,7 +110,7 @@
<!-- Binds an object in the above two naming services for remote lookup
by the test client -->
<bean name="RestartObjectBinder" class="org.jboss.test.naming.restart.ObjectBinder">
- <property name="namingService"><inject bean="RestartNamingService"/></property>
+ <property name="naming"><inject bean="RestartLocalNamingBean" property="namingInstance"/></property>
</bean>
Modified: branches/vfs3-int/varia/src/main/java/org/jboss/security/srp/jaas/SRPLoginModule.java
===================================================================
--- branches/vfs3-int/varia/src/main/java/org/jboss/security/srp/jaas/SRPLoginModule.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/varia/src/main/java/org/jboss/security/srp/jaas/SRPLoginModule.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -247,8 +247,10 @@
}
catch(Exception e)
{
- log.warn("Failed to complete SRP login", e);
- throw new LoginException("Failed to complete SRP login, msg="+e.getMessage());
+ if (e instanceof LoginException) throw (LoginException) e;
+ final LoginException loginException = new LoginException("Failed to complete SRP login (" + e.getMessage() + ")");
+ loginException.initCause(e);
+ throw loginException;
}
if( trace )
@@ -324,7 +326,10 @@
}
catch(Exception e)
{
- throw new LoginException("Failed to remove user principal, "+e.getMessage());
+ if (e instanceof LoginException) throw (LoginException) e;
+ final LoginException loginException = new LoginException("Failed to remove user principal (" + e.getMessage() + ")");
+ loginException.initCause(e);
+ throw loginException;
}
return true;
}
@@ -385,11 +390,15 @@
}
catch(java.io.IOException e)
{
- throw new LoginException(e.toString());
+ final LoginException loginException = new LoginException(e.toString());
+ loginException.initCause(e);
+ throw loginException;
}
catch(UnsupportedCallbackException uce)
{
- throw new LoginException("UnsupportedCallback: " + uce.getCallback().toString());
+ final LoginException loginException = new LoginException("UnsupportedCallback: " + uce.getCallback().toString());
+ loginException.initCause(uce);
+ throw loginException;
}
}
@@ -439,8 +448,10 @@
}
catch(Exception e)
{
- log.error("Failed to encrypt aux challenge", e);
- throw new LoginException("Failed to encrypt aux challenge");
+ if (e instanceof LoginException) throw (LoginException) e;
+ final LoginException loginException = new LoginException("Failed to encrypt aux challenge");
+ loginException.initCause(e);
+ throw loginException;
}
return sealedObject;
}
@@ -458,8 +469,10 @@
}
catch(Exception e)
{
- log.error("Failed to create SecretKey", e);
- throw new LoginException("Failed to create SecretKey");
+ if (e instanceof LoginException) throw (LoginException) e;
+ final LoginException loginException = new LoginException("Failed to create SecretKey");
+ loginException.initCause(e);
+ throw loginException;
}
return secretKey;
}
Modified: branches/vfs3-int/webservices/build.xml
===================================================================
--- branches/vfs3-int/webservices/build.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/build.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -162,6 +162,13 @@
<include name="META-INF/stack-agnostic-jboss-beans.xml"/>
</fileset>
</zip>
+
+ <zip zipfile="${build.lib}/jbossws-jboss60-jaxrpc-deployer.zip">
+ <fileset dir="${build.resources}/jbossws-jaxrpc-jboss.deployer">
+ <include name="META-INF/stack-agnostic-jboss-beans.xml"/>
+ <include name="META-INF/jboss-classloading.xml"/>
+ </fileset>
+ </zip>
</target>
@@ -177,6 +184,9 @@
<!-- Build jbossws.deployer -->
<property name="jbossws.deployer.dir" value="../build/output/jboss-${specification.version}/server/default/deployers/jbossws.deployer"/>
<unzip dest="${jbossws.deployer.dir}" src="${build.lib}/jbossws-jboss60-deployer.zip"/>
+
+ <property name="jbossws-jaxrpc.deployer.dir" value="../build/output/jboss-${specification.version}/server/default/deployers/jbossws-jaxrpc.deployer"/>
+ <unzip dest="${jbossws-jaxrpc.deployer.dir}" src="${build.lib}/jbossws-jboss60-jaxrpc-deployer.zip"/>
</target>
</project>
Modified: branches/vfs3-int/webservices/src/assembly/assembly-resources.xml
===================================================================
--- branches/vfs3-int/webservices/src/assembly/assembly-resources.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/assembly/assembly-resources.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -11,6 +11,7 @@
<outputDirectory>/</outputDirectory>
<includes>
<include>jbossws-jboss.deployer/**</include>
+ <include>jbossws-jaxrpc-jboss.deployer/**</include>
<include>jbossws-jboss.jar/**</include>
</includes>
</fileSet>
Copied: branches/vfs3-int/webservices/src/assembly/jbossws-jboss60-jaxrpc-deployer.xml (from rev 101283, trunk/webservices/src/assembly/jbossws-jboss60-jaxrpc-deployer.xml)
===================================================================
--- branches/vfs3-int/webservices/src/assembly/jbossws-jboss60-jaxrpc-deployer.xml (rev 0)
+++ branches/vfs3-int/webservices/src/assembly/jbossws-jboss60-jaxrpc-deployer.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,17 @@
+<assembly>
+ <id>jbossws-jboss60-jaxrpc-deployer</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>src/resources/jbossws-jaxrpc-jboss.deployer</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>META-INF/stack-agnostic-jboss-beans.xml</include>
+ <include>META-INF/jboss-classloading.xml</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCAppClientClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.client.spec.ApplicationClientMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a application-client.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCAppClientClassPathDeployer extends JAXRPCClientClassPathDeployer<ApplicationClientMetaData>
+{
+ public JAXRPCAppClientClassPathDeployer()
+ {
+ super(ApplicationClientMetaData.class);
+ }
+
+ @Override
+ protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+ {
+ ApplicationClientMetaData applicationClientMetaData = ASHelper.getRequiredAttachment(unit, ApplicationClientMetaData.class);
+ return hasJaxRpcMappingReference(applicationClientMetaData.getServiceReferences());
+ }
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCClientClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import java.util.Iterator;
+
+import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a application-client.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public abstract class JAXRPCClientClassPathDeployer<T> extends JAXRPCIntegrationClassPathDeployer<T>
+{
+ public JAXRPCClientClassPathDeployer(Class<T> input)
+ {
+ super(input);
+ setInput(input); //makes the input mandatory instead of optional
+ }
+
+ protected static boolean hasJaxRpcMappingReference(ServiceReferencesMetaData serviceReferences)
+ {
+ if (serviceReferences != null)
+ {
+ for (Iterator<ServiceReferenceMetaData> it = serviceReferences.iterator(); it.hasNext();)
+ {
+ ServiceReferenceMetaData serviceReference = it.next();
+ if (serviceReference.getJaxrpcMappingFile() != null)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCEjbClientClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import java.util.Iterator;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.ejb.spec.EjbJarMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a ejb-jar.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCEjbClientClassPathDeployer extends JAXRPCClientClassPathDeployer<EjbJarMetaData>
+{
+ public JAXRPCEjbClientClassPathDeployer()
+ {
+ super(EjbJarMetaData.class);
+ }
+
+ @Override
+ protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+ {
+ EjbJarMetaData ejbMetaData = ASHelper.getRequiredAttachment(unit, EjbJarMetaData.class);
+ EnterpriseBeansMetaData beansMetaData = ejbMetaData.getEnterpriseBeans();
+ if (beansMetaData != null)
+ {
+ for (Iterator<EnterpriseBeanMetaData> beanIt = beansMetaData.iterator(); beanIt.hasNext(); )
+ {
+ EnterpriseBeanMetaData beanMetaData = beanIt.next();
+ if (hasJaxRpcMappingReference(beanMetaData.getServiceReferences()))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCIntegrationClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.deployers.vfs.plugins.classloader.UrlIntegrationDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.util.StringPropertyReplacer;
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * An abstract deployer that properly set the classpath for JAX-RPC deployments.
+ * This is performed adding a reference to an integration lib from the jaxrpc
+ * deployers to the deployment unit's classpath.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 02-Feb-2010
+ *
+ */
+public abstract class JAXRPCIntegrationClassPathDeployer<T> extends UrlIntegrationDeployer<T>
+{
+ private Set<String> libs;
+
+ private boolean integrationLibsFound = false;
+ private ServerConfig wsServerConfig;
+ private boolean stackRequiresIntegration;
+
+
+ public JAXRPCIntegrationClassPathDeployer(Class<T> input)
+ {
+ super(input);
+ }
+
+ protected abstract boolean isClassPathChangeRequired(VFSDeploymentUnit unit);
+
+ @Override
+ protected boolean isIntegrationDeployment(VFSDeploymentUnit unit)
+ {
+ return stackRequiresIntegration && integrationLibsFound && isClassPathChangeRequired(unit);
+ }
+
+ @Override
+ public void start()
+ {
+ //NOOP
+ }
+
+ protected Set<URL> getJBossWSIntegrationUrls()
+ {
+ Set<URL> result = new HashSet<URL>();
+ try
+ {
+ for (String file : libs)
+ {
+ String url = getServerHome() + file;
+ url = StringPropertyReplacer.replaceProperties(url);
+ VirtualFile integrationLib = VFS.getChild(new URL(url));
+
+ if (integrationLib != null && integrationLib.exists())
+ {
+ integrationLibsFound = true;
+ result.add(integrationLib.toURL());
+ }
+ else
+ {
+ log.debug("Could not find JAX-RPC integration lib: " + url);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Unexpected error: " + e);
+ }
+ return result;
+ }
+
+ /**
+ * Get server home.
+ *
+ * @return the jboss server home location
+ */
+ protected String getServerHome()
+ {
+ return "${jboss.server.home.url}";
+ }
+
+ public Set<String> getLibs()
+ {
+ return libs;
+ }
+
+ public void setLibs(Set<String> libs)
+ {
+ this.libs = libs;
+ setIntegrationURLs(getJBossWSIntegrationUrls());
+ }
+
+ public ServerConfig getWsServerConfig()
+ {
+ return wsServerConfig;
+ }
+
+ public void setWsServerConfig(ServerConfig wsServerConfig)
+ {
+ this.wsServerConfig = wsServerConfig;
+ //the Native stack does not requires the JAXRPC additional integration
+ stackRequiresIntegration = !wsServerConfig.getImplementationTitle().toLowerCase().contains("native");
+ }
+
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServerClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc endpoint deployments;
+ * it's triggered by the WebservicesMetaData which is attached to the unit
+ * when a webservice.xml descriptor file is found in the deployment.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCServerClassPathDeployer extends JAXRPCIntegrationClassPathDeployer<WebservicesMetaData>
+{
+ public JAXRPCServerClassPathDeployer()
+ {
+ super(WebservicesMetaData.class);
+ setInput(WebservicesMetaData.class); //makes the input mandatory instead of optional
+ }
+
+ @Override
+ protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+ {
+ WebservicesMetaData wsmd = ASHelper.getRequiredAttachment(unit, WebservicesMetaData.class);
+ WebserviceDescriptionMetaData[] descriptions = wsmd.getWebserviceDescriptions();
+ for (WebserviceDescriptionMetaData description : descriptions)
+ {
+ if (description.getJaxrpcMappingFile() != null)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/JAXRPCServletClientClassPathDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.web.spec.WebMetaData;
+import org.jboss.webservices.integration.util.ASHelper;
+
+/**
+ * A deployer for properly setting the classpath for jaxrpc client deployments;
+ * it's triggered by the ApplicationClientMetaData which is attached to the unit
+ * when a web.xml descriptor file is found in the deployment.
+ * This deployer then actually enables classpath modification when a jaxrpc-mapping
+ * is specified in the descriptor.
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 03-Feb-2010
+ *
+ */
+public class JAXRPCServletClientClassPathDeployer extends JAXRPCClientClassPathDeployer<WebMetaData>
+{
+ public JAXRPCServletClientClassPathDeployer()
+ {
+ super(WebMetaData.class);
+ }
+
+ @Override
+ protected boolean isClassPathChangeRequired(VFSDeploymentUnit unit)
+ {
+ WebMetaData webMetaData = ASHelper.getRequiredAttachment(unit, WebMetaData.class);
+ return hasJaxRpcMappingReference(webMetaData.getServiceReferences());
+ }
+}
Copied: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java (from rev 101283, trunk/webservices/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java)
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java (rev 0)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/SecurityActions.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.deployers;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 17-Feb-2010
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+}
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSAspectizedDeployersFactory.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -45,7 +45,7 @@
/** Our deployers regitry. */
private final Map<DeploymentAspect, Deployer> deployersRegistry = new HashMap<DeploymentAspect, Deployer>();
-
+
/**
* Constructor.
*
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentAspectDeployer.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -104,7 +104,20 @@
{
this.log.debug(this.aspect + " start: " + unit.getName());
final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
- this.aspect.start(dep);
+ if (this.aspect.canHandle(dep))
+ {
+ //set the context classloader using the proper one from the deployment aspect
+ ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader();
+ try
+ {
+ SecurityActions.setContextClassLoader(this.aspect.getLoader());
+ this.aspect.start(dep);
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(deployerClassLoader);
+ }
+ }
}
}
@@ -121,7 +134,20 @@
{
this.log.debug(this.aspect + " stop: " + unit.getName());
final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class);
- this.aspect.stop(dep);
+ if (this.aspect.canHandle(dep))
+ {
+ //set the context classloader using the proper one from the deployment aspect
+ ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader();
+ try
+ {
+ SecurityActions.setContextClassLoader(this.aspect.getLoader());
+ this.aspect.stop(dep);
+ }
+ finally
+ {
+ SecurityActions.setContextClassLoader(deployerClassLoader);
+ }
+ }
}
}
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/injection/InjectionMetaDataDeploymentAspect.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -46,20 +46,20 @@
import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
import org.jboss.wsf.spi.metadata.injection.ReferenceResolver;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* Deployment aspect that builds injection meta data.
*
* @author <a href="mailto:richard.opalka at jboss.org">Richard Opalka</a>
*/
-public final class InjectionMetaDataDeploymentAspect extends DeploymentAspect
+public final class InjectionMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
/** EJB 3 JNDI prefix. */
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -23,9 +23,9 @@
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* An aspect that builds container independent meta data.
@@ -33,7 +33,7 @@
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
*/
-public final class ContainerMetaDataDeploymentAspect extends DeploymentAspect
+public final class ContainerMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
/** JSE meta data builder. */
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/security/JACCPermissionsDeploymentAspect.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -28,7 +28,7 @@
import org.jboss.web.WebPermissionMapping;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* Generates JACC permissions. (This is temporary and really hacky solution).
@@ -39,7 +39,7 @@
*
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
*/
-public final class JACCPermissionsDeploymentAspect extends DeploymentAspect
+public final class JACCPermissionsDeploymentAspect extends AbstractDeploymentAspect
{
/**
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -23,7 +23,7 @@
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* A deployment aspect that generates web app meta data for EJB endpoints.
@@ -31,7 +31,7 @@
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
*/
-public final class WebMetaDataCreatingDeploymentAspect extends DeploymentAspect
+public final class WebMetaDataCreatingDeploymentAspect extends AbstractDeploymentAspect
{
/** Web meta data creator. */
Modified: branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java
===================================================================
--- branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataModifyingDeploymentAspect.java 2010-02-22 23:09:01 UTC (rev 101284)
@@ -22,7 +22,7 @@
package org.jboss.webservices.integration.tomcat;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
/**
* Modifies web meta data to configure webservice stack endpoints and properties.
@@ -30,7 +30,7 @@
* @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
* @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
*/
-public final class WebMetaDataModifyingDeploymentAspect extends DeploymentAspect
+public final class WebMetaDataModifyingDeploymentAspect extends AbstractDeploymentAspect
{
/** Web meta data modifier. */
Copied: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer (from rev 101283, trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer)
Copied: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF (from rev 101283, trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF)
Deleted: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml
===================================================================
--- trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<classloading xmlns="urn:jboss:classloading:1.0"
- domain="JAXRPCDeployerDomain"
- parent-domain="DefaultDomain"
- export-all="NON_EMPTY"
- import-all="true">
-</classloading>
Copied: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml (from rev 101283, trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml)
===================================================================
--- branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml (rev 0)
+++ branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/jboss-classloading.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<classloading xmlns="urn:jboss:classloading:1.0"
+ domain="JAXRPCDeployerDomain"
+ parent-domain="DefaultDomain"
+ export-all="NON_EMPTY"
+ import-all="true">
+</classloading>
Deleted: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean name="JAXRPCAppClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCAppClientClassPathDeployer">
- <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
- <property name="libs">
- <set class="java.util.HashSet" elementClass="java.lang.String">
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
- </set>
- </property>
- </bean>
-
- <bean name="JAXRPCEjbClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCEjbClientClassPathDeployer">
- <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
- <property name="libs">
- <set class="java.util.HashSet" elementClass="java.lang.String">
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
- </set>
- </property>
- </bean>
-
- <bean name="JAXRPCServletClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServletClientClassPathDeployer">
- <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
- <property name="libs">
- <set class="java.util.HashSet" elementClass="java.lang.String">
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
- </set>
- </property>
- </bean>
-
- <bean name="JAXRPCServerClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServerClassPathDeployer">
- <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
- <property name="libs">
- <set class="java.util.HashSet" elementClass="java.lang.String">
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
- <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
- </set>
- </property>
- </bean>
-
-</deployment>
Copied: branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml (from rev 101283, trunk/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml)
===================================================================
--- branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml (rev 0)
+++ branches/vfs3-int/webservices/src/resources/jbossws-jaxrpc-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="JAXRPCAppClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCAppClientClassPathDeployer">
+ <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
+ <property name="libs">
+ <set class="java.util.HashSet" elementClass="java.lang.String">
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
+ </set>
+ </property>
+ </bean>
+
+ <bean name="JAXRPCEjbClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCEjbClientClassPathDeployer">
+ <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
+ <property name="libs">
+ <set class="java.util.HashSet" elementClass="java.lang.String">
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
+ </set>
+ </property>
+ </bean>
+
+ <bean name="JAXRPCServletClientClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServletClientClassPathDeployer">
+ <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
+ <property name="libs">
+ <set class="java.util.HashSet" elementClass="java.lang.String">
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
+ </set>
+ </property>
+ </bean>
+
+ <bean name="JAXRPCServerClassPathDeployer" class="org.jboss.webservices.integration.deployers.JAXRPCServerClassPathDeployer">
+ <property name="wsServerConfig"><inject bean="WSServerConfig"/></property>
+ <property name="libs">
+ <set class="java.util.HashSet" elementClass="java.lang.String">
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-factories.jar</value>
+ <value>deployers/jbossws-jaxrpc.deployer/jbossws-native-services.jar</value>
+ </set>
+ </property>
+ </bean>
+
+</deployment>
Modified: branches/vfs3-int/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- branches/vfs3-int/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-02-22 22:40:33 UTC (rev 101283)
+++ branches/vfs3-int/webservices/src/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2010-02-22 23:09:01 UTC (rev 101284)
@@ -72,7 +72,7 @@
<incallback method="addDeployer"/>
<uncallback method="removeDeployer"/>
</bean>
-
+
<!-- The AS specific deployment aspects -->
<bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.webservices.integration.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData, VFSRoot</property>
More information about the jboss-cvs-commits
mailing list