Posts Tagged jboss

Getting JBossWS working with JDK 6

See https://jira.jboss.org/jira/browse/JBWS-1439 for more details, but essentially, there are some classpath issues with an out of the box JBoss 4.2.x and jdk6 when trying to use JBossWS (Implementation of JAX-WS stack in JBoss Application Server.)

If you run into these problems, there is a simple fix. Copy the conflicting jars into the endorsed directory:

cp -t $JBOSS_HOME/lib/endorsed $JBOSS_HOME/server/all/lib/jboss-jaxrpc.jar \
  $JBOSS_HOME/server/all/lib/jboss-saaj.jar

Fixing the wsdl soap address brokenness

Another problem you might run into is that the default wsdl generated will end up using whatever hostname JBoss thinks it is. This is not necessarily the hostname that is accessible remotely.

To get around this, modify:

$JBOSS_HOME/server/$instanceName/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml

By commenting out the webServiceHost property in WSServerConfig

Tags: , , , ,

Re-configuring JBoss RewriteValve without restarting

At my company, I often make use of the wonderful Rewrite Valve that comes with JBoss Web.  This is very similar to mod_rewrite that you’d use with Apache Httpd, but instead applicable to your JBoss/Tomcat install.  I find it very handy for rewriting short urls outside of your app’s context root.

For instance, how else would I have http://host/a123 really be processed by http://host/MyApp/Processor.action?id=123?  I won’t get into the specifics of configuring tomcat valves or, in particular, this one, but I will briefly touch on something I previously thought was not possible:  Making changes to a running configuration without incurring the downtime of performing a jboss restart.

Assuming that your rewrite valve is configured in your jboss.web engine’s default hostname (i.e. the valve is configured in /Server/Engine/Host/ in $JBOSS_HOME/server/$INSTANCE/deploy/jboss-web.deployer/server.xml) you’d do the following.  I’m using JBoss 4.2.3GA btw.

$JBOSS_HOME/bin/twiddle.sh -s localhost:$JMX_PORT \
  set 'jboss.web:host=$ENGINE_HOST,name=RewriteValve,type=Valve' configuration \
  "$(cat $JBOSS_HOME/server/$INSTANCE/conf/jboss.web/$ENGINE_HOST/rewrite.properties)"

My variables:

JMX_PORT=1099
INSTANCE=default
ENGINE_HOST=localhost

You should then see the configuration print to STDOUT, and the changes will be active.

It would be great if you could do this from the JMX console.  Unfortunately, browsers hose the newlines in your rewrite rules (pretty important) and there’s a bug in the getter implementation of the RewriteValve that might mess things up.

Tags: