You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2008/08/13 01:42:31 UTC

Re: Quality Improvement [Virus checked]

Hi Wolfgang!

Moved this one to the dev list.

We definitely did have an issue with spaces in the paths  
(OPENEJB-767).  Most the issues were around going from URL->File and  
(File or URL)->URI.

I haven't seen the File->URL issue, at least not on the Sun VM.  For  
example, this runs fine:

     public static void main(String[] args) throws Exception {
         File file = new File("/Users/dblevins/work/openejb3/my path  
with spaces/commons-digester-1.8.jar");
         URL url = file.toURL();
         URLClassLoader urlClassLoader = new URLClassLoader(new URL[] 
{url});

         Class<?> clazz =  
urlClassLoader.loadClass("org.apache.commons.digester.Digester");
         System.out.println("clazz = " + clazz);
     }

Is this something that affects other VMs maybe?

-David
	

On Aug 12, 2008, at 2:08 AM, Wolfgang.Schrecker@atosorigin.com wrote:

>
> Hi List,
>
> I am not sure, the following will concern all of you. On the other  
> hand, I
> expect some of the developers listening here. Also this may be a known
> issue.
>
> The problem is when running a test using eclipse & maven, the results
> differ, depending on the location in the file system.
> A BLANK (' ') in the file location (e.g.: of the configuration)  
> makes the
> difference.
>
> This is not new, but nevertheless often forgotten:
>
>      There is a difference between URL and URI: a URL must mask BLANKS
> (with '%20'). A well formed file location is NOT a well formed URL!
>      A file location can be converted to an URL:  file.toURI().toURL()
> which yields something like 'file:/C:/openejb.xml'.
>      You have to catch (MalformedURLException e) in this case.
>
>      Eclipse file search on openejb3 source code (677505) found 51
> occurences of 'toURL()' and only 1 toURI().toURL().
>
> Is this totally wacko? Any comemnts ?
>
> Can I help ?
>
> Is this fixed in some version ? Is it gonna be fixed ?
> Is it  feature ?
>
> mit freundlichen Grüßen/best regards
>
> Wolfgang Schrecker
>
> "In mathematics, to exist is to be construed."
> from Shapiro: The Oxford Handbook of PHILOSOPHY OF MATHEMATICS AND  
> LOGIC S.
> 19
>
>
>
> --
> --------------------------------------------------
>
> Atos Worldline Processing GmbH
> Hahnstrasse 25
> 60528 Frankfurt/Main
> Germany
> Phone: +49 69/6657-1176
> mailto:Wolfgang.Schrecker@atosorigin.com
> http://www.atosworldline.com
>
> Geschäftsführer: Erik Munk Koefoed
> Aufsichtsratsvorsitzender: Didier Dhennin
> Sitz der Gesellschaft: Frankfurt/Main
> Handelsregister: Frankfurt/Main HRB 40 417
>
> --------------------------------------------------
>
> Atos Worldline Processing GmbH
> Hahnstraße 25
> 60528 Frankfurt/Main
> Germany
> Phone: +49 69/6657-1176
> Fax :
> mailto: Wolfgang.Schrecker@atosorigin.com
> http://www.atosworldline.com
>
> Geschäftsführer: Erik Munk Koefoed
> Aufsichtsratsvorsitzender: Didier Dhennin
> Sitz der Gesellschaft: Frankfurt/Main
> Handelsregister: Frankfurt/Main HRB 40 417
>
>
> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *
> This e-mail is destined for the above mentioned recipient. In case you
> received this e-mail by accident, we would appreciate it if you could
> contact the sender and delete all copies stored on your computer.
> Please be aware that the security and confidentiality of electronic  
> data
> transmitted by e-mail is not completely guaranteed and that data may  
> be seen,
> copied, downloaded or changed by third persons during transmission.
> Atos Origin accepts no liability for the security and  
> confidentiality of
> data and documents sent by e-mail. Please make sure that all important
> messages will be confirmed in writing by means of a telefax or a  
> letter.
> * * * * * * * * L E G A L    D I S C L A I M E R * * * * * * * *


Re: Quality Improvement [Virus checked]

Posted by David Blevins <da...@visi.com>.
On Aug 14, 2008, at 7:24 AM, wschreck wrote:

> Caused by: java.lang.RuntimeException: error trying to scan <jar- 
> file>:
> file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3- 
> service/target/classes/
> 	at
> org 
> .hibernate 
> .ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:635)
> 	at
> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java: 
> 350)
> 	at
> org 
> .hibernate 
> .ejb 
> .HibernatePersistence 
> .createContainerEntityManagerFactory(HibernatePersistence.java:126)
> 	at
> org 
> .apache 
> .openejb 
> .assembler 
> .classic 
> .PersistenceBuilder 
> .createEntityManagerFactory(PersistenceBuilder.java:183)
> 	at
> org 
> .apache 
> .openejb 
> .assembler.classic.Assembler.createApplication(Assembler.java:454)
> 	... 34 more
> Caused by: java.lang.RuntimeException: java.util.zip.ZipException: Das
> System kann den angegebenen Pfad nicht finden
> 	at  
> org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java: 
> 74)
> 	at
> org 
> .jboss 
> .util 
> .file 
> .FileProtocolArchiveBrowserFactory 
> .create(FileProtocolArchiveBrowserFactory.java:48)
> 	at  
> org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:64)
> 	at
> org 
> .hibernate 
> .ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:626)
> 	... 38 more
> Caused by: java.util.zip.ZipException: Das System kann den  
> angegebenen Pfad
> nicht finden
> 	at java.util.zip.ZipFile.open(Native Method)
> 	at java.util.zip.ZipFile.<init>(ZipFile.java:203)
> 	at java.util.jar.JarFile.<init>(JarFile.java:132)
> 	at java.util.jar.JarFile.<init>(JarFile.java:97)
> 	at  
> org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java: 
> 69)
> 	... 41 more

Hibernate seems to have an issue with the URL.  It seems to be trying  
to scan for annotations and running into trouble with the URL.   I did  
some experimenting with our hibernate example and things worked fine  
with spaces in the path, so I'm not sure if that's it.  Hibernate also  
seemed to be trying to read your target/classes/ directory as a jar  
file, which definitely isn't right.  I did some experimenting with  
that and it seems to handle <jar-file> entries which are jars or  
directories just fine, so that rules that out.

It was definitely easy to get that error out of hibernate but only if  
the path did not genuinely exist.

I successfully tried the following <jar-file> formats with hibernate:

   <jar-file>myapp/</jar-file>
   <jar-file>myapp.jar</jar-file>
   <jar-file>my app.jar</jar-file>
   <jar-file>my%20app.jar</jar-file>
   <jar-file>../../../my app/</jar-file>
   <jar-file>../../../my%20app/</jar-file>

Just couldn't seem to break it unless I gave a path that didn't exist.

Try and browse to "file:///D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/ 
" in your web browser as a quick way to validate the path.

-David


Re: Quality Improvement [Virus checked]

Posted by wschreck <Wo...@mac.com>.
sure do. Here it is:
-------------------------------------------------------------------------------
Bundle_oejb3 start!
Bundle_oejb3:searchForConfiguration1->C:/openejb.xml
Bundle_oejb3:searchForConfiguration1->file:/C:/openejb.xml
Bundle openEJBConfFilePath: C:\openejb.xml!
Bundle_oejb3:searchForConfiguration1->null
Bundle openEJBConfLogFilePath: C:\openejb.xml!
Apache OpenEJB 3.0    build: 20080408-04:13
http://openejb.apache.org/
16:21:52 INFO - Log4jLogStream.info(70) | 
********************************************************************************
OpenEJB http://openejb.apache.org/
Startup: 14.08.08 16:21
Copyright 1999-2008 (C) Apache OpenEJB Project, All Rights Reserved.
Version: 3.0
Build date: 20080408
Build time: 04:13
********************************************************************************


16:21:52 INFO - Log4jLogStream.info(70) | openejb.home = D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service
16:21:52 INFO - Log4jLogStream.info(70) | openejb.base = D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service
16:21:53 INFO - Log4jLogStream.info(70) | Configuring Service(id=Default
Security Service, type=SecurityService, provider-id=Default Security
Service)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring Service(id=Default
Transaction Manager, type=TransactionManager, provider-id=Default
Transaction Manager)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring Service(id=DefaultDS,
type=Resource, provider-id=Default JDBC Database)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring
Service(id=DefaultDS_unmanaged, type=Resource, provider-id=Default JDBC
Database)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring Service(id=Default JDK
1.3 ProxyFactory, type=ProxyFactory, provider-id=Default JDK 1.3
ProxyFactory)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring Service(id=DefaultDS,
type=Container, provider-id=Default Stateful Container)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring
Service(id=DefaultDS_1, type=Container, provider-id=Default Stateless
Container)
16:21:53 INFO - Log4jLogStream.info(70) | Found EjbModule in classpath:
D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
16:21:53 INFO - Log4jLogStream.info(70) | Configuring app: D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
16:21:53 INFO - Log4jLogStream.info(70) | Auto-deploying ejb MyAlbumManager:
EjbDeployment(deployment-id=MyAlbumManager)
16:21:53 INFO - Log4jLogStream.info(70) | Auto-deploying ejb
AlbumQueriesImpl: EjbDeployment(deployment-id=AlbumQueriesImpl)
16:21:53 INFO - Log4jLogStream.info(70) | Configuring
PersistenceUnit(name=oejb3, provider=org.hibernate.ejb.HibernatePersistence)
16:21:53 INFO - Log4jLogStream.info(70) | Auto-creating a Resource with id
'DefaultDSNonJta' of type 'DataSource for 'oejb3'.
16:21:53 INFO - Log4jLogStream.info(70) | Configuring
Service(id=DefaultDSNonJta, type=Resource, provider-id=DefaultDS)
16:21:53 INFO - Log4jLogStream.info(70) | Adjusting oejb3
<non-jta-data-source> to 'DefaultDSNonJta'
16:21:53 INFO - Log4jLogStream.info(70) | Loaded Module: D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
16:21:53 INFO - Log4jLogStream.info(70) | Creating ProxyFactory(id=Default
JDK 1.3 ProxyFactory)
16:21:53 INFO - Log4jLogStream.info(70) | Creating
TransactionManager(id=Default Transaction Manager)
16:21:54 INFO - Log4jLogStream.info(70) | Creating
SecurityService(id=Default Security Service)
16:21:54 INFO - Log4jLogStream.info(70) | Creating Resource(id=DefaultDS)
16:21:54 INFO - Log4jLogStream.info(70) | Creating
Resource(id=DefaultDS_unmanaged)
16:21:54 INFO - Log4jLogStream.info(70) | Creating
Resource(id=DefaultDSNonJta)
16:21:54 INFO - Log4jLogStream.info(70) | Creating Container(id=DefaultDS)
16:21:54 INFO - Log4jLogStream.info(70) | Using directory
D:\DOKUME~1\DE16297\LOKALE~1\Temp for stateful session passivation
16:21:54 INFO - Log4jLogStream.info(70) | Creating Container(id=DefaultDS_1)
16:21:54 INFO - Log4jLogStream.info(70) | Assembling app: D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
16:21:54 INFO - Log4jLogStream.info(70) | PersistenceUnit(name=oejb3,
provider=org.hibernate.ejb.HibernatePersistence)
16:21:54 INFO - Log4jLogStream.info(70) | Undeploying app: D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
16:21:54 ERROR - Log4jLogStream.error(50) | Application could not be
deployed:  D:\Dokumente und
Einstellungen\DE16297\workspace\oejb3-service\target\classes
org.apache.openejb.OpenEJBException: createApplication.failed [D:\Dokumente
und Einstellungen\DE16297\workspace\oejb3-service\target\classes]:
java.lang.RuntimeException: error trying to scan <jar-file>:
file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/:
error trying to scan <jar-file>:
file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:592)
	at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:338)
	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:250)
	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
	at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
	at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
	at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:175)
	at net.atos.xa.ejb3.runtime.Bundle_oejb3.start(Bundle_oejb3.java:49)
	at net.atos.wlp.oejb3.jpa.oejb3Package.init(oejb3Package.java:49)
	at
net.atos.wlp.oejb3.jpa.oejb3Package.getAlbumManager(oejb3Package.java:84)
	at
net.atos.wlp.oejb3.AlbumManagerOEJB3_JEETestCase.oneTimeSetUp(AlbumManagerOEJB3_JEETestCase.java:56)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
	at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.apache.openejb.OpenEJBException: java.lang.RuntimeException:
error trying to scan <jar-file>:
file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/:
error trying to scan <jar-file>:
file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:459)
	... 34 more
Caused by: java.lang.RuntimeException: error trying to scan <jar-file>:
file:/D:/Dokumente%20und%20Einstellungen/DE16297/workspace/oejb3-service/target/classes/
	at
org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:635)
	at
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)
	at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
	at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:183)
	at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:454)
	... 34 more
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: Das
System kann den angegebenen Pfad nicht finden
	at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:74)
	at
org.jboss.util.file.FileProtocolArchiveBrowserFactory.create(FileProtocolArchiveBrowserFactory.java:48)
	at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:64)
	at
org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:626)
	... 38 more
Caused by: java.util.zip.ZipException: Das System kann den angegebenen Pfad
nicht finden
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:203)
	at java.util.jar.JarFile.<init>(JarFile.java:132)
	at java.util.jar.JarFile.<init>(JarFile.java:97)
	at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:69)
	... 41 more
16:21:54 INFO - oejb3Package.getAlbumManager(86) |  getting
MyAlbumManagerLocal ...

-------------------------------------------------------------------------------

David Blevins wrote:
> 
> On Aug 13, 2008, at 4:09 AM, wschreck wrote:
> 
>> Any other approaches to my problem ?
> 
> Hmmm..  I may have misunderstood the exact issue.  Do you have a stack  
> trace?
> 
> -David
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-Quality-Improvement---Virus-checked--tp18954543p18982581.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.


Re: Quality Improvement [Virus checked]

Posted by David Blevins <da...@visi.com>.
On Aug 13, 2008, at 4:09 AM, wschreck wrote:

> Any other approaches to my problem ?

Hmmm..  I may have misunderstood the exact issue.  Do you have a stack  
trace?

-David


Re: Quality Improvement [Virus checked]

Posted by wschreck <Wo...@mac.com>.
Hi David,
 I ran your test with:
/D:/Dokumente und
Einstellungen/XXX/.m2/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar
and got:
clazz = class org.apache.commons.digester.Digester

which I interpret as 'alll fine with JVM'.

Any other approaches to my problem ?

Wolfgang


David Blevins wrote:
> 
> Hi Wolfgang!
> 
> Moved this one to the dev list.
> 
> We definitely did have an issue with spaces in the paths  
> (OPENEJB-767).  Most the issues were around going from URL->File and  
> (File or URL)->URI.
> 
> I haven't seen the File->URL issue, at least not on the Sun VM.  For  
> example, this runs fine:
> 
>      public static void main(String[] args) throws Exception {
>          File file = new File("/Users/dblevins/work/openejb3/my path  
> with spaces/commons-digester-1.8.jar");
>          URL url = file.toURL();
>          URLClassLoader urlClassLoader = new URLClassLoader(new URL[] 
> {url});
> 
>          Class<?> clazz =  
> urlClassLoader.loadClass("org.apache.commons.digester.Digester");
>          System.out.println("clazz = " + clazz);
>      }
> 
> Is this something that affects other VMs maybe?
> 
> -David
> 	
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-Quality-Improvement---Virus-checked--tp18954543p18961046.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.