It didn't find a method

[nobr]hi,

I created a object instance and I tried to access to class method then I receive the following error:

AccessServlet.java:700: Can't find method `getDemoInfo(Ljava/lang/String;)' in type `com.cds.util.as400.CallGEN0186'.

and the CallGEN0186 has this method.

my code

CallGEN0186 callgen0186 =new CallGEN0186();

try

{

servletOut.println("</B></CENTER><BR>");

//Pedro

String s2 = CallGEN0186.getDemoInfo(httpservletrequest.getParameter("accntnbr"));

query.setGENDemographicInfo(s2);

}

catch(AccountQueryException accountqueryexception1)

{

thrownew AccountQueryException(accountqueryexception1.getMessage());

}

the CallGEN0186 class method

publicstaticsynchronized String getDemoInfo(String accnum)

throws AccountQueryException

{

boolean pgmCheck =false;

ProgramCall pgm =new ProgramCall(a);

ProgramParameter parms[] =new ProgramParameter[14];

String pgmName;

String demorecord ="";

String demofields ="";

....

...

...

...

Could you help me, please?[/nobr]

[1874 byte] By [araujo.guntina] at [2007-11-26 17:40:07]
# 1
1. You don't need a new instance of a class to use a class method.2. Why did you name the class "CallGEN0186"? I suggest a more descriptive name.3. Please create a simple example of your problem. (That compiles)
zadoka at 2007-7-9 0:08:16 > top of Java-index,Java Essentials,New To Java...
# 2
I might be willing to bet that's an automatically generated class. Are you using a super-nifty whiz-bang IDE?
kevjavaa at 2007-7-9 0:08:16 > top of Java-index,Java Essentials,New To Java...
# 3
thanks ZadokI'm only trying to compile a code which someone did before me.The CallGEN0186 class belong to an API. I compiled the CallGEN0186.java without error.What would you recommend me?Thanks
araujo.guntina at 2007-7-9 0:08:16 > top of Java-index,Java Essentials,New To Java...
# 4

> thanks Zadok

>

> I'm only trying to compile a code which someone did

> before me.

>

> The CallGEN0186 class belong to an API. I compiled

> the CallGEN0186.java without error.

>

> What would you recommend me?

>

> Thanks

It should work. So something is wrong.

Is the class, that you posted the method for, in the package: com.cds.util.as400.CallGEN0186

zadoka at 2007-7-9 0:08:16 > top of Java-index,Java Essentials,New To Java...
# 5
the CallGEN0186 class (the compiled version of it) is not the one you think it is at runtime. You compiled the AccessServlet.java source file against a different version of the CallGEN0186 class than the version is at run-time.
warnerjaa at 2007-7-9 0:08:16 > top of Java-index,Java Essentials,New To Java...