Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot find class [org.apache.commons.dbcp2.BasicDataSource]

Ayaskant Swain July 16, 2018

I am getting Cannot find class [org.apache.commons.dbcp2.BasicDataSource] error while deploying my Confluence plugin using atlas-run command on my local system. My plugin uses apache-commons library to connect to Confluence Postgres DB. 

This error is only coming at runtime and not compile time. My plugin code compiles without any issues and i am able to get the jar file by running the atlas-package command.

My pom.xml contains the below dependencies for the DB connection.

<!-- dependencies to connect to Confluence DB -->

<dependency>

    <groupId>org.postgresql</groupId>

    <artifactId>postgresql</artifactId>

    <version>9.4-1200-jdbc41</version>

</dependency>

<dependency>

    <groupId>org.apache.commons</groupId>

    <artifactId>commons-dbcp2</artifactId>

    <version>2.4.0</version>

</dependency>

</dependencies>

 

I tired to add scope as "provided". but that also did not help.

 

My plugin-context.xml contains the below spring beaa injection definition.

<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource">

<property name="driverClassName" value="org.postgresql.Driver"/>

<property name="url" value="jdbc:postgresql://stag-confdb-psg01.corp.com:5432/confluence"/>

<property name="username" value="test"/>

<property name="password" value="test#123"/>

</bean>

 

This class is very much there in the build path when i develop in eclipse. I am able to import this class in any of my java class file. But don't know why the atlassian container is not able to locate it while deploying.

 

Please help in fixing this.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, out of office, loom, confluence, async collaboration, meeting recaps, remote teamwork, team alignment, knowledge sharing, AI-powered notes, productivity tools, workforce continuity, teamwork collection

Put your meeting notes on autopilot with Loom + Confluence

AI-powered meeting notes keep work moving even if you’re out of the office. Enjoy your well-deserved time off and return refreshed, confident you’ll catch up in no time.

Learn more
AUG Leaders

Atlassian Community Events