Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24-test failing on JNDI setup #1

Open
dforero04 opened this issue Mar 14, 2023 · 3 comments · Fixed by david-dasilva/spring-pro-code#1 · May be fixed by #2
Open

24-test failing on JNDI setup #1

dforero04 opened this issue Mar 14, 2023 · 3 comments · Fixed by david-dasilva/spring-pro-code#1 · May be fixed by #2

Comments

@dforero04
Copy link

When trying to run the RewardNetworkTests with the @ActiveProfile({"jndi", "jdbc"}) annotation, I receive the following error:
javax.naming.NoInitialContextException: Cannot instantiate class: org.osjava.sj.SimpleContextFactory.

I am guessing that I may need to include the org.osjava.sj.SimpleContextFactory jar into my classpath, but I am unsure.

Any suggestions on how to get this test passing?

Here is a screenshot of the error:
Screenshot 2023-03-14 at 4 27 33 PM

@david-dasilva
Copy link

The error occurs when you use Gradle, but not when you use Maven because the build.gradle in this project is missing a key dependency that is present in the pom.xml :

<dependency>
            <groupId>com.github.h-thurow</groupId>
            <artifactId>simple-jndi</artifactId>
            <version>0.23.0</version>
            <scope>test</scope>
        </dependency>

Add the folowing line to the build.gradle of the module 24-test and it should work : testImplementation('com.github.h-thurow:simple-jndi:0.23.0')
The build.gradle file should now look like this :

dependencies {
    implementation project(':00-rewards-common')
    testImplementation('com.github.h-thurow:simple-jndi:0.23.0')
}

@0815Hunter
Copy link

Why is this not merged yet? Ran into the same problem

@caleb-mussulman
Copy link

Can this please be merged? As soon as I added jndi as an active profile, I was no longer receiving any test events. I still don't know why that was happening, but adding this dependency resolved my issue. I had to come here to figure that out though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants