简体   繁体   中英

Grails JBOSSAS Plugin -- How To get it To Work?

Newbie Question:

I've been required to deploy a grails app to jboss 5. I'm having a hell of a time figuring out how to take advantage of the grails jbossas plugin. I've followed the documentation as best as I know how, but I get the same exceptions just as if the plugin was never there.

Here's the documentation i've been following: http://grails-plugins.github.com/grails-jbossas/docs/manual/guide/2%20Usage.html

I've added the plugin to the BuildConfig.groovy plugin{} closure. I then called grails war . Nothing happens and my war deploy bombs out.

Could somebody give a newbie a little hand holding to get this plugin to work? Unfortunately, I'm finding the documentation to be wanting in the regard of actually telling you how to use it, or when the plugin will do its magic.

UPDATE:

My environment:

  • Mac OS X Lion Dev machine
  • Grails 2.0.3
  • JBoss 5.1.0 -- running a Liferay instance.

Burt, I've done the following:

  1. grails generate-jboss-deploy 5
  2. grails war .
  3. scp the generated war file to the deploy-jboss directory on my remote server.

Dutifully, jboss picked up the new war and attempted to deploy it. I'm getting the following (now dreaded) exception:

Caused by: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator

Per the usage instructions, I've modified Datasource.groovy 's hibernate configuration:

hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
validator.apply_to_ddl = false
validator.autoregister_listeners = false
}

The only file that seems to have been modified or created by running the generate-jboss-delpoy 5 script is WEB-INF/jboss-web.xml . It's contents are:

<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
    <loader-repository>
        sappi-label:loader=sappi-label.war
        <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
    </loader-repository>
</class-loading>
</jboss-web>

I confirmed that the jboss-web.xml file is present in the generated war file (exploded, then checked the directory).

Burt: what files other than jboss-web.xml should have been altered?

UPDATE (Again):

I don't think there's anything wrong with the jbossas plugin. I've done more testing and see that the plugin is doing what it is supposed to do: remove jars, put in jboss-web.xml. I haven't been able to confirm that it modifies the hibernate config, but I assume it is. I think the problem lies within the server I'm attempting to deploy to, a Liferay instance.

regardless of what I'm doing I get an exception saying that slf4j was unable to load successfully. Nothing more, nothing less. I'll keep whacking away at the problem, but it is out of scope of my original question. Burt, thanks for your help. If you have any ideas about why slf4j vomits in a Liferay/jboss environment, please let me know.

Regards.

Thanks!

I guess I didn't make it clear that you need to run the generate-jboss-deploy script, passing in the major version of JBoss that you're using, so in your case generate-jboss-deploy 5 . I've updated the docs to describe this.

If this doesn't help please update your question with some indication of what the errors that you're seeing are.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM