1

I know there are thousands of blogs about CNFEs out there, but I can't get it work.

I use Maven to build my GWT project. In the pom.xml, there is this line:

<dependency>
    <groupId>oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
    <scope>runtime</scope>
</dependency>

In the built .war file, there is the correct .jar in WEB-INF/lib. So the class is where I expect it to be. But I'm still getting a ClassNotFoundException.

Where am I wrong? Is it because of the runtime scope?

6
  • well, does it work if you remove the scope? have you updated your maven dependencies? Commented Jul 19, 2017 at 9:05
  • When do you receive the exception? If it comes during the build then it is surly because of the runtime scope. Commented Jul 19, 2017 at 9:05
  • The exception is thrown on runtime when I want to access the db. Commented Jul 19, 2017 at 9:06
  • Also not working without runtime scope Commented Jul 19, 2017 at 9:15
  • Perhaps you have other versions as well? (other jars, included differently maybe) Commented Jul 19, 2017 at 9:50

2 Answers 2

1

Check your project build-path and enable specific output folders for each folder. Go one by one through each source-folder of your project and set the output folder that Maven would use.

For eg., your web project's src/main/java should have target/classes under the web project and so.

If your web project require some configuration files that are under the resources, be sure to include that folder as a source folder and to make the proper build-path configuration.

Sign up to request clarification or add additional context in comments.

Comments

0

It turned out, that the driver needs to be inside tomcat´s /lib folder.

It has something to do with the DataSource as described in this post:

Tomcat6 ignores web-inf/lib

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.