You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "bernard (Created) (JIRA)" <ji...@apache.org> on 2012/03/17 23:58:39 UTC

[jira] [Created] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

wicket-core-1.5.5.jar not closed when Application is undeployed from directory
------------------------------------------------------------------------------

                 Key: WICKET-4458
                 URL: https://issues.apache.org/jira/browse/WICKET-4458
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.5
         Environment: java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
            Reporter: bernard


How to reproduce:

- Create a 1.5.5 quickstart
- deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
- open the application in the browser
- undeploy the application
- try to execute the maven clean goal or try to delete the target dir

Error in GlassFish log:
Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar

I first thought that this was a GlassFish issue such as:

http://java.net/jira/browse/GLASSFISH-17339

To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:

In the Application class:

    @Override
    public void onDestroy() {
        super.onDestroy();
        ClassLoader parentClassLoader = this.getClass().getClassLoader();
        ClassLoader classLoader;
        do{
            classLoader = parentClassLoader; 
            if(classLoader instanceof WebappClassLoader){
                WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
                glassFishLoader.closeJARs(true);
                break;
            }
            parentClassLoader = classLoader.getParent();
        }while(parentClassLoader != classLoader && parentClassLoader != null);
        
    }
	
but this did not fix the problem.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "bernard (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13249745#comment-13249745 ] 

bernard commented on WICKET-4458:
---------------------------------

Hi Martin and Andrea,

Thanks very much! It works for me, in fact I have made both tests and I can see the difference immediately. I use WinXP 32bit. In 1.5.5 it always reproduces for me. Sorry for the frustration at your end - these things can be tricky.

BTW do you know how to change email in Jira? My ID is the old email address. My email has changed and therefore I was a bit slow responding because I don't get Jira's emails anymore.
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4458.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0-RC1
                   1.5.6
    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reopened WICKET-4458:
-------------------------------------

    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-4458:
---------------------------------------

    Assignee: Martin Grigorov
    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>            Assignee: Martin Grigorov
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "bernard (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234190#comment-13234190 ] 

bernard commented on WICKET-4458:
---------------------------------

I understand. No problem. Actually I was the one who noticed that the link to the tool was broken - now it is back.

- Shutdown GlassFish
- start GlassFish in debug mode
- open the maven project in NetBeans
- run the tool: 
java -classpath C:\zip\zip1\java\util\ZipFileMonitor.jar;"%JAVA_HOME%/lib/tools.jar" util.ZipFileMonitor -host 127.0.0.1 -port 9009 -filter wicket
- deploy/run the project
- undeploy the project
- execute the show command in the utility console

show
Current list of opened but unclosed jar files matching the filter:
Path "C:\bt\java\servlet\Wicket\issues\_current\GlassFishJarNotReleased\myproject\target\myproject-1.0-SNAPSHOT\WEB-INF\lib\wiore-1.5.5.jar"
..Opened by hashCode object 1989 from:
    java.util.jar.JarFile.<init>(java\util\jar\JarFile.java:137)
    java.util.jar.JarFile.<init>(java\util\jar\JarFile.java:72)
    sun.net.www.protocol.jar.URLJarFile.<init>(sun\net\www\protocol\jar\URLJarFile.java:72)
    sun.net.www.protocol.jar.URLJarFile.getJarFile(sun\net\www\protocol\jar\URLJarFile.java:48)
    sun.net.www.protocol.jar.JarFileFactory.get(sun\net\www\protocol\jar\JarFileFactory.java:65)
    sun.net.www.protocol.jar.JarURLConnection.connect(sun\net\www\protocol\jar\JarURLConnection.java:104)
    sun.net.www.protocol.jar.JarURLConnection.getInputStream(sun\net\www\protocol\jar\JarURLConnection.java:132)
    java.net.URL.openStream(java\net\URL.java:1010)
    org.apache.wicket.Application.initializeComponents(org\apache\wicket\Application.java:499)
    org.apache.wicket.Application.initApplication(org\apache\wicket\Application.java:808)
    org.apache.wicket.protocol.http.WicketFilter.init(org\apache\wicket\protocol\http\WicketFilter.java:374)
    org.apache.wicket.protocol.http.WicketFilter.init(org\apache\wicket\protocol\http\WicketFilter.java:309)
    org.apache.catalina.core.ApplicationFilterConfig.getFilter(org\apache\catalina\core\ApplicationFilterConfig.java:264)
    org.apache.catalina.core.ApplicationFilterConfig.<init>(org\apache\catalina\core\ApplicationFilterConfig.java:120)
    org.apache.catalina.core.StandardContext.filterStart(org\apache\catalina\core\StandardContext.java:4685)
    org.apache.catalina.core.StandardContext.start(org\apache\catalina\core\StandardContext.java:5377)
    com.sun.enterprise.web.WebModule.start(com\sun\enterprise\web\WebModule.java:498)
    org.apache.catalina.core.ContainerBase.addChildInternal(org\apache\catalina\core\ContainerBase.java:917)
    org.apache.catalina.core.ContainerBase.addChild(org\apache\catalina\core\ContainerBase.java:901)
    org.apache.catalina.core.StandardHost.addChild(org\apache\catalina\core\StandardHost.java:733)
    com.sun.enterprise.web.WebContainer.loadWebModule(com\sun\enterprise\web\WebContainer.java:2018)
    com.sun.enterprise.web.WebContainer.loadWebModule(com\sun\enterprise\web\WebContainer.java:1669)
    com.sun.enterprise.web.WebApplication.start(com\sun\enterprise\web\WebApplication.java:109)
    org.glassfish.internal.data.EngineRef.start(org\glassfish\internal\data\EngineRef.java:130)
    org.glassfish.internal.data.ModuleInfo.start(org\glassfish\internal\data\ModuleInfo.java:269)
    org.glassfish.internal.data.ApplicationInfo.start(org\glassfish\internal\data\ApplicationInfo.java:301)
    com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(com\sun\enterprise\v3\server\ApplicationLifecycle.java:461)
    com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(com\sun\enterprise\v3\server\ApplicationLifecycle.java:240)
    org.glassfish.deployment.admin.DeployCommand.execute(org\glassfish\deployment\admin\DeployCommand.java:389)
    com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:348)
    com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:363)
    com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:1085)
    com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:95)
    com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:
    com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(com\sun\enterprise\v3\admin\CommandRunnerImpl.java:
    com.sun.enterprise.v3.admin.AdminAdapter.doCommand(com\sun\enterprise\v3\admin\AdminAdapter.java:461)
    com.sun.enterprise.v3.admin.AdminAdapter.service(com\sun\enterprise\v3\admin\AdminAdapter.java:212)
    com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(com\sun\grizzly\tcp\http11\GrizzlyAdapter.java:179)
    com.sun.enterprise.v3.server.HK2Dispatcher.dispath(com\sun\enterprise\v3\server\HK2Dispatcher.java:117)
    com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(com\sun\enterprise\v3\services\impl\Container.java:354)
    com.sun.enterprise.v3.services.impl.ContainerMapper.service(com\sun\enterprise\v3\services\impl\ContainerMapper.java:195)
    com.sun.grizzly.http.ProcessorTask.invokeAdapter(com\sun\grizzly\http\ProcessorTask.java:849)
    com.sun.grizzly.http.ProcessorTask.doProcess(com\sun\grizzly\http\ProcessorTask.java:746)
    com.sun.grizzly.http.ProcessorTask.process(com\sun\grizzly\http\ProcessorTask.java:1045)
    com.sun.grizzly.http.DefaultProtocolFilter.execute(com\sun\grizzly\http\DefaultProtocolFilter.java:228)
    com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(com\sun\grizzly\DefaultProtocolChain.java:137)
    com.sun.grizzly.DefaultProtocolChain.execute(com\sun\grizzly\DefaultProtocolChain.java:104)
    com.sun.grizzly.DefaultProtocolChain.execute(com\sun\grizzly\DefaultProtocolChain.java:90)
    com.sun.grizzly.http.HttpProtocolChain.execute(com\sun\grizzly\http\HttpProtocolChain.java:79)
    com.sun.grizzly.ProtocolChainContextTask.doCall(com\sun\grizzly\ProtocolChainContextTask.java:54)
    com.sun.grizzly.SelectionKeyContextTask.call(com\sun\grizzly\SelectionKeyContextTask.java:59)
    com.sun.grizzly.ContextTask.run(com\sun\grizzly\ContextTask.java:71)
    com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(com\sun\grizzly\util\AbstractThreadPool.java:532)
    com.sun.grizzly.util.AbstractThreadPool$Worker.run(com\sun\grizzly\util\AbstractThreadPool.java:513)
    java.lang.Thread.run(java\lang\Thread.java:662)

This tool appears to be quite useful :)


                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reopened WICKET-4458:
-------------------------------------

    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Andrea Del Bene (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13243857#comment-13243857 ] 

Andrea Del Bene commented on WICKET-4458:
-----------------------------------------

I've run the same test of Ubuntu under Windows xp 32 bit without any problems. I've both tried with Eclipse + Glassfish 3.1.2 and NetBeans 7.1.1 + Glassfish 3.1.2. Java version was 1.6.0_31.

Could it be due to some kind of security software (like an antivirus) which holds the open files?

@bernard 
Which version of Windows are you using?
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232636#comment-13232636 ] 

Martin Grigorov commented on WICKET-4458:
-----------------------------------------

Hi,

Can you test with 1.5.4 and verify that there is no problem with it ?
Did you run the tool described in the GF ticket (https://blogs.oracle.com/quinn/entry/tool_for_diagnosing_failed_glassfish) ? I see it should point where is the file leak.

Sorry for asking you to do these checks but I don't use neither GF nor Netbeans and it will take me more time to setup and debug it.
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "bernard (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242681#comment-13242681 ] 

bernard commented on WICKET-4458:
---------------------------------

I would suggest to re-open this issue.

While fixing it, it might be prudent to check the framework for more occurrences of similar code using JarUrlConnection.  
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4458.
-------------------------------------

    Resolution: Cannot Reproduce
    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244018#comment-13244018 ] 

Martin Grigorov commented on WICKET-4458:
-----------------------------------------

I was able to reproduce it and I'll try Tim's suggestion.
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>            Assignee: Martin Grigorov
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Tim Quinn (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242396#comment-13242396 ] 

Tim Quinn edited comment on WICKET-4458 at 3/30/12 3:01 PM:
------------------------------------------------------------

Martin, you have misunderstood the meaning of the stack trace. Closing the stream is not sufficient in this case to fully close the file.  The classes near the top of the stack trace show that the URL opened had scheme "jar" and Java SE, once it opens the JAR to resolve such a URL, leaves the JAR open by default even after the stream has been closed.

One solution could be for the initializeComponents code, instead of using url.openStream, to use 

final URLConnection cnx = url.openConnection(url);
cnx.setUseCaches(false);
in = cnx.getInputStream();

(and of course to close the stream as it already does).

- Tim
                
      was (Author: tjquinn):
    Martin, you have misunderstood the meaning of the stack trace. Closing the stream is not sufficient in this case to fully close the file.  The classes near the top of the stack trace show that the URL opened had scheme "jar" and Java SE, once it opens the JAR to resolve such a URL, leaves the JAR open by default even after the stream has been closed.

One solution could be for the initializeComponents code, instead of using url.openStream, to use 

final URLConnection cnx = url.openConnection(url);
cnx.setUseCaches(false);
in = cnx.getInputStream();

- Tim
                  
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244082#comment-13244082 ] 

Martin Grigorov commented on WICKET-4458:
-----------------------------------------

The improvement is applied in 1.5.x and 6.x.
I don't see the opened file descriptor in lsof output anymore.
Please re-test with 1.5-SNAPSHOT before 1.5.6 is out.
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>            Assignee: Martin Grigorov
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238196#comment-13238196 ] 

Martin Grigorov commented on WICKET-4458:
-----------------------------------------

Here is the code related to this stacktrace (o.a.w.Application.java):

	InputStream in = null;
				try
				{
					final URL url = resources.next();
					final Properties properties = new Properties();
					in = url.openStream();   // LINE 499
					properties.load(in);
					load(properties);
				}
				finally
				{
					IOUtils.close(in);
				}

As you can see we close the input stream in 'finally'. It is not even 'IOUtils.closeQuietly()' so if there is an error during #close() it will stop the initialization of the application.
For some reason I don't trust this detection ...
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242407#comment-13242407 ] 

Martin Grigorov commented on WICKET-4458:
-----------------------------------------

Hi Tim,

Can you refer to some documentation that specifies this behavior ?
I don't see anything specific in JarUrlConnection.
In UrlConnection there is:
* Invoking the <tt>close()</tt> methods on the <tt>InputStream</tt> or <tt>OutputStream</tt> of an 
 * <tt>URLConnection</tt> after a request may free network resources associated with this 
 * instance, unless particular protocol specifications specify different behaviours 
 * for it.

which opens the door for the impls to do nothing as you said...
But lsof also doesn't show open file descriptor to the .jar here ...
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Tim Quinn (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242414#comment-13242414 ] 

Tim Quinn commented on WICKET-4458:
-----------------------------------

Hi, Martin.

I don't know of any doc that states categorically that JarURLConnection behaves this way but as you said the JavaDoc leaves that option open to the implementation.  It has been a while but I remember reading the relevant Java SE source code and finding exactly this caching behavior.  I do not know if this applies in the lsof experiment you ran, but GC can trigger JAR closes so it can be very unpredictable when to expect the file to be left open vs. closed.  


                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Andrea Del Bene (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234468#comment-13234468 ] 

Andrea Del Bene commented on WICKET-4458:
-----------------------------------------

No problem under Ubuntu 10.04 64 bit and OpenJDK 6.0. Here's the list of what I've done

-Create a 1.5.5 quickstart
-Run mvn deploy
-Started GlassFish 3.1 from Eclipse
-Entered into admin console and deployed the snapshot directory (./target/myproject-1.0-SNAPSHOT).
-Opened the application in the browser
-Undeployed the application
- Run maven clean (while GlassFish was still running)


                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Tim Quinn (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242396#comment-13242396 ] 

Tim Quinn commented on WICKET-4458:
-----------------------------------

Martin, you have misunderstood the meaning of the stack trace. Closing the stream is not sufficient in this case to fully close the file.  The classes near the top of the stack trace show that the URL opened had scheme "jar" and Java SE, once it opens the JAR to resolve such a URL, leaves the JAR open by default even after the stream has been closed.

One solution could be for the initializeComponents code, instead of using url.openStream, to use 

final URLConnection cnx = url.openConnection(url);
cnx.setUseCaches(false);
in = cnx.getInputStream();

- Tim
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232636#comment-13232636 ] 

Martin Grigorov edited comment on WICKET-4458 at 3/19/12 2:32 PM:
------------------------------------------------------------------

Hi,

Can you test with 1.5.4 and verify that there is no problem with it ?
Did you run the tool described in the GF ticket (https://blogs.oracle.com/quinn/entry/tool_for_diagnosing_failed_glassfish) ? I see it should point where is the file leak.

Sorry for asking you to do these checks but I use neither GF nor Netbeans and it will take me more time to setup and debug it.
                
      was (Author: mgrigorov):
    Hi,

Can you test with 1.5.4 and verify that there is no problem with it ?
Did you run the tool described in the GF ticket (https://blogs.oracle.com/quinn/entry/tool_for_diagnosing_failed_glassfish) ? I see it should point where is the file leak.

Sorry for asking you to do these checks but I don't use neither GF nor Netbeans and it will take me more time to setup and debug it.
                  
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "bernard (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242119#comment-13242119 ] 

bernard commented on WICKET-4458:
---------------------------------

Thanks for the help.

I appreciate your efforts and comments. They lead me to suspect that this is a GlasFish issue not w Wicket one. However this reproduces on Windows so I would prefer this to be closed as invalid not "Cannot Reproduce".
                
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4458) wicket-core-1.5.5.jar not closed when Application is undeployed from directory

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4458.
-------------------------------------

    Resolution: Invalid
    
> wicket-core-1.5.5.jar not closed when Application is undeployed from directory
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-4458
>                 URL: https://issues.apache.org/jira/browse/WICKET-4458
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
>            Reporter: bernard
>
> How to reproduce:
> - Create a 1.5.5 quickstart
> - deploy it on the GlassFish server with directory deployment (I use NetBeans which is easy)
> - open the application in the browser
> - undeploy the application
> - try to execute the maven clean goal or try to delete the target dir
> Error in GlassFish log:
> Unable to delete file WEB-INF\lib\wicket-core-1.5.5.jar
> I first thought that this was a GlassFish issue such as:
> http://java.net/jira/browse/GLASSFISH-17339
> To eliminate that, I added glassfish\modules\war-util.jar to the project and wrote code to let GlassFish close all jar files:
> In the Application class:
>     @Override
>     public void onDestroy() {
>         super.onDestroy();
>         ClassLoader parentClassLoader = this.getClass().getClassLoader();
>         ClassLoader classLoader;
>         do{
>             classLoader = parentClassLoader; 
>             if(classLoader instanceof WebappClassLoader){
>                 WebappClassLoader glassFishLoader = (WebappClassLoader)classLoader;
>                 glassFishLoader.closeJARs(true);
>                 break;
>             }
>             parentClassLoader = classLoader.getParent();
>         }while(parentClassLoader != classLoader && parentClassLoader != null);
>         
>     }
> 	
> but this did not fix the problem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira