We are trying to migrate my application from Websphere 6.1 to JBOSS server 7.1.0.
In my application we are using EJB2.0 and EJB JARs are generated by using IBM ejbdeploy.bat through an Ant script. Stub classes are created by ejbdeploy.bat for the EJB interfaces (we have only interfaces and bean class).
We are trying to use JBoss 7.1.0 server and not able to use ejbdeploy.bat file to generate the stub classes for the EJB interfaces.
How we can create stub classes in JBoss 7.1.0 server using an Ant script? Could you share the Ant build definition in XML?
The web.xml references certain EJBs such as:
<ejb-local-ref id="EJBlRef_00992">
<ejb-ref-name>App/HSession</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.proj.ejb.HSessionHome</local-home>
<local>com.proj.ejb.HSessionLocal</local>
<ejb-link>HSession.jar#HSession</ejb-link>
</ejb-local-ref>
Related
I'm writing a custom Grails 2 plugin to modularize my Grails applications. In the plugin I'm planning to define basic GSPs that can be overridden by the application that will utilize the plugin. I'm thinking of writing a Grails command script that copies those GSPs into the grails-app directory of the app the plugin is installed in. If in the plugin, I put those GSPs in grails-app/views, how do I refer to the actual Grails app directory in the Grails command script, which is also grails-app/views?
The solution to this is almost the same as this answer. The built-in properties basedir and <plugin_name>PluginBaseDir differentiate the target app and the plugin directories.
I've successfully used Grails's inline / inplace plugin notation to develop my Grails app and several plugins concurrently. I only have to compile my Grails app and all the inline plugins get compiled too (great!):
grails.plugin.location.myFooPlugin = '../plugins/foo-plugin'
Can I do the same thing for a Java dependency rather than a Grails plugin?
Let's say I have some Java project that ultimately produces a JAR, but rather than compile and store the JAR in my Maven local repo I'd like to simply compile my Grails app and have the Java project's code also compiled as a result. Possible? If so, what are the rules, such as dir structure adherence? I might want to use Gradle or Maven, not sure.
I'm using a java dependency in my Grails project with help of /scripts/_Events.groovy:
eventCompileStart = {
projectCompiler.srcDirectories << "${basedir}/../your_java_proj/src".toString()
}
The java project will be compiled automatically along with e.g. grails war commando.
I'm trying to diagnose a failure in my ant file when it runs a Worklight task. I have a small ant file containing a simple reference to a Worklight task. This works correctly.
<target name="rawBuildApplication" >
<app-builder
applicationFolder="${applicationSource}"
environments="mobilewebapp"
nativeProjectPrefix="xxx"
outputFolder="${outputFolder}"/>
</target>
However when I invoke this ant file from a build control ant file (actually from the RTC build system) I get a failure (below), showing worklight failing to find an apache Java class. I assume there's some simple environmental difference, perhaps a classpath. It might help to figure it out if I knew where Worklight loaded the apache commons from. Right now I can't see anything in my environment in the case that works that points any apache Jar.
myAntFile.xml:146: java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.deleteQuietly(Ljava/io/File;)Z
at com.worklight.builder.util.BuilderUtils.<clinit>(BuilderUtils.java:672)
at com.worklight.builder.config.UserBuildConfiguration$Builder.<init>(UserBuildConfiguration.java:203)
at com.worklight.ant.builders.ApplicationBuilderTask.createBuildConfiguration(ApplicationBuilderTask.java:149)
at com.worklight.ant.builders.ApplicationBuilderTask.execute(ApplicationBuilderTask.java:80)
Edited: the cause is the use of -lib to add the RTC toolkit directory, exactly why this clashes and how to work around yet to be determined
Usually means you have version of the commons jar in your classpath, and its overriding the one packaged in the worklight-ant.jar. the apache commons files are inside the worklight-ant.jar file
Additional info from djna: I can confirm that when adding the Rational Team Concert (RTC) 3.0 toolkit to the ant classpath, either explicitly with -lib, or when selecting that option in the RTC Build definition some conflicting commons jars are added to the classpath. Worklight packages the classes it needs in its jar, but the -lib folder seems to take precedence.
My workaround is to replace the conflicting jars with later ones. I used these jars
commons-io-2.4.jar
commons-codec-1.8.jar
httpclient-4.2.5.jar
httpcore-4.2.4.jar
httpmime-4.2.5.jar
I guess the other alternative is to upgrade to a newer RTC, but in our environment that's not currently possible.
I have found some code in grails plugins that can be use outside grails. Is there a way to use the code from the plugin as a dependency in a groovy project other than creating two projects?
For example I found the following project:
https://github.com/jeffellis/grails-yammer-metrics
Where they created some annotations for Groovy code that I would like to use outside a grails project.
As of grails 2.1, you can export a plugin as a binary plugin and then declare as a regular jar dependency (via grape in groovy). http://grails.org/doc/latest/guide/plugins.html#binaryPlugins
How reusable the code is would depend on how closely coupled the plugin is to the code, I guess.
Is there a way to specify the directory in which Grails looks for domain classes? I want to have grails enhance domain classes from grails-app/domain as well as test/domain, when running in the test environment.
The reason I need this is that I have some domain classes which I use in a plugin for integration tests. They currently sit in grails-app/domain under a specific package. In the plugin descriptor I ensure that this package is excluded from the plugin build. This works fine when it is packaged as a plugin, however for various reasons we run and build our app with this plugin declared inline in BuildConfig.xml. This causes those domain classes to be compiled into the host application, despite the exclusion declared in the plugin descriptor - so they are deployed with the application and tables are generated for them, which I don't want.
Any ideas?
Thanks.