WebLogic 10.5.3 + Seam 2.2.1: Application does not start - weblogic-10.x

we have a WAR packaged web application which works on a development machine. It consists of Java EE 5 + Seam 2.2.1 + Hibernate 3.3.1. It uses an Oracle 10g XE database and runs on the latest Tomcat 6 using JDK 1.6.0_24. The system is a 64bit Windows 7 Pro and uses Firefox 6.
Now, we tried to migrate the application to Oracle WebLogic 10.3.5. We followed the Seam manual for specifying the datasource, deploying the JSF lib and configuring the necessary xml-Files. In parallel to that, we verified that a newly seam-gen generated application using the same datasource and having the xml files configured as stated works fine.
But if we try our own application on WebLogic, allthough the deployment works fine, when trying to open the web application in the browser, it shows that endless redirection occured. We don't see any stacktrace or log error, even when configuring log4j in WebLogic. When analyzing the request with Firebug, we see the get request to "login.seam" and then 20 times a get request for "error.seam" (or "debug.seam when setting debug mode) with the response "302 Moved Temporarily".
I worked on that all week now, trying to compare all configurations and couldn't solve it - so I hope to get any ideas what could cause that problem and how to solve it!

I could pin down the problem to starting a transaction on the JTA persistence context.
I still don't understand why I didn't see any log message or stacktrace and why this also happens on the debug/error page (that's why the endless redirect occured).
I ended up using RESOURCE_LOCAL so far, but I'm not sure if this is the right thing to do.
The alternative is disabling the seam transaction setting, but then it didn't work together with the development build which still runs on Tomcat.

Related

Can't get Netbeans Project to acknowledge existing Tomcat or Glassfish Server

I haven't been able to figure out what I'm missing here.
I've installed Tomcat and can spin it up fine. (Glassfish too, in my efforts, but I had removed it when I took the screenshot.)
So now I want to hook my project up to the Tomcat instance so I can have Netbeans deploy it for me automatically.
I right-click on my project, go down to Properties. In Project Properties I select 'Run' and go to the drop down to select my server. Only, there's no servers.
Why is it not showing up here? Am I going about this all wrong?
Thanks in advance for any help!
Other potentially useful notes:
* Using Gradle (for my first time)
* Using Spring Boot (for my first time)
* On Windows 10 (don't hate me, I don't love it either)
I was chasing the wrong problem. Spring-boot provides an embedded server so I had no need to install and provide my own.
My real problem was that I had dependencies declared for jpa, postgresql, etc. that I hadn't configured in application.properties. When I tried to run, I'd get an error saying "a problem occurred starting process /path/to/my/jdk/java.exe". I couldn't figure what was going on and, looking around, I saw the issue mentioned in my question about the server.
The solution was to simply comment out the dependencies in my build.gradle until I was ready for them. After I got my PostgreSQL DB set up and added the configureation to application.properties, I was able to un-comment them and it's working great.

j_spring_security_check not invoked in tomcat

I'm using Tomcat 8.5.4 with myfaces 2.2.10 and primefaces 5.3. My local server works fine (tried to run it both standalone and eclipse) when I open the login screen and press the login button the following is visible in the logs:
...web.controller.LoginController] - <Validating login>
...AntPathRequestMatcher] - <Checking match of request : '/j_spring_security_check'; against '/external/**'>
After this a transaction started and the user is validated against the database as expected.
However when I copied the whole Tomcat distribution to a remote server and deployed the same application, j_spring_security_check is not executed anymore:
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RESTORE_VIEW(1)>
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RENDER_RESPONSE(6)>
[...web.controller.LoginController] - <No error messages during validation>
And after this the login screen is reloaded.
Can anyone help me why there is a difference in the behavior of the same servers and same applications? Any idea is appreciated!
I'm pretty sure that it does not have anything to do with myfaces or primefaces versions and I tried different versions but the behavior is the same...
for those who have the same issue I post my solution.
Of course there can be millions of reasons to cause this behavior but in my case it was the tomcat configuration... in Connector config in server.xml I've set
maxPostSize="0"
by mistake which I tought means no limit, however I should have set
maxPostSize="-1"
This resulted in the server cutting the post payload from the request... and causing me a lot of headache :)

Wildfly Undertow HTTP Response 200 but no content

I am developing a simple web service using Eclipse Java EE IDE for Web Developers : Version: Kepler Service Release 2 Build id: 20140224-0627 and Wildfly-8.2.0.Final. I chose wildfly-javaee7-webapp-blank-archetype using Maven and started development. Firstly, there was no problem, I could add some simple jsp pages and also a simple html page with some images and javascript inclusion then I could deployed, launched and accessed those pages by browser. But all of a sudden, Wildfly (I guess Undertow maybe?) started to response with HTTP response 200 with no content... I really don't get what is going on. I also did rollback my sources to the very early simple pages only. But still the symptoms are the same. Also I have tried to use newer version of Wildfly-9.0.1.Final and deployed manually but I haven't seen any difference.
ex1) this is ok. (Of course browsers take care of this...)
ex2) this kind of contents won't be loaded and sent back as content 0...
I doubted local path issue but I haven't changed anything and it was loaded earlier.
It would be really appreciated if somebody could give me a solution.
Finally I have solved this problem. I have found a problem on a servlet I have added at last. Actually I was trying to migrate my web service running on glassfish and did migrate files one by one. I specified a URL to be handled by the servlet in Web.xml when it run on glassfish. But somehow, it's not working on Wildfly which means all URL request are unexpectedly handled by the servlet... Since I have no idea to specify url to be handled by the specific servlet in Web.xml for Wildfly, I decided to filter request URL in the servlet code. So it is working now. Thank you guys trying to help me...

Problems with setting up ActiveMQ on Tomcat with Flex, BlazeDS

As i have seen on one of forums, i'm "tomcat idiot". And, unfortunately, BlazeDS, ActiveMQ idiot too :(
I have big project, built with Tomcat, Flex 4, BlazeDS and Spring. Oracle is our database. As IDE we're using IntelliJ Idea 10.5.
At this time i'm trying to add messaging (JMS) to our project. I chose ActiveMQ as JMS provider for our system.
First of all, i tried to set up ActiveMQ for starting as standalone application (manual running of activemq.bat). For example of set-up, i used article of M.Martin
Than I tried to analyze problems and used ActiveMQ help about ActiveMQ and Tomcat tuning.
But nothing helped to me. After running our web app, i've got this error from flex:
[MessagingError message='Destination "message-destination" either does not exist or the destination has no channels defined (and the application does not define any default channels.)']
I can post here config files, that i've got as the result of my trainings.
I loaded them on free file hosting here

Releasing Hibernate Resources On Redeploy

I have a web app running on Tomcat 6.0.35, which makes use of Spring 3.1.2, Hibernate 4.1.8 and MySQL Connector 5.1.21.
I have been trying to figure out what is causing Tomcat to keep running out of memory (Perm Gen) after a few redeploys.
Note: Don't tell me to increase Tomcat's JVM memory because that will simply postpone, the problem
Specifically, I made use of the VisualVM tool, and was able to eliminate some problems, including some mysql and google threads issues. I was also able to discover and fix a problem caused by using Velocity as a singleton in the web app, and also not closing at the correct time/place some thread local variables I was having. But I still am not completely able to eliminate/figure out this Hibernate issue.
Here is what I'm doing:
Deploy my webapp from my development IDE
Open a tomcat manager window in my browser
Start VisualVM and get the HeapDump on the tomcat instance
Go the tomcat manager and redeploy my webapp
Take another HeapDump in VisualVM
My first observation is that the WebappClassLoader for the original webapp is not garbage collected.
When I scrutinize the retained objects from the second HeapDump, the class org.hibernate.internal.SessionFactoryImpl features prominently which leads me to believe that it IS NOT being destroyed/closed by Spring or something along those lines (and hence the WebappClassLoader still having a reference to it).
Has anyone encountered this problem and identified the correct fix for it?
I don't currently have an idea what could be amiss in your setup but what I know is that using Plumbr you'll most likely find the actual leak(s).

Resources