You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Olivier Terrier (JIRA)" <ui...@incubator.apache.org> on 2009/11/05 09:23:32 UTC

[jira] Created: (UIMA-1652) Cannot hot-install a PEAR twice

Cannot hot-install a PEAR twice
-------------------------------

                 Key: UIMA-1652
                 URL: https://issues.apache.org/jira/browse/UIMA-1652
             Project: UIMA
          Issue Type: Bug
          Components: Tools
    Affects Versions: 2.2.2
         Environment: Windows
            Reporter: Olivier Terrier


Due to a java bug "URLClassLoader.getResourceAsStream locks jar files"
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
When you use PackageInstaller.installPackage(installDir, pearFile, true, true); twice from an application because you want to hot-redeploy a new version of a PEAR, you have an error:
java.io.IOException: Error while trying to clean the installation directory MyPearDir 
	at org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARFile(InstallationController.java:742)
	at org.apache.uima.pear.tools.InstallationController.extractPEARFile(InstallationController.java:854)
	at org.apache.uima.pear.tools.InstallationController.installComponent(InstallationController.java:1551)
	at org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInstaller.java:171)

A patch is proposed in this article
http://management-platform.blogspot.com/2009/01/classloaders-keeping-jar-files-open.html

I have implemented it modifying the UIMAClassLoader and the InstallationTester classes and it works

I can submit a patch if you find it usefull

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by "Olivier Terrier (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773832#action_12773832 ] 

Olivier Terrier commented on UIMA-1652:
---------------------------------------

Apparently a A new method URLClassLoader.close() is being added in jdk 7 so the proposed patch is just an anticipation ...

> Cannot hot-install a PEAR twice
> -------------------------------
>
>                 Key: UIMA-1652
>                 URL: https://issues.apache.org/jira/browse/UIMA-1652
>             Project: UIMA
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.2.2
>         Environment: Windows
>            Reporter: Olivier Terrier
>
> Due to a java bug "URLClassLoader.getResourceAsStream locks jar files"
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
> When you use PackageInstaller.installPackage(installDir, pearFile, true, true); twice from an application because you want to hot-redeploy a new version of a PEAR, you have an error:
> java.io.IOException: Error while trying to clean the installation directory MyPearDir 
> 	at org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARFile(InstallationController.java:742)
> 	at org.apache.uima.pear.tools.InstallationController.extractPEARFile(InstallationController.java:854)
> 	at org.apache.uima.pear.tools.InstallationController.installComponent(InstallationController.java:1551)
> 	at org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInstaller.java:171)
> A patch is proposed in this article
> http://management-platform.blogspot.com/2009/01/classloaders-keeping-jar-files-open.html
> I have implemented it modifying the UIMAClassLoader and the InstallationTester classes and it works
> I can submit a patch if you find it usefull

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by "Olivier Terrier (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Terrier updated UIMA-1652:
----------------------------------

    Attachment: uimaj-core_UIMA-1652.patch

> Cannot hot-install a PEAR twice
> -------------------------------
>
>                 Key: UIMA-1652
>                 URL: https://issues.apache.org/jira/browse/UIMA-1652
>             Project: UIMA
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.2.2
>         Environment: Windows
>            Reporter: Olivier Terrier
>         Attachments: uimaj-core_UIMA-1652.patch
>
>
> Due to a java bug "URLClassLoader.getResourceAsStream locks jar files"
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
> When you use PackageInstaller.installPackage(installDir, pearFile, true, true); twice from an application because you want to hot-redeploy a new version of a PEAR, you have an error:
> java.io.IOException: Error while trying to clean the installation directory MyPearDir 
> 	at org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARFile(InstallationController.java:742)
> 	at org.apache.uima.pear.tools.InstallationController.extractPEARFile(InstallationController.java:854)
> 	at org.apache.uima.pear.tools.InstallationController.installComponent(InstallationController.java:1551)
> 	at org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInstaller.java:171)
> A patch is proposed in this article
> http://management-platform.blogspot.com/2009/01/classloaders-keeping-jar-files-open.html
> I have implemented it modifying the UIMAClassLoader and the InstallationTester classes and it works
> I can submit a patch if you find it usefull

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by Thilo Goetz <tw...@gmx.de>.
Just like with the bootstrap loader thingy, this will fail
when run under a security context that doesn't allow futzing
with loaded classes (which, when you think about it, really
shouldn't be allowed anyway).  Before we add this, I'd like
to see it tested in applets and application servers to make
sure it does no harm.  For the bootstrap loader this doesn't
matter, for the UIMAClassLoader it matters very much.  (I
have no idea if UIMA even runs in applets, for that matter).

--Thilo

On 11/5/2009 18:17, Marshall Schor wrote:
>
>
> Olivier Terrier wrote:
>> I tested the code on SUN's Java6 JRE
>> On other JVMs (IBM) the code should just do nothing and return (->  bug not fixed but same behavior as before) but I didn't test it.
>>
>
> I guess the question is - should we wait for Java 7 and fix this then,
> or patch this now (in the current pending release, for instance)?
>
> Any opinions ?
>
> -Marshall
>> O.
>>
>>
>>> -----Message d'origine-----
>>> De : Marshall Schor (JIRA) [mailto:uima-dev@incubator.apache.org]
>>> Envoyé : jeudi 5 novembre 2009 13:30
>>> À : uima-dev@incubator.apache.org
>>> Objet : [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice
>>>
>>>
>>>      [ https://issues.apache.org/jira/browse/UIMA-
>>> 1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
>>> tabpanel&focusedCommentId=12773916#action_12773916 ]
>>>
>>> Marshall Schor commented on UIMA-1652:
>>> --------------------------------------
>>>
>>> Do you know which Java's this works for (it appears to be using Sun
>>> class impl internals)?  We currently test and have users who run on Sun
>>> Java 5&  6, and IBM Java 5&  6, and maybe other Javas on other
>>> machines.
>>>
>>>
>>>> Cannot hot-install a PEAR twice
>>>> -------------------------------
>>>>
>>>>                  Key: UIMA-1652
>>>>                  URL: https://issues.apache.org/jira/browse/UIMA-1652
>>>>              Project: UIMA
>>>>           Issue Type: Bug
>>>>           Components: Tools
>>>>     Affects Versions: 2.2.2
>>>>          Environment: Windows
>>>>             Reporter: Olivier Terrier
>>>>          Attachments: uimaj-core_UIMA-1652.patch
>>>>
>>>>
>>>> Due to a java bug "URLClassLoader.getResourceAsStream locks jar
>>>>
>>> files"
>>>
>>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
>>>> When you use PackageInstaller.installPackage(installDir, pearFile,
>>>>
>>> true, true); twice from an application because you want to hot-redeploy
>>> a new version of a PEAR, you have an error:
>>>
>>>> java.io.IOException: Error while trying to clean the installation
>>>>
>>> directory MyPearDir
>>>
>>>> 	at
>>>>
>>> org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARF
>>> ile(InstallationController.java:742)
>>>
>>>> 	at
>>>>
>>> org.apache.uima.pear.tools.InstallationController.extractPEARFile(Insta
>>> llationController.java:854)
>>>
>>>> 	at
>>>>
>>> org.apache.uima.pear.tools.InstallationController.installComponent(Inst
>>> allationController.java:1551)
>>>
>>>> 	at
>>>>
>>> org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInsta
>>> ller.java:171)
>>>
>>>> A patch is proposed in this article
>>>> http://management-platform.blogspot.com/2009/01/classloaders-keeping-
>>>>
>>> jar-files-open.html
>>>
>>>> I have implemented it modifying the UIMAClassLoader and the
>>>>
>>> InstallationTester classes and it works
>>>
>>>> I can submit a patch if you find it usefull
>>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>
>>

Re: [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by Marshall Schor <ms...@schor.com>.

Olivier Terrier wrote:
> I tested the code on SUN's Java6 JRE
> On other JVMs (IBM) the code should just do nothing and return (-> bug not fixed but same behavior as before) but I didn't test it.
>   

I guess the question is - should we wait for Java 7 and fix this then,
or patch this now (in the current pending release, for instance)?

Any opinions ?

-Marshall
> O.
>
>   
>> -----Message d'origine-----
>> De : Marshall Schor (JIRA) [mailto:uima-dev@incubator.apache.org]
>> Envoyé : jeudi 5 novembre 2009 13:30
>> À : uima-dev@incubator.apache.org
>> Objet : [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice
>>
>>
>>     [ https://issues.apache.org/jira/browse/UIMA-
>> 1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
>> tabpanel&focusedCommentId=12773916#action_12773916 ]
>>
>> Marshall Schor commented on UIMA-1652:
>> --------------------------------------
>>
>> Do you know which Java's this works for (it appears to be using Sun
>> class impl internals)?  We currently test and have users who run on Sun
>> Java 5 & 6, and IBM Java 5 & 6, and maybe other Javas on other
>> machines.
>>
>>     
>>> Cannot hot-install a PEAR twice
>>> -------------------------------
>>>
>>>                 Key: UIMA-1652
>>>                 URL: https://issues.apache.org/jira/browse/UIMA-1652
>>>             Project: UIMA
>>>          Issue Type: Bug
>>>          Components: Tools
>>>    Affects Versions: 2.2.2
>>>         Environment: Windows
>>>            Reporter: Olivier Terrier
>>>         Attachments: uimaj-core_UIMA-1652.patch
>>>
>>>
>>> Due to a java bug "URLClassLoader.getResourceAsStream locks jar
>>>       
>> files"
>>     
>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
>>> When you use PackageInstaller.installPackage(installDir, pearFile,
>>>       
>> true, true); twice from an application because you want to hot-redeploy
>> a new version of a PEAR, you have an error:
>>     
>>> java.io.IOException: Error while trying to clean the installation
>>>       
>> directory MyPearDir
>>     
>>> 	at
>>>       
>> org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARF
>> ile(InstallationController.java:742)
>>     
>>> 	at
>>>       
>> org.apache.uima.pear.tools.InstallationController.extractPEARFile(Insta
>> llationController.java:854)
>>     
>>> 	at
>>>       
>> org.apache.uima.pear.tools.InstallationController.installComponent(Inst
>> allationController.java:1551)
>>     
>>> 	at
>>>       
>> org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInsta
>> ller.java:171)
>>     
>>> A patch is proposed in this article
>>> http://management-platform.blogspot.com/2009/01/classloaders-keeping-
>>>       
>> jar-files-open.html
>>     
>>> I have implemented it modifying the UIMAClassLoader and the
>>>       
>> InstallationTester classes and it works
>>     
>>> I can submit a patch if you find it usefull
>>>       
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>     
>
>   

RE: [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by Olivier Terrier <ol...@temis.com>.
I tested the code on SUN's Java6 JRE
On other JVMs (IBM) the code should just do nothing and return (-> bug not fixed but same behavior as before) but I didn't test it

O.

> -----Message d'origine-----
> De : Marshall Schor (JIRA) [mailto:uima-dev@incubator.apache.org]
> Envoyé : jeudi 5 novembre 2009 13:30
> À : uima-dev@incubator.apache.org
> Objet : [jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice
> 
> 
>     [ https://issues.apache.org/jira/browse/UIMA-
> 1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
> tabpanel&focusedCommentId=12773916#action_12773916 ]
> 
> Marshall Schor commented on UIMA-1652:
> --------------------------------------
> 
> Do you know which Java's this works for (it appears to be using Sun
> class impl internals)?  We currently test and have users who run on Sun
> Java 5 & 6, and IBM Java 5 & 6, and maybe other Javas on other
> machines.
> 
> > Cannot hot-install a PEAR twice
> > -------------------------------
> >
> >                 Key: UIMA-1652
> >                 URL: https://issues.apache.org/jira/browse/UIMA-1652
> >             Project: UIMA
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 2.2.2
> >         Environment: Windows
> >            Reporter: Olivier Terrier
> >         Attachments: uimaj-core_UIMA-1652.patch
> >
> >
> > Due to a java bug "URLClassLoader.getResourceAsStream locks jar
> files"
> > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
> > When you use PackageInstaller.installPackage(installDir, pearFile,
> true, true); twice from an application because you want to hot-redeploy
> a new version of a PEAR, you have an error:
> > java.io.IOException: Error while trying to clean the installation
> directory MyPearDir
> > 	at
> org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARF
> ile(InstallationController.java:742)
> > 	at
> org.apache.uima.pear.tools.InstallationController.extractPEARFile(Insta
> llationController.java:854)
> > 	at
> org.apache.uima.pear.tools.InstallationController.installComponent(Inst
> allationController.java:1551)
> > 	at
> org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInsta
> ller.java:171)
> > A patch is proposed in this article
> > http://management-platform.blogspot.com/2009/01/classloaders-keeping-
> jar-files-open.html
> > I have implemented it modifying the UIMAClassLoader and the
> InstallationTester classes and it works
> > I can submit a patch if you find it usefull
> 
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1652) Cannot hot-install a PEAR twice

Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773916#action_12773916 ] 

Marshall Schor commented on UIMA-1652:
--------------------------------------

Do you know which Java's this works for (it appears to be using Sun class impl internals)?  We currently test and have users who run on Sun Java 5 & 6, and IBM Java 5 & 6, and maybe other Javas on other machines.

> Cannot hot-install a PEAR twice
> -------------------------------
>
>                 Key: UIMA-1652
>                 URL: https://issues.apache.org/jira/browse/UIMA-1652
>             Project: UIMA
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 2.2.2
>         Environment: Windows
>            Reporter: Olivier Terrier
>         Attachments: uimaj-core_UIMA-1652.patch
>
>
> Due to a java bug "URLClassLoader.getResourceAsStream locks jar files"
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014
> When you use PackageInstaller.installPackage(installDir, pearFile, true, true); twice from an application because you want to hot-redeploy a new version of a PEAR, you have an error:
> java.io.IOException: Error while trying to clean the installation directory MyPearDir 
> 	at org.apache.uima.pear.tools.InstallationController.extractFilesFromPEARFile(InstallationController.java:742)
> 	at org.apache.uima.pear.tools.InstallationController.extractPEARFile(InstallationController.java:854)
> 	at org.apache.uima.pear.tools.InstallationController.installComponent(InstallationController.java:1551)
> 	at org.apache.uima.pear.tools.PackageInstaller.installPackage(PackageInstaller.java:171)
> A patch is proposed in this article
> http://management-platform.blogspot.com/2009/01/classloaders-keeping-jar-files-open.html
> I have implemented it modifying the UIMAClassLoader and the InstallationTester classes and it works
> I can submit a patch if you find it usefull

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.