I was moving an application from Tomcat to Weblogic and by default in Tomcat the jar/war is extracted whereas in Weblogic this isn't at least not in our setup.
So my code to read a file within my applications classpath was not longer working.
initial code:
URL input = getClass().getResource(queryFileName);
File file = new File(input.getFile());
However the file is not null it's not readable and throws a FileNotFoundException
new code:
InputStream stream;
stream = getClass().getResourceAsStream(queryFileName);
The only disadvantage is you have an InputStream instead of a file.
San's development corner
vrijdag 12 augustus 2011
maandag 25 juli 2011
ERROR - java.lang.IllegalArgumentException: Illegal attempt to dereference path source [null]
Using: JPA 2 with hibernate
Stacktrace:
java.lang.IllegalArgumentException: Illegal attempt to dereference path source [null]
at org.hibernate.ejb.criteria.path.AbstractPathImpl.illegalDereference(AbstractPathImpl.java:104)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:186)
Cause:
I was doing a get on a PluralAttributePath
initial code:
Root
Path
path = path.get("description"); //throws exception since Ordelines was a many to many join
new code:
Root
Join
Path
path = join.get("description");
Abonneren op:
Posts (Atom)