fubar-coder / beanio

Automatically exported from code.google.com/p/beanio
Apache License 2.0
0 stars 0 forks source link

org.beanio.internal.util.Settings#getFileURL does not use location parameter #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?  If applicable, please provide a
mapping configuration and sample record input to recreate the problem.
1. Set org.beanio.configuration system property to file name, not classpath 
locaton
2. Try to use beanio
3.

What is the expected output? What do you see instead?

BeanIO should use the file. Instead I get 
org.beanio.BeanIOException: BeanIO configuration settings not found at 
'home/tivv/dev/BeanIO/trunk/beanio/beanio-lib/src/main/resources/com/ubs/beanio/
copybook/beanio.properties'
    at org.beanio.internal.util.Settings.getInstance(Settings.java:214)
    at org.beanio.StreamFactory.newInstance(StreamFactory.java:323)

What version of BeanIO are you using? What JDK version?

BeanIO: 2.0.3
JDK:
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~12.10.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Original issue reported on code.google.com by tiv...@gmail.com on 11 Jan 2013 at 1:01

GoogleCodeExporter commented 9 years ago
What file name did you pass in?  And in what directory was beanio.properties 
placed? 

From the stack trace, perhaps you just need to add a leading / to the path.

Thanks,
Kevin

Original comment by kevin.s...@gmail.com on 11 Jan 2013 at 3:44

GoogleCodeExporter commented 9 years ago
I did pass in 
/home/tivv/dev/BeanIO/trunk/beanio/beanio-lib/src/main/resources/com/ubs/beanio/
copybook/beanio.properties
It's where it is placed.
The problem is that Settings#getFileUrl does not uses passed name, so only  
classpath resolution will work:
...
    private static URL getFileURL(String location) {
        File file = new File(DEFAULT_CONFIGURATION_FILENAME);
...

Original comment by tiv...@gmail.com on 11 Jan 2013 at 5:41

GoogleCodeExporter commented 9 years ago
Ah, I missed the obvious :)

Thanks,
Kevin

Original comment by kevin.s...@gmail.com on 11 Jan 2013 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 2 Feb 2013 at 4:33

GoogleCodeExporter commented 9 years ago

Original comment by kevin.s...@gmail.com on 6 Mar 2013 at 3:13