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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:24:32+00:00 2026-06-05T16:24:32+00:00

I really have problem with this one. So I have a jar with a

  • 0

I really have problem with this one.

So I have a jar with a class for handling a database connection. In that class I have put several methods. Out of this class I have created a jar using Ant.

Sometime yesterday I suddenly could not access the latest method in that db class anymore. I get:

compile:
[javac] C:\cygwin\home\user\Dev\Java\avc_alarm\build.xml:22: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1 source file to C:\cygwin\home\user\Dev\Java\avc_alarm\build
[javac] C:\cygwin\home\user\Dev\Java\avc_alarm\src\se\gefa\avc_alarm\Main.java:9: error: cannot find symbol
[javac] symbolAliases = db.getAlarmSymbolAlias();
[javac]                   ^
[javac]   symbol:   method getAlarmSymbolAlias()
[javac]   location: variable db of type AvcDb
[javac] 1 error

Code that tries to use this class method:

package se.gefa.avc_alarm;

import se.gefa.avc_db.AvcDb;
import java.util.ArrayList;

public class Main {
    static AvcDb db  = new AvcDb();
    static ArrayList<String> symbolAliases;

    public static void main(String args[]) throws Exception {
        db.setupConnection("jdbc:h2:tcp://localhost/C:/XXXX/xyz", "sa", "");
        symbolAliases = db.getAlarmSymbolAlias();
    }
}

And the db class (which goes into a jar):

package se.gefa.avc_db;

import java.sql.*;
import java.util.ArrayList;

public class AvcDb {

    // ---
    // Other methods that DO work
    // ---

    // The one that DO NOT work
    public ArrayList<String> getAlarmSymbolAlias() throws Exception {
        String query = "SELECT * FROM Alarm";
        Statement statement = conn.createStatement();
        ResultSet resultSet = statement.executeQuery(query);

        ArrayList<String> symbols = new ArrayList<String>();
        while (resultSet.next())
            symbols.add(resultSet.getString("symbol_alias"));

        return symbols;
    }
}

I’m using java 7, Ant 1.8.3 and Vim. When opening the db jar in IntelliJ I can see that the getAlarmSymbolAlias method exists. And as I said, I could call any other of the methods for the db class except any method added yesterday. A simple test in IntelliJ and it seems to work (but I don’t want to learn a new Editor when I got all other set up in Vim, CL and Ant.

Edit Ant script:

<project name="AvcAlarm" default="dist" basedir=".">
  <description>
    Alarm program. 
  </description>

  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist" location="dist"/>
  <property name="lib" location="lib"/>

  <path id="classpath">
    <fileset dir="${lib}" includes="**/*.jar"/>
  </path>

  <target name="init">
    <tstamp/>
    <mkdir dir="${build}"/>
    <mkdir dir="${dist}"/>
  </target>

  <target name="compile" depends="init" description="compile the source " >
    <javac srcdir="${src}" destdir="${build}" classpathref="classpath"/>
  </target>

  <target name="dist" depends="compile" description="generate the distribution" >
    <jar destfile="${dist}/gefa_alarm.jar" basedir="${build}">
        <zipgroupfileset dir="lib" includes="*.jar" />
        <manifest>
            <attribute name="Main-Class" value="se/gefa/avc_alarm/Main"/>
        </manifest>
    </jar>
  </target>

  <target name="clean" description="clean up" >
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>
  • 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-05T16:24:33+00:00Added an answer on June 5, 2026 at 4:24 pm

    Your classpath must be wrong, or you use an invalid version of the JAR that doesn’t contain this method.

    Updated after investigation with OP: another JAR in the lib folder contained a different version of the AvcDb, and was being loaded first on the classpath, so the desired method could not be found.

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

Sidebar

Related Questions

Ok I have this problem that I've never had before, it's really bugging me.
hey guys having this really simple problem but cant seem to figure out have
I would really appreciate if you could shed light on this problem. I have
I have a problem with the esmtp application that I really hope you help
So I have a problem that I don't really know how to go about.
I have a problem very similar to this one , but slightly more involved.
This one is weird. I have a list view that is a part of
I have this problem on my study guide that calls for a function that
I really have tried researching this problem, but I'm now getting so close to
Really been struggling with this one for some time now, i have many text

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.