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 7986927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:59:40+00:00 2026-06-04T11:59:40+00:00

I’m trying to connect to databse using jade java and jdbc public class IntermediaryAgent

  • 0

I’m trying to connect to databse using jade java and jdbc

public class IntermediaryAgent extends Agent{

private Connection con;
protected void setup()
{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1522:xe","hr","hr");

    Statement stmt = con.createStatement();
    ResultSet rs=stmt.executeQuery("SELECT * FROM data");
    rs.next();

        int id=rs.getInt(1);
        String name=rs.getString("NAME");
        String surname=rs.getString("SURNAME");
        int age=rs.getInt(4);
        System.out.println(""+id+" "+name+" "+surname+" "+age);
        rs.close();
        stmt.close();
    con.close();
    DFAgentDescription df=new DFAgentDescription();
    df.setName(getAID());
    ServiceDescription sd =new ServiceDescription();
    sd.setType("Agent");
    sd.setName("inter");
    df.addServices(sd);
    try {
        DFService.register(this, df);
    } catch (FIPAException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}
protected void takeDown()
{
    try {
        DFService.deregister(this);
    } catch (FIPAException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

But I get error

2012-05-24 18:15:27 jade.core.Runtime beginContainer
INFO: ----------------------------------
This is JADE snapshot - revision $WCREV$ of $WCDATE$
downloaded in Open Source, under LGPL restrictions,
at http://jade.tilab.com/
----------------------------------------
2012-05-24 18:15:29 jade.core.BaseService init
INFO: Service jade.core.management.AgentManagement initialized
2012-05-24 18:15:29 jade.core.BaseService init
INFO: Service jade.core.messaging.Messaging initialized
2012-05-24 18:15:29 jade.core.BaseService init
INFO: Service jade.core.mobility.AgentMobility initialized
2012-05-24 18:15:29 jade.core.BaseService init
INFO: Service jade.core.event.Notification initialized
2012-05-24 18:15:29 jade.core.messaging.MessagingService clearCachedSlice
INFO: Clearing cache
2012-05-24 18:15:29 jade.mtp.http.HTTPServer <init>
INFO: HTTP-MTP Using XML parser 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
2012-05-24 18:15:29 jade.core.messaging.MessagingService boot
INFO: MTP addresses:
http://10.1.242.245:7778/acc
2012-05-24 18:15:29 jade.core.AgentContainerImpl joinPlatform
INFO: --------------------------------------
Agent container Main-Container@mariusz is ready.
--------------------------------------------
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at agenty.IntermediaryAgent.polacz(IntermediaryAgent.java:120)
at agenty.IntermediaryAgent.setup(IntermediaryAgent.java:19)
at jade.core.Agent$ActiveLifeCycle.init(Agent.java:1519)
at jade.core.Agent.run(Agent.java:1465)
at java.lang.Thread.run(Unknown Source)

    ***  Uncaught Exception for agent p  ***
    java.lang.NullPointerException
at agenty.IntermediaryAgent.odczyt(IntermediaryAgent.java:144)
at agenty.IntermediaryAgent.setup(IntermediaryAgent.java:20)
at jade.core.Agent$ActiveLifeCycle.init(Agent.java:1519)
at jade.core.Agent.run(Agent.java:1465)
at java.lang.Thread.run(Unknown Source)
ERROR: Agent p died without being properly terminated !!!
State was 2
jade.domain.FIPAAgentManagement.FailureException: ((action ( agent-identifier :name 
df@mariusz:1099/JADE  :addresses (sequence http://10.1.242.245:7778/acc )) (deregister 
(df-agent-description :name ( agent-identifier :name p@mariusz:1099/JADE  :addresses 
(sequence http://10.1.242.245:7778/acc ))))) not-registered)
at jade.domain.FIPAService.doFipaRequestClient(FIPAService.java:163)
at jade.domain.FIPAService.doFipaRequestClient(FIPAService.java:102)
at jade.domain.DFService.deregister(DFService.java:195)
at jade.domain.DFService.deregister(DFService.java:217)
at jade.domain.DFService.deregister(DFService.java:228)
at agenty.IntermediaryAgent.takeDown(IntermediaryAgent.java:43)
at jade.core.Agent.clean(Agent.java:1652)
at jade.core.Agent$ActiveLifeCycle.end(Agent.java:1567)
at jade.core.Agent.run(Agent.java:1495)
    at java.lang.Thread.run(Unknown Source)

I try use simple java class (not use agent) with jdbc code and it is works. When I use jdbc with agent it doesn’t work. What is wrong?

  • 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-06-04T11:59:42+00:00Added an answer on June 4, 2026 at 11:59 am

    You need the Oracle JDBC driver on your classpath.

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I am doing a simple coin flipping experiment for class that involves flipping a

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.