Several IDEA 12 eap issues.

Hey all:

I am currently using IDEA 11 to run/deploy our spring web application locally and it is working great.
I try to load up the same application in IDEA 12 and I have a few issues.

1) When requesting a page I get the following exception.

org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space
     org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:837)
     org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
     org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
     org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
     com.follett.fheg.ecommerce.onlineadoptions.web.security.filter.AccountAccessValidationSecurityFilter.doFilter(AccountAccessValidationSecurityFilter.java:86)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
     org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
     org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
     org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
     org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
     org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
     org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
     org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

root cause

SEVERE: A child container failed during stop java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost]]      at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)      at java.util.concurrent.FutureTask.get(FutureTask.java:83)      at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1184)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:502)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:753)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      at org.apache.catalina.startup.Catalina.stop(Catalina.java:742)      at org.apache.catalina.startup.Catalina.start(Catalina.java:704)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:597)      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450) Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina].StandardHost[localhost]]      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)      at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1582)      at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1571)      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)      at java.util.concurrent.FutureTask.run(FutureTask.java:138)      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)      at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.catalina.LifecycleException: A child container failed during stop      at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1191)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      ... 7 more Nov 9, 2012 10:35:14 AM org.apache.catalina.startup.Catalina stop SEVERE: Catalina.stop org.apache.catalina.LifecycleException: Failed to stop component [StandardServer[8005]]      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)      at org.apache.catalina.startup.Catalina.stop(Catalina.java:742)      at org.apache.catalina.startup.Catalina.start(Catalina.java:704)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)      at java.lang.reflect.Method.invoke(Method.java:597)      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450) Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardService[Catalina]]      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)      at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:753)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      ... 8 more Caused by: org.apache.catalina.LifecycleException: Failed to stop component [StandardEngine[Catalina]]      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)      at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:502)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      ... 10 more Caused by: org.apache.catalina.LifecycleException: A child container failed during stop      at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1191)      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)      ... 12 more





4) In Idea 11 I configure the tomcat logs to be shown in the console and it's been working great. I did the same thing in Idea 12 and I see nothing in the open Tomcat console tab.



Attachment(s):
11-9-2012 10-40-51 AM.png
11-9-2012 10-34-38 AM.png
6 comments
Comment actions Permalink

Lets walk through the points:

1)
- It's not clear, is the OutOfMemory exception reported by IDEA (via the IDEA log) or by Tomcat itself (via the Tomcat log)?
- Please provide complete stacktrace of the exception
- Does IDEA version is the only changed part of the environment?
  Please check:
-- if the version of the JDK of the Tomcat is the same when IDEA 11 and when IDEA 12 is used
-- if the version of the JDK of the IDEA is the same when IDEA 11 and when IDEA 12 is used
-- if the Tomcat has the same memory (especially PermGen) available when IDEA 11 and when IDEA 12 is used


2) IDEA opens an url in the browser exactly as it was specified in the run configuration, so it's your application, which redirects to a page with "jsessionid",
which in turn look like caused by 1)

3) On red stop button press, IDEA runs the shutdown script of Tomcat, which may fail (in your case, it looks like caused by 1) again).
IDEA can't detect if shutdown script failed or not, so right after press, the red stop button turns into skull button,
which should be pressed it you are sure the Tomcat shutdown script failed and want just to kill server process directly.
So, IDEA behave in your case just as expected.

4) Please provide the exact steps of how have you configured the Tomcat logs (including concrete log paths)
0
Comment actions Permalink


1) Tomcat was using jdk 7 while my IDE both 11 and 12 were using jdk1.6.0_26. I have changed this and now everything is using jdk1.6.0_26
   After the change I still see the same thing happening. I can open up 11 and run perfectly, but 12 still has issues.

   I do not receive the same Permgen mesage in 11 only when using 12.

   I receive the following in the IDEA 12 console output when making a request to the web application.

   Exception in thread "http-bio-8080-exec-13" java.lang.OutOfMemoryError: PermGen space
   Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
   Exception in thread "RMI TCP Connection(idle)" java.lang.OutOfMemoryError: PermGen space

   I don't understand what you're asking here?
   "if the Tomcat has the same memory (especially PermGen) available when IDEA 11 and when IDEA 12 is used"


2) I guess I don't understand why 11 would behave correctly and open up to http://localhost:8080 as it is configured, but when using 12  it add the jsessionid and open up
    to the home page with no styles? There is nothing different here I just open up a new ide.

3) ok.

4) Open Run > Edit Configurations. In the left hand pane I have a Tomcat Server entry with my web app listed below.
    Select my web app on the left then click the "Logs" tab in the right hand pane. Click the + (plus) button.
    From the open dialog enter an alias name and navigate to the server logs.. C:\servers\apache\apache-tomcat-7.0.27\logs\catalina.out
    click OK.

0
Comment actions Permalink

1) As a workaround, you may try the solution described here: http://www.mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/

Since I'm unable to reproduce the issue myself, I need additional information from you.
Please do the following:

- remove (comment out) first '@echo off' lines of all the .bat files in <Tomcat home>/bin
- add 'set' line as the first one to the <Tomcat home>/bin/catalina.bat
- launch Tomcat from IDEA 11 and attach complete Tomcat console output
- launch Tomcat from IDEA 12 and attach complete Tomcat console output

2) Actually, I just want to say that IDEA 12 opens http://localhost:8080 as well as the IDEA 11, but since Tomcat instance is broken,
your application redirects browser to the url with 'jsessionid'. (Redirection is fast, so you may not be able to notice it happens).
Anyway, I expect it to be just a side effect of 1) that will go away once 1) is solved.

4) I'll investigate the issue separately.

Regards,
Michael
0
Comment actions Permalink

Attached is the console output you asked for.
Please let me know if there is anything else I can provide.

I apologize if I am not understanding and asking silly questions.
But, how is the tomcat instance broken if the application runs well under Idea 11, but broken when I launch with 12?



Attachment(s):
idea12.txt.zip
idea11.txt.zip
0
Comment actions Permalink

I dont' think it is Tomcat being broken is the issue.

Using Intellij 12, if I deploy the application to Tomcat 7 and then start the application server from the /bin (./startup.sh) directory (not using Intellij) my web application works perectly.
But, If I deploy and start the server using intellij 12 I get all the issues listed above.

0
Comment actions Permalink

Well, Tomcat support in IDEA 12 was reworked, so it relies on JMX now.
Yet, it's hard to believe that IDEA 12 could make Tomcat run out of Perm Gen memory, since use of Tomcat JMX interface is far from being intensive.

Another point: it could happen, that when you move from IDEA 11 to IDEA 12,
the IDEA settings and/or Tomcat settings / run environment were not preserved.
It's hard to investigate which particular setting could cause the issue,
but this is most common source of similar problems.
So, I'm trying to focus investigation on possible differences between the launch environments.

From the output of IDEA 11 case, I can see following:
1) applications deployment was started before Tomcat startup was finished
("...org.apache.catalina.startup.HostConfig deployDescriptor..." before "...Server startup in...")
- this itself was the issue of IDEA 11, since deployment may fail if started before server startup is finished.
2) "Deploy applications configured in Tomcat instance" checkbox of the IDEA Tomcat run configuration is checked so the default applications are deployed
3) it looks like there is the conflict of deployments - according to "WARNING: A docBase C:\servers\apache\apache-tomcat-7.0.27\webapps\OnlineAdoptionsWeb inside the host appBase has been specified, and will be ignored".
Could it be possible that the artifact being deployed from IDEA (as C:\Users\cjenkins\.IntelliJIdea11\system\tomcat\Unnamed_OnlineAdoptionsWeb_2\conf\Catalina\localhost\ROOT.xml)
is already present in the Tomcat instance (as C:\servers\apache\apache-tomcat-7.0.27\webapps\OnlineAdoptionsWeb).
If so, it is possible that the artifact being deployed from IDEA is ignored and the already present in the Tomcat instance artifact is actually used.

The output of IDEA 12 looks incomplete, since I cannot see any messages related to a deploy operation.

To investigate further, I need the following:
- complete Tomcat console output in case of IDEA 12 - including deployment messages and exceptions when are trying to access the page
- Tomcat log in case of IDEA 12
- Tomcat log in case of IDEA 11
- screenshot of Tomcat run configuration (Run -> Edit configurations...) in case of IDEA 12 - both Server and Deployment tabs
- screenshot of Tomcat run configuration (Run -> Edit configurations...) in case of IDEA 11 - both Server and Deployment tabs

Also, I would recommend you to investigate the Perm Gen memory space, used by Tomcat in both cases.
You may follow the following workflow:
1) start Tomcat from IDEA
2) connect to Tomcat server process with jconsole (tool from JDK)
3) make the Perm Gen chart shown: Memory tab -> Chart: -> Memory Pool "Perm Gen"
4) access the page which causes the exception
The displayed chart will show you, how the occupied Perm Gen memory space changes when you are accessing the page.
If chart of IDEA 12 case will have not much difference from IDEA 11 case, then (most probably) you just need to give your Tomcat more Perm Gen space
(specify -XX:PermSize=<required memory space> in 'VM options' of the IDEA Tomcat run configuration).
Of course, it would be good if you attach screenshots of the Perm Gen charts here.
0

Please sign in to leave a comment.