jboss seam deployment error - jboss

I am using the JBoss Tools to deploy a seam application to a JBoss server from within eclipse. I am consistently seeing a strange behavior. Every time the .xhtml files are changed the seam application is auto-deployed as expected. However, the entity manager instance is becoming null and I am forced forced to restart the seam application by removing it and adding it through the eclipse server view. The whole process is taking more time than I can afford. Is there a workaround to this problem?

If you change a xhtml file only that single file should be copied and the entitymanager should not be affected. Are you refreshing the browser ? Triggering some specific action on that page ?

I'm guessing you use JBoss 5.1.0 server? If yes, there are a bunch of problems with this server while working with Seam especially in version 2.2.0. You may also read about general problems with deployment to JBoss5 container.
The other thing you must remeber is to set debug mode for Seam and development mode for facelets. Whitout this two configurations hot deployment won't work.

Related

JSP auto-deploy not work on Spring/JPA project with Eclipse and Liberty

I work with a Spring 4 project on Eclipse and IBM Liberty as Application server. Well, every minimal JSP edit I have to restart the whole server and it take almost 3 minutes.
Application is an EAR container with seven web projects (only one is spring) and others java libraries
Auto deploy is configured, indeed all java class editing is immediatly deployed.
anyone know as extending auto deploing to jsp?
It would be helpful if you mentioned which Liberty features you have enabled on your server. Regardless, I think I know the answer. You most likely have either javaee-7.0 or at least cdi-1.2 enabled...or some other feature that requires cdi-1.2.
The issue you are describing sounds a lot like the issue fixed in APAR PI58316:
http://www-01.ibm.com/support/docview.wss?uid=swg1PI58316
During a JSP request, your Spring jar(s) are likely causing the JSP request processing to invoke the cdi-1.2 code which had this problem. This resulted in changes to a JSP file to not show up on a new request...the server had to be restarted. You would not see this issue with a very simple JSP project that did not contain Spring or other code that would have a dependency on CDI. Also, this issue is specific to a JSP request, which is why you see your other Java class editing being reloaded without any issue.
This issue is now fixed with APAR PI58316 which is included in WebSphere Liberty fixpack 16.0.0.2. I would recommend that you upgrade to that level to see if your issue is resolved.
Yeah! I found this is a bug of WebSphere Liberty 8 version.
On Liberty new version (16) there is a fix.
See this link http://www-01.ibm.com/support/docview.wss?uid=swg1PI58316
Here another topic of this problem Websphere liberty profile jsp changes are not reflected using Spring data jpa library

Glassfish: Fast hot deployment setup

What is a good setup for really fast hot deployment of a Java EE application to Glassfish, so the changes are visible in less than e.g. 1 second?
Currently I'm using Eclipse Luna to develop a JSF2.1 application on Glassfish 3.1.2. When I change something in a jsf, a managed bean or an ejb, it takes ages to deploy the changes. I've already found some good advise,
GlassFish (real) hot deployment of JSF pages and resources (CSS etc.) in Eclipse
Glassfish taking 20s to do hot deployment, is that right?
but I don't think I can speed up my setting to get the deployment under e.g. < 1sec. Also I think "directory deployment" is not supported in GF3.
So what setup can you recommend? Should I switch to Netbeans? Or are there any hidden Eclipse settings to speed this up? Or do you reach fast hot deployments with Eclipse Luna and I'm just missing some properties?
Some more information: I have to use GF3.1.2 Furthermore I use maven, the backend jar and the front end war are bundle together in an ear file. I use EJBs and JPA to connect to a DB2 database. So except GF nothing special.
As far as I know, Glassfish does not support hot deployment. You would need something like JRebel to accomplish that. In case you're not bound to glassfish you might consider switching to wildfly or some other AS that supports this feature.

Eclipse Jboss processess

I have a couple of questions concerning the way Eclipse 4.3 and JBoss EAP 6.1 work together.
The first would be concerning the Server clean function. Does it matter if the server is running or not when that function is selected within Eclipse? I have tried both ways and get no indication one way or the other that it has preformed the task.
The other question concerns the hot deploy. I'm just starting a project so I have errors in my files, mostly the configuration files. Everything complies clean. When Eclipse deploys my war file it does so with something like 0.0.1-SNAPSHOT.war. It's always the same name so I can't tell if mu updates have been deployed.
The way I'm currently processing my deploys is to:
1. Undeploy the war file from within the Server Admin page
2. Do a Maven clean
3. Do a project clean
4. Do a war build
5. Redeploy from within the Server Admin page.
So this question would be how to determine if my current changes have been deployed? Is there a better way of doing it than the way I currently doing it?
Thanks for the support.
Since you are using Maven, you could use the Maven JBoss Deployment plugin. This would make the entire process automated. Sometimes the Eclipse integration doesn't work like you expect it to. Additionally, you should see on the JBoss command line console from where you started JBoss, that the old war is undeployed and deployed.

Debugging a Spring MVC application running on Tomcat

I am asking the correct way of debugging a Dynamic Web Application in Eclipse.
I have two sort of files:
the view: jsp
the controller: Spring Controller
When I changed a jsp file, whether in debug mode or not, the change will be reflected seamlessly.
But whether in debug mode or not, if i change controller's content, all the application will be redeployed to tomcat. Even some time, the tomcat fails to redeploy (restart).
Is there a more appropriate way to debug such an application?
What JDK implementation are you using? I had a similar problem when using the standard Sun HotSpot JDK 1.6. It was fixed when I switched to using JRockit JDK. I believe Oracle plans to integrate these two implementations in the foreseeable future.

JBoss ejb3.0 instant hot deployment

I am newbie with jboss-eclipse. I have to work on javaEE5 with JBoss AS 5.1.0.GA. I don't want to use JRebel at the moment.
I installed "Eclipse Java EE IDE" with "JBoss Tools". I added the JBoss 5.1 Runtime server on eclipse and added a new ear project with :
an EJB3.0 class in ejb project;
a javabean class and index.jsp in web project.
I noticed when I make a modification in the jsp file, I can see instantly the changes after refreshing the web browser. That's ok.
When I modify EJB and javabean classes, there is no instant hot deployment. I have to restart the ear application (without restrating jboss server) or "full publish" the ear via eclipse to see changes.
Is there any way to have instant hot deployement for EJB and javabeans?
PS: I tried "incremental" publish but it hasn't worked.
Thank you!
You do need 3rd party tools for that, the most notable being JRebel. Without advertising I have to say this tool has saved me lots and lots of hours already while developing EE applications.
In jboss AS 7.1.1 you just have to go to the as admin console at localhost:9990 and select: Profile -> Core -> Deployment Scanners -> Auto-Deploy Exploded . You might also want to change the scan interval to something smaller. Afterwards, you may deploy your application for the first time by selecting "Run on Server". From this time on, your application will get automatically deployed whenever you change a file and it manages to compile.
I do not know if Jboss 5.1 has this feature, and if I were you I'd consider using 7.1.1 for development when it does not have it.
The hot deployment works fine with JBoss when publishing new files in your deploy folder, only class exchange will not happen in your currently deployed application.
That's why you see changes to all static content like HTML files immediately, but not changes to your java code.
In order to do activate them, you'll have to restart your application (not the whole JBoss, only your application, done for example in JBoss server view).
I have no practical experience with JRebel and I do believe that it saves you time, but you have to be careful with such tools, as they can introduce new problems which you spend much times in debugging, ending up in restarting the container and everything works fine.