[Hibernate-JIRA] Created: (HHH-6008) FileNotFound in FileZippedJarVisitor class when deploying to SAP Netweaver
by John Augusto Charnet (JIRA)
FileNotFound in FileZippedJarVisitor class when deploying to SAP Netweaver
--------------------------------------------------------------------------
Key: HHH-6008
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6008
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.x
Environment: hibernate-core-3.3.2.GA, hibernate-entitymanager-3.4.0.GA
Database version: 10.2.0.4.0
Application Server version: SAP Netweaver CE 7.2
Reporter: John Augusto Charnet
Priority: Blocker
In Netweaver, when Hibernate starts looking for my entities, I keep getting a FileNotFoundException. I've looked up the FileZippedJarVisitor source code, and noticed that there is the following if in the method doProcessElements:
if ( filePart != null && filePart.indexOf( ' ' ) != -1 ) { ...
In my case this if is failing because the filePart does not have a space ' ' in it.
The else does the following:
jarFile = new JarFile( jarUrl.toURI().getSchemeSpecificPart() );
The above line is what generates the Exception. If I comment out the && part (filePart.indexOf( ' ' ) != -1), everything will work fine.
In netweaver the method jarUrl.toURI().getSchemeSpecificPart(), returns a full qualified name with a \\localhost. This is where the exception occurs.
Example:
//localhost/C:/usr/sap/CE1/J00/j2ee/cluster/apps/JavaEE/sfw-web-piloto/servlet_jsp/sfw-web-piloto/root/sfw-fmk-log-aop-1.0.3-20110225.130112-22.jar
Is there a reason for this different treatment ? (jarFile = new JarFile( jarUrl.getFile() ) and jarUrl.toURI().getSchemeSpecificPart()).
Bellow is the stacktrace:
WARN | 2010-09-17 15:42:34,363 | FileZippedJarVisitor.java:50 | Unable to find file (ignored): file://localhost/C:/usr/sap/CE1/J00/j2ee/cluster/apps/JavaEE/sfw-condicao-pagamento-web/servlet_jsp/sfw-condicao-pagamento-web/root/sfw-class-loader-0.0.1-SNAPSHOT.jar
java.io.FileNotFoundException: \\localhost\C:\usr\sap\CE1\J00\j2ee\cluster\apps\JavaEE\sfw-condicao-pagamento-web\servlet_jsp\sfw-condicao-pagamento-web\root\sfw-class-loader-0.0.1-SNAPSHOT.jar (The network name cannot be found)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:46)
at org.hibernate.ejb.packaging.AbstractJarVisitor.getMatchingEntries(AbstractJarVisitor.java:139)
at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:287)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:614)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:358)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years
[Hibernate-JIRA] Created: (HHH-2434) No standard way to calculate date intervals in HQL
by Don Smith (JIRA)
No standard way to calculate date intervals in HQL
--------------------------------------------------
Key: HHH-2434
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2434
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Environment: All
Reporter: Don Smith
Priority: Minor
Date interval calculation is supported differently on different database platforms. Some allow direct arithmetic on columns, i.e. enddate - startdate. Some require functions, datediff(), timestampdiff(), etc. This causes cross-platform issues. For instance, an application I work on has to figure out the dialect that's in use (out of the four we currently support) and create the HQL string differently for each platform. This is undesirable, since we use Hibernate to enable platform neutrality; our installer asks which database the customer wants to deploy to, and sets the dialect. We'd like our codebase to be free of dialect-specific code.
I propose a standard solution for this, either direct date arithmetic, or a function defintion that is ported across dialects. Timestampdiff seems to be a fairly standard function, although DB2 has different syntax than MySQL and Derby. I've seen hints that timestampdiff is part of the ANSI SQL standard, but do not have access to the documents to determine if that is the case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
13 years