Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 809407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:43:29+00:00 2026-05-15T00:43:29+00:00

Disclaimer: I’m completely new to Java EE/EJB and all that, so bear with me.

  • 0

Disclaimer: I’m completely new to Java EE/EJB and all that, so bear with me.

I have a simple EJB that I can successfully deploy using JDeveloper 11g’s integrated WebLogic server and a remote database connection (JDBC). I have a DataSource named “PGY2” defined in WebLogic, and I can test it successfully from the admin console.

Here’s the code of the client I’m trying to test it with (generated entirely by JDev except for the three method calls on adminManager):

public class AdminManagerClient {
    public static void main(String [] args) {
        try {
            final Context context = getInitialContext();
            AdminManager adminManager = (AdminManager)context.lookup("Uran-AdminManager#hu.elte.pgy2.BACNAAI.UranEJB.AdminManager");
            adminManager.addAdmin("root", "root", "Kovács Isten");
            adminManager.addStudent("BACNAAI", "matt", "B Cs", 2005);
            adminManager.addTeacher("SIPKABT", "patt", "S P", "numanal", "Dr.");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    private static Context getInitialContext() throws NamingException {
        Hashtable env = new Hashtable();
        // WebLogic Server 10.x connection details
        env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
        env.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101");
        return new InitialContext( env );
    }
}

But when I try to run this, I get the following error on the line with adminManager.addAdmin (that is, after the lookup):

javax.ejb.EJBException: EJB Exception: ; nested exception is: 
    Exception [EclipseLink-4002] (Eclipse Persistence Services - 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Internal error: Cannot obtain XAConnection Creation of XAConnection for pool PGY2 failed after waitSecs:30 : java.sql.SQLException: Data Source PGY2 does not exist.

Why can’t the client find the data source, and how do I make it find it?


EDIT: I took a closer look at WebLogic’s output during deployment, and I found this. I have no idea what it means, but it may be relevant:

<2010.05.20. 0:50:43 CEST> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application 'PGY2'.
weblogic.application.ModuleException: 
    at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:349)
    at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
    Truncated. see log file for complete stacktrace
weblogic.common.ResourceException:  is already bound
    at weblogic.jdbc.common.internal.RmiDataSource.start(RmiDataSource.java:387)
    at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:136)
    at weblogic.jdbc.common.internal.DataSourceManager.createAndStartDataSource(DataSourceManager.java:97)
    at weblogic.jdbc.module.JDBCModule.activate(JDBCModule.java:346)
    at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
    Truncated. see log file for complete stacktrace
> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:43:29+00:00Added an answer on May 15, 2026 at 12:43 am

    Actually, it’s not the EJB client that can’t find the DataSource, it’s the code running inside the container and using JPA. More precisely, it’s the JPA provider – EclipseLink here – that can’t find it. Double check that the datasource name defined in your persistence.xml (in the <jta-data-source>) matches the JNDI name of the PGY2 DataSource.

    WebLogic provides a JNDI browser (to browse the JNDI tree), use it if required to see under which name your datasource is registrered.

    Update: Could you have linebreaks in the JNDI name field of the datasource (see this blog post)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 475k
  • Answers 475k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When there is no language-specific support, you can use tags.… May 16, 2026 at 4:34 am
  • Editorial Team
    Editorial Team added an answer Oh sweet, I got it figured out! I had to… May 16, 2026 at 4:34 am
  • Editorial Team
    Editorial Team added an answer Try ProjectItemsEvents.ItemAdded. May 16, 2026 at 4:34 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.