Hi Marco,
Good news this morning : it's already done :o)
Commited in trunk revision: 682652
Thanks
Jacques
From: "Marco Ruocco" <[EMAIL PROTECTED]>
Jacques Le Roux ha scritto:
Oops, too fast on this one. Then you get
2008-08-05 05:40:23,093 (main) [ SSLImpl.java:64 :ERROR]
---- runtime exception report
--------------------------------------------------
Exception: java.lang.StringIndexOutOfBoundsException
Message: String index out of range: 1
---- stack trace
---------------------------------------------------------------
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
java.lang.String.charAt(String.java:558)
java.util.regex.Matcher.appendReplacement(Matcher.java:696)
java.util.regex.Matcher.replaceAll(Matcher.java:806)
java.lang.String.replaceAll(String.java:2000)
org.ofbiz.base.util.FileUtil.getFile(FileUtil.java:50)
org.ofbiz.base.util.KeyStoreUtil.getSystemTrustStore(KeyStoreUtil.java:87)
org.ofbiz.base.util.SSLUtil.getTrustManagers(SSLUtil.java:106)
org.ofbiz.catalina.container.SSLImpl$AllowTrustManager.<init>(SSLImpl.java:62)
org.ofbiz.catalina.container.SSLImpl.<init>(SSLImpl.java:48)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
java.lang.Class.newInstance0(Class.java:350)
java.lang.Class.newInstance(Class.java:303)
org.apache.tomcat.util.net.SSLImplementation.getInstance(SSLImplementation.java:75)
org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:152)
org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
org.ofbiz.catalina.container.CatalinaContainer.init(CatalinaContainer.java:214)
org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoader.java:190)
org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:66)
org.ofbiz.base.start.Start.initStartLoaders(Start.java:250)
org.ofbiz.base.start.Start.init(Start.java:89)
org.ofbiz.base.start.Start.main(Start.java:398)
--------------------------------------------------------------------------------
Jacques
From: "Jacques Le Roux" <[EMAIL PROTECTED]>
Adrian, Adam, All,
I confirm the problem is in FileUtil.getFile(FileUtil.java:50)
FYI, as a quick fixup you can revert ComponentContainer.java back to
r682265. From Subclipse History view :
svn merge --depth=infinity -r682266:682265
https://svn.apache.org/repos/asf/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java
D:/workspace/ofbizRun/framework/base/src/base/org/ofbiz/base/container/ComponentContainer.java
Jacques
From: "Adrian Crum" <[EMAIL PROTECTED]>
Same thing here, I can take a look at it when I get home - about 3
hrs from now.
-Adrian
Adam Heath wrote:
Adrian Crum wrote:
I don't know if this will help, but I reverted back to rev 681992
- my last good build - and it works fine. So the problem was
introduced after that.
-Adrian
Jacques Le Roux wrote:
From: "Adam Heath" <[EMAIL PROTECTED]>
Adrian Crum wrote:
I did an SVN update from the trunk this morning, then ran ant
clean and
build. OFBiz starts, gets to
UtilXml.java:241:INFO ] XML Read 0.015s:
file:/C:/ofbiz/framework/base/config/component-load.xml
then shuts down. Debug.log and ofbiz.log both show first few
lines of
startup messages, and nothing else. error.log is empty.
I did a fresh checkout, ran ant run-install - it stops at the same
place. I confirmed I'm running Java 1.5.
Any ideas?
Try the attached patch; I don't develop on windows, so haven't
tested it
yet. My windows machine is currently rebooting, after installing
tortiose, and then I can test this myself.
Sorry Adam,
Same issue :
It'll have to wait until after work(2 more hours) for me to look at
it closely. Java 1.5 isn't installed on my windows machine, so I
can't compile anything there to test it yet.
Hi all,
I attach the patch that solve the problem on Windows Machine. It depends
on the value of File.separator that in Windows system is "\", that is,
also, the first character of an escape sequence. So the replaceAll
method expects another char after that.
--------------------------------------------------------------------------------
Index: D:/Progetti Eclipse
3.3/ofbiz/framework/base/src/base/org/ofbiz/base/util/FileUtil.java
===================================================================
--- D:/Progetti Eclipse
3.3/ofbiz/framework/base/src/base/org/ofbiz/base/util/FileUtil.java (revision
682284)
+++ D:/Progetti Eclipse
3.3/ofbiz/framework/base/src/base/org/ofbiz/base/util/FileUtil.java (working
copy)
@@ -46,12 +46,24 @@
public static final String module = FileUtil.class.getName();
+ public static String escapeSeparator( String separator )
+ {
+ if( "\\".equals( separator ) )
+ {
+ return "\\" + separator;
+ }
+ else
+ {
+ return separator;
+ }
+ }
+
public static File getFile(String path) {
- return new File(path.replaceAll("/+|\\\\+", File.separator));
+ return new File(path.replaceAll("/+|\\\\+",
escapeSeparator(File.separator)));
}
public static File getFile(File root, String path) {
- return new File(root, path.replaceAll("/+|\\\\+", File.separator));
+ return new File(root, path.replaceAll("/+|\\\\+",
escapeSeparator(File.separator)));
}
public static void writeString(String fileName, String s) throws
IOException {