tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manu T George (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENEJB-467) Lookup of EntityManagerFactories failing in Windows
Date Sun, 04 Feb 2007 07:51:05 GMT

    [ https://issues.apache.org/jira/browse/OPENEJB-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470029
] 

Manu T George commented on OPENEJB-467:
---------------------------------------

You are right about this

if(dataSource == null){
+ return dataSource;
+ } 

it is better to have return null;

+ try {
+ path = new File(path).toURL().getPath();
+ } catch (MalformedURLException e) {
+ } 

Well what I thought was if there is an error the path that was not converted to URL will be
used. But again if the path is illegal then a MalformedURLException will be thrown during
creation of EntityManagerFactories itself and there will be a failure and so the execution
will not reach till here.
               However you are right and Something needs to be done in the catch block. I
will throw an OpenEJBException there. Will attach a patch with the corrections 


> Lookup of EntityManagerFactories failing in Windows
> ---------------------------------------------------
>
>                 Key: OPENEJB-467
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-467
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: ejb3 simplified
>    Affects Versions: 3.0
>         Environment: Windows
>            Reporter: Manu T George
>         Assigned To: Manu T George
>             Fix For: 3.0
>
>         Attachments: patch[1]_r503297_OPENEJB-467.patch
>
>
> Lookup of EntityManagerFactories failing in Windows. this is because during lookup based
on Jar path we use windows style path but during storing we use a URI. Converting the path
to a URI seems to add a / at the end. So the patch uses a method of the form
>  private String normalizePath(String path){
>         char[] carray = path.toCharArray();
>         for(int i=0;i<carray.length;i++){
>             if(carray[i] == '\\'){
>                 carray[i] = '/';
>             }                
>         }
>         return "/" + new String(carray);
>     }
> to convert the path to the same form. new File(path).toURI().getPath() adding a / at
the end and so lookup fails with this issue. I amnot sure why initially / is not coming in
the end on getting jarURI
>  

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


Mime
View raw message