openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENEJB-467) Lookup of EntityManagerFactories failing in Windows
Date Sat, 03 Feb 2007 22:52:05 GMT

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

Jacek Laskowski commented on OPENEJB-467:
-----------------------------------------

I can't understand two constructs.

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

I wonder what should happen when the exception is thrown. Shall the code move on without care
of working with illegal path variable?

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

I think return null would be much clearer.

Would you comment on them?

> 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: Jacek Laskowski
>             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