troubleshooting Question

Trouble accessing a file after moving to Linux

Avatar of menreeq
menreeq asked on
Java
15 Comments1 Solution249 ViewsLast Modified:
I have moved my application over to a linux box hosting with tomcat.  One on my classes accesses a file with the following code

  private File logDir = new File( getClass().getResource( "./log" ).getPath());
  private File log = new File( logDir.getPath() + "/samplework.log" );

On NT, it refers to a file in WEB-INF/classes/projectName

However, on linux i get a null pointer exception.  And when i comment out the lines that have to do with the file it works fine...so what changes do i need to make to get this to work on the linux platform? Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros