Multiple applications with different grails versions on Tomcat - java

I am developing a new web application to be deployed on a tomcat server. There is another application running on that server with an older grails version (2.2.4). I don't want to upgrade it. Is there any issues to take into account while developing / deploying the new application (with grails version 2.4.4). They will run side by side.
Thanks for any help.

It depends where you have your grails libraries. If they are part of another application WAR file you will not have issues as you can pack your own libraries in your application WAR. Each application will use it's own copy of grail libraries.
But if you have your grial libraries as a part of system libraries of tomcat (eg. tomcat/lib ) you can have issues as those libraries are added in classpath for all applications.

Related

How to setup Struts 2 within existing Eclipse by maintaining other configuration?

I am a novice programmer in using Apache Struts 2 MVC Framework. I want to setup Struts 2 within my existing Eclipse IDE and I don't want to harm other different works I do in Eclipse. Here is a list of things I do in Eclipse and other related works:
I am currently using eclipse ide for Java SE developers.
Already using PDT: Eclipse PHP Development within existing eclipse for php projects.
Also using Eclipse CDT:C/C++ Development Tool within existing eclipse.
My computer contains LAMP installed with Apache2 server for web development purpose.
So, I want keep all of these things intact while setting up Struts 2 within existing eclipse. I've seen many installation guidelines for Struts 2, but they didn't clarify well about situation similar to mine.Therefore, before full installation, i want answers of these questions below:
Can I install Struts 2 in eclipse IDE for java SE (not EE) developers ?
Installing Struts 2 requires Apache Tomcat installation, will this installation create any conflict with my existing Apache 2 server (which comes with LAMP)?
Yeah, you need Eclipse for Java EE and Tomcat web server installed. There you can create a dynamic web project and use Maven to manage artifacts and download dependencies. See how to Create Struts 2 Web Application With Artifacts In WEB-INF lib and Use Ant To Build The Application
Tomcat server by default uses port 8080, but Apache uses 80, unless you use the same port for both they won't conflict.

Java ee: Can't create ear project in eclipse using Tomee

I am using Tomee plus as a server for my java ee project in eclipse. I am unable to create an ear project in eclipse as the option for target runtime does not have apache tomcat for option. The only runtime environments I see are:
Basic - which has J2ee runtime library
Jboss
Object Web
Just to clarify, I am able to create a dynamic web project with tomee runtime. The problem is creating an EAR project with tomee runtime. Any help would be appreciated.
I believe you need to install the JST Server Adapters Extensions. I believe this was only added recently (Mars?).

Where to put property file in JBOSS 7 or Glassflish? (Best practice)

I have developed applications for JBOSS EAP 5 with eclipse. I placed property files under server-conf/conf/...
I am now developing in Netbeans (7.2). The bundled glassfish server is used for easier development. The target environment is JBOSS EAP 6. What is the best place to place property files? A common place for both environments would be great.
If you want to have them external to the application you'll probably have to write a custom module. This isn't as bad as it sounds, check out HowToPutAnExternalFileInTheClasspath.
See also migration-issues-to-jboss-7-1
The most practical solution is creating a custom folder outside both JBOSS and Glassfish (i.e C:\PropertiesFolder) then add this folder to the classpath of each server.
Please read my postfor more details about classpath in JBoss

How do I load jar resources into META-INF\resources in a derivative project?

I have a core Web-Base.jar file that has shared components that I use in my web applications.
I'm using Wicket 1.5. While trying to Solve a problem I was browsing the javadoc and found MetaInfStaticResourceReference which I think could improve my applications efficiency, and simplicity.
How can I set up Web-Base so that my Web Applications that list Web-Base as a dependency have the necessary resources added to
META-INF/resources/* in the final .war file?
NOTE: I'm using
wicket 1.5.5
Maven
Tomcat 6 (just started looking into upgrading to Tomcat 7.)
This will work only on Tomcat 7 because this is supported only in Servlet3 specification.
Put the resources in $PROJECT/src/main/resources/META-INF/resources/ folder.

Resolving axis2 and OC4J library conflicts

I'm trying to deploy an Axis2 web service to an OC4J 10.1.3 app server.
I was using axis 1.4 before and had just created my own shared library with all of the files. There was an issue with 1.4 that was patched with 1.5 so now I'm using that but it does not include all of the libraries. This time I deployed the axis2.war to the OC4J server and I'm using the axis2 admin page to attempt to deploy my web service.
If I deploy a web service through axis2 then I'll get a java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z but I cannot find the conflicting library. Axis2 has the new jax-ws libraries in it but I think it's an issue on the OC4J app server. I excluded xml.jar (since it has old JAXB 1.0 libs) and this resolves the issue on my local machine but not on the linux box.
I tried editing the deployment plan to search local folders first and this allows me to deploy the service, but when I try to access it, or the WSDL, then I get an error regarding a class cast exception and JXDocumentBuilderFactory (I don't have the exact error at this moment).
I compared the shared libraries on the linux box with the ones on my local machine and I used the same ones on each (I didn't verify the versions of each jar, though). If axis2 is deployed to OC4J and I deploy my service to axis2 then wouldn't I inherit the axis2 libraries (jax-ws, etc)?
Try removing the inherited library in conflict by adding this to your orion-application.xml:
<orion-application>
<imported-shared-libraries>
<remove-inherited name="PUT_HERE_THE_NAME_OF_THE_LIBRARY"/>
</imported-shared-libraries>
</orion-application>
More here: Removing and/or Replacing an Oracle Shared Library Imported by Default
Edit:
I searched the shared libraries and found that is not there, jws-api.jar is loaded at boot time and can't be removed easily:
Replace the OC4J JAX-WS Libraries
OC4J has preliminary support for JAX-WS, unfortunately this means that during OC4J boot it loads outdated JAX-WS APIs and implementation by Oracle. This occurs even before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in boot.xml file in $ORACLE_HOME/j2ee/home/oc4j.jar bootstrap jar. To get rid of this:
1-Copy the jar file to ${oracle.home}/webservices/lib/jaxws
2-Unpack the OC4J.jar file
3-Locate META-INF/boot.xml
4-Replace path in this line with your jar:
<code-source
path="${oracle.home}/webservices/lib/jws-api.jar"
if="java.specification.version == /1\.[5-6]/"
/>
5-Repackage oc4j.jar (don't forget about MANIFEST.MF - use jar -m META-INF/MANIFEST.MF)
Original article: OC4J Configuration for Web Services

Categories