[Design of JBoss Web Services] - Deploying web services in service archive
by alessio.soldano@jboss.com
I've been looking at https://jira.jboss.org/jira/browse/JBWS-2246. As Adrew correctly pointed out, the problem here is that the jbossws deployer relies upon injection into beans declared in server//deploy/jbossws.sar/META-INF/jboss-beans.xml which of course are not available at startup till jbossws.sar itself is deployed.
I'd say everything required for the deployment should go to server//deployers to solve this. But I'm wondering if leaving part of the beans involved in the deployment (mainly the stack specific ones) in the jbossws.sar was done on purpose for a reason I'm missing. Perhaps Thomas or Heiko can suggest here.
I've done some tests, anyway, manually moving all the deploy stuff to server//deployers. The problem I see now with JSE endpoints in sar archives is that jbossws needs the classloader to instanciate classes that live in the generated webapp. To achieve this during the deployment the UnifiedMetaDataDeploymentAspect reads the the context classloader from the JBossWebMetaData. That classloader is previously set in the JBossWebMetaData by the TomcatDeployment, but of course that only happens after the jboss.web:service=WebServer is started (and that lives in server//deploy). So the problem in JBWS-2246 would stay, unless we find another solution for this too. Any suggestion?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178893#4178893
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4178893
17 years, 3 months
[Design of POJO Server] - Re: Testing Bootstrap Dependencies
by istudens@redhat.com
There is a short look at my current implementation.
I have not followed Adrian's advice yet, because I don't know how to implement his idea. I can't even start JBoss server with empty deploy/ directory. Therefore I don't have any clue, how to at first start the AS with empty deploy directory and then deploy an ear and after that all services from all/deploy.
I have not even followed Brian's advice, because after trying methods from org.jboss.test.deployers.AbstractDeploymentTest I have found out that they test a structure of deployment only and hence they pass even if the deployment of the tested SAR fails.
Now my test creates a different profile for each tested module. The snippet of build.xml:
<!-- JBAS-5349 -->
| <target name="bootstrap-dependency-tests" description="Tests bootstrap deployment dependency in new JBossMC.">
| <!-- EJB3 Session Bean -->
| <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Session">
| <module-patternset>
| <include name="bootstrapdependency-ejb3-sessionbean.jar"/>
| </module-patternset>
| </create-bootstrapdependency-config>
| <server:start name="bootstrapdependencyJBAS5349-EJB3Session"/>
| <run-junit junit.patternset="bootstrap-dependency.includes"
| junit.configuration="EJB3Session" />
| <server:stop name="bootstrapdependencyJBAS5349-EJB3Session"/>
| <!-- EJB3 Entity Bean -->
| <create-bootstrapdependency-config baseconf="all" conf="bootstrapdependencyJBAS5349-EJB3Entity">
| <module-patternset>
| <include name="bootstrapdependency-ejb3-entitybean.jar"/>
| </module-patternset>
| </create-bootstrapdependency-config>
| <server:start name="bootstrapdependencyJBAS5349-EJB3Entity"/>
| <run-junit junit.patternset="bootstrap-dependency.includes"
| junit.configuration="EJB3Entity" />
| <server:stop name="bootstrapdependencyJBAS5349-EJB3Entity"/>
| ...
The macro 'create-bootstrapdependency-config' is defined in the imports/server-config.xml:
<macrodef name="create-bootstrapdependency-config"
| description="Create a configuration based on 'all' profile">
| <attribute name="conf" />
| <attribute name="baseconf" />
| <element name="module-patternset" />
| <sequential>
| <server:config>
| <server name="@{conf}" host="${node0}">
| <jvmarg value="-Xms128m" />
| <jvmarg value="-Xmx512m" />
| <jvmarg value="-XX:MaxPermSize=512m" />
| <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
| <sysproperty key="java.net.preferIPv4Stack" value="true" />
| <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
| <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
| </server>
| </server:config>
| <delete dir="${jboss.dist}/server/@{conf}" />
| <create-config baseconf="@{baseconf}" newconf="@{conf}" newconf-src="bootstrap-dependency">
| <patternset>
| <include name="conf/**" />
| <include name="deployers/**" />
| <include name="deploy/**" />
| <include name="lib/**" />
| </patternset>
| </create-config>
| <copy todir="${jboss.dist}/server/(a){conf}/deploy/Aaabootstrapdependency-jbas5349.sar"
| filtering="false">
| <fileset dir="${build.lib}">
| <patternset>
| <module-patternset />
| </patternset>
| </fileset>
| </copy>
| </sequential>
| </macrodef>
I have probably discovered a bug in the 'run-junit' macro in the file import/server-config.xml. There is an argument 'junit.configuration' which sets a 'report.ext' property. This argument should differentiate the outputs of repeatedly runing test. I am not sure if anyone has ever used this, because it does not work. The 'run-junit' macro uses the 'report.ext' property to remember an extension of test name, but in ant any property cannot be changed after it was once set. It means that if you run this macro twice with different junit.configuration arguments, you will get the same report.ext property value and it will be the value of the first one. So I have rewritten this macro to use a property ${report.ext.(a){junit.configuration}} instead of ${report.ext} and simplified the syntax of condition to:
<!-- Set the report extension based on the -->
| <condition property="report.ext.(a){junit.configuration}" value=".xml" else="-(a){junit.configuration}.xml">
| <equals arg1="" arg2="@{junit.configuration}" />
| </condition>
I hope that checking of a status of the SAR's MBean is reliable manner method how to test the result of deployment. I consider it to be the best way how to do it.. the best one I know :)
Should I commit the new test to the https://svn.jboss.org/repos/jbossas/trunk/testsuite/? Should I report the issue of run-junit's bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4178855#4178855
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4178855
17 years, 3 months