I've written a custom log4j appender that creates a new Solr document for each log entry and I'm having problems deploying it to JBoss.
The source is viewable on github but the real problem is trying to use the appender from JBoss.
The relevent bits of jboss-log4j.xml look like this:
<appender name="SOLR" class="com.stuartgrimshaw.solrIndexAppender.SolrIndexAppender" />
<root>
<priority value="${jboss.server.log.threshold}"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
<appender-ref ref="SOLR"/>
</root>
The dependencies for Solr are all available in the .war file that's supplied, but I'm guessing that when the appender is initialised quite early on in the boot process, that application hasn't been deployed yet, which is why I see this error in the log:
2009-11-29 10:40:57,715 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Create: name=jboss.system:service=Logging,type=Log4jService state=Configured mode=Manual requiredState=Create
java.lang.NoClassDefFoundError: org/apache/solr/client/solrj/SolrServerException
Is there any way I can delay the initialization till the solr app has been deployed, or is there a way to deploy the Solr app so it's libraries are visible to jboss while it boots?