Am porting web applications which were earlier on Jboss 4.2.3 onto Jboss 6. There are about 12 web applications totally and out of which only 4 are deployed as of now.
These web applications are based on Axis2 1.5.5,spring 2.5,hibernate 3.2.5,OpenJPA 1.0, saxon 9.1.
The classloader isolation is set as follows
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
webapp:loader=webapp.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
I see that the PermGen has already reached 440MB and growing on Jboss 6 and I have set -XX:MaxPermSize=512m
Can anyone provide me inputs in identifying the problem here.
Environment: JDK 1.6.0_26, Ubuntu 11.10
The reason why JBoss 6 is more demanding on the perm gen memory side, i do not know.
But the startup time might be improved when you disable annotation scanning (if not using that). It helped for our application.
I encountered the same problem last week. The JBoss-6 Microcontainer tries to scan for Jboss specific annotations by loading the classes from all the JARs in the class-path on startup. This causes the PermGen bloating as it starts to load all the unwanted classes.
To reduce the amount of scanning, the Microcontainer provides another descriptor hook, by means of jboss-scanning.xml.
Add this 'jboss-scanning.xml' to the WEB-INF inside WARs and ass 'jboss-scanning.xml' to the META-INF inside EARs.
<scanning xmlns="urn:jboss:scanning:1.0">
<!-- Purpose: Disable scanning for annotations in contained deployment. -->
</scanning>
Related
I am running my application in production mode (war is not exploded) on a Glassfish server and I want to know if it's possible to hot swap my front end files?
Currently when I do a hot swap, it only does it in the backend (it being Java). Is it possible to also do it for files under the webapp directory?
The Run/Debug Configuration window for Glassfish-within-IntelliJ supports hot deployment:
For exploded artifacts, the available options are:
Update resources. All changed resources are updated (HTML, JSP, JavaScript, CSS and image files).
Update classes and resources. Changed resources are updated; changed Java classes (EJBs, servlets, etc.) are recompiled.
etc
Looks like you need to choose the Update Resources option.
More details in the docs.
Update 1: for packed (i.e. unexploded) artifacts the available options are:
Hot swap classes. Changed classes are recompiled and reloaded at runtime. This option works only in the debug mode.
Redeploy. The application artifact is rebuilt and redeployed.
Restart server. The server is restarted. The application artifact is rebuilt and redeployed.
There is no support for hot deploying 'front end files' in a unexploded artifact.
all, now i have trouble with shooting - why logs didn't got printed out correctly problem.
There are 4 projects inside tomcat/webapps.
3 of them are using log4j library in the tomcat level lib directory and the other one is having its own log4j library inside its own project.
Each of them are reading their own log4j properties within their project.
I am the owner of the project which has its own log4j within the project classes folder.
and today a senior programmer accuse me because I dont use the tomcat level log4j library and the system get confused with which library should it be used, so the other three projects missing printing out the log.
Would this be true?
If yes, why? Cause my log4j read my own properties and it prints my project information correctly.
Thanks in advance to those who answer this question.
A default tomcat 7 installation does not provide a log4j library. Thus if your project needs this library it is a good idea (IMHO) to include this in your own webapp. If you depend on a specific tomcat server setup it will be hard to use the webapp in another container without changes.
By the way a statement form the tomcat documentation site regarding "using Log4j":
Note: The steps described in this section are needed when you want to
reconfigure Tomcat to use Apache log4j for its own logging. These
steps are not needed if you just want to use log4j in your own web
application. — In that case, just put log4j.jar and log4j.properties
into WEB-INF/lib and WEB-INF/classes of your web application.
I short words - I think you are doing it right and the others are doing it wrong (without knowing the details).
I have a 2 war projects deployed as a library on a weblogic server (version 1 and version 2) and an EAR project deployed on the same server that uses the library.
When I deploy the library version 2 stays on prepared state and the version 1 remains in active state. Does somebody know how can I do to make active the 2nd version of my war?
thanks!
Under deployments, did you try selecting the library of interest and explicitly clicking on Activate? If you do not see the library there, you may have to modify the view of your console to include libraries in your deployment page.
If there are conflicts with the other library, you'll get the full stack trace within the stand log files. You also have the option of stopping the currently 'active' library before enabling the newer one to avoid conflicts.
Third-party libraries are often included by the appliation server you are deploying to and class with the ones included by your application. So far I have dealt with this in the simplest and hackiest way possible: removing the libraries on the app server.
In our case it is ok, noone is relying on the app server to provide them with any libraries. But if I were running my app along with lots of other peoples app, which again might depend on the libraries included by the application server, this would not be a solution.
How is this supposed to be solved (cleanly)? How are you doing it?
An example of a problem might be this:
you build an jax-rs application using cxf, hibernate and jackson, and deploy to glassfish 2.1.1. glassfish supplies the asm 3.1 library, but this causes clashes with hibernate using an incompatible 1.5 version. similarly the application needs jackson 1.8.2 (due to a bug fix), but glassfish 2.1.1 ships with version 0.9. BOOM. Any way of fixing this other than simply removing offending libraries?
consider using :
asadmin deploy --libraries ...
When a class file change, Can I make the glassfish server not restart but still reflect the change ?
I mean the glassfish sever doesn't redeployment(or publish) the application, but only redeployment the class that has changed.
There are a number of ways to redeploy an application onto GlassFish 3.1 that do not require that you restart the server.
The method I would recommend is 'asadmin redeploy --name foo --keepstate=true foo.war' (or use directory deployment for the web app...)
You can look at the man page for the redeploy subcommand of asadmin to learn more about the details.
I hardly ever create a deployable archive file.... I usually do directory deployment, which eliminates the time that would get used up creating and then exploding the archive file.
By using directory deployment I can also apply tweaks to jsp files and other static content to test them without a rebuild/redeploy step.
I like to use the keepstate option while I am doing development.
Another important step that you should take to avoid unnecessary restarts is to move to an open-source OS like Linux or Solaris (away from Windows) which has few file locking problems.
If this is meant to be done while development, you can give a shot to JRebel.