agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I
4+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I
@ 2006-03-29 03:27 
  2006-03-29 05:33 ` [Pljava-dev] ERROR: Unable to find static method	Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-03-29 03:27 UTC (permalink / raw)

I am having problem defining functions. Im a new user of Pljava and my code
is the following one:

Function Definition:

CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
  RETURNS int4 AS
'Active.executeService(java.lang.Integer,java.lang.String,java.lang.Integer
)'
  LANGUAGE 'java' VOLATILE;
ALTER FUNCTION execute_service(int4, text, int4) OWNER TO postgres;

My Java Class:
public class Active {
    public static int executeService(int serviceId, String dewey,int docId
) {
        try{
            GerenteServicos gs = new GerenteServicos();
            gs.prepairService(serviceId,dewey,docId);
            return 1;
        }catch(Exception e){
            return 0;
        }

    }
}

My function call :

select execute_service(1,'1',1);

My error:
ERROR:  Unable to find static method Active.executeService with signature
(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;)I

Sorry my poor english e I hope that somebody help me!!!
Thanks a lot!!!
--
Cl?udio A. Ferraz - Analista de Sistemas
"Se n?o puder fazer tudo, fa?a tudo o que puder."
"Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ? pobre o
suficiente para n?o poder ajudar."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20060329/84db2dc9/attachment.html;



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] ERROR: Unable to find static method	Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I
  2006-03-29 03:27 [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
@ 2006-03-29 05:33 ` 
  2006-03-30 18:29   ` [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-03-29 05:33 UTC (permalink / raw)

Hi Claudio,
You must put your class in a package.

Kind Regards,
Thomas Hallgren

claudio ferraz wrote:
>
> I am having problem defining functions. Im a new user of Pljava and my 
> code is the following one:
>
> Function Definition:
>
> CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
>   RETURNS int4 AS
> 'Active.executeService(java.lang.Integer,java.lang.String,java.lang.Integer)'
>   LANGUAGE 'java' VOLATILE;
> ALTER FUNCTION execute_service(int4, text, int4) OWNER TO postgres;
>
> My Java Class:
> public class Active {
>     public static int executeService(int serviceId, String dewey,int 
> docId  ) {
>         try{
>             GerenteServicos gs = new GerenteServicos();
>             gs.prepairService (serviceId,dewey,docId);
>             return 1;
>         }catch(Exception e){
>             return 0;
>         }
>        
>     }
> }
>
> My function call :
>
> select execute_service(1,'1',1);
>
> My error:
> ERROR:  Unable to find static method Active.executeService with 
> signature (Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;)I
>
> Sorry my poor english e I hope that somebody help me!!!
> Thanks a lot!!!
> -- 
> Cl?udio A. Ferraz - Analista de Sistemas
> "Se n?o puder fazer tudo, fa?a tudo o que puder."
> "Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ? 
> pobre o suficiente para n?o poder ajudar."
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>   





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I
  2006-03-29 03:27 [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  2006-03-29 05:33 ` [Pljava-dev] ERROR: Unable to find static method	Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
@ 2006-03-30 18:29   ` 
  2006-03-30 19:23     ` [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  0 siblings, 1 reply; 4+ messages in thread

From:  @ 2006-03-30 18:29 UTC (permalink / raw)

Hi Cladio,
Since you catch the exception and discard all information in it, I'm not 
too surprised if you can't see an error :-)

Try using:

   Logger.getAnonymousLogger().log(Level.SEVERE, e.toString(), e);

in your catch clause. Another way is to not catch the exception at all. 
If you define the config parameter 'log_min_messages = DEBUG1' all 
stacktraces will be printed for uncaught exceptions.

Regards,
Thomas Hallgren

PS.
Please CC the pljava-dev mailing list when you ask questions. The 
community is there for our mutual benefit.


claudio ferraz wrote:
> Hi Tomas,
> I placed my project in a package, and partially it functioned. But I 
> am having problems in the function call. I do not obtain to see where 
> it is the error.
>
> My function definition :
> CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
>   RETURNS int4 AS
> 'axml.Active.executeService 
> (java.lang.Integer,java.lang.String,java.lang.Integer)'
>   LANGUAGE 'java' VOLATILE;
> ALTER FUNCTION execute_service(int4, text, int4) OWNER TO postgres;
>
>
> My Class:
>
> package axml;
> public class Active {
>     public static int executeService(int serviceId, String dewey,int 
> docId  ) {
>         try{
>             GerenteServicos gs = new GerenteServicos();
>             gs.prepairService(serviceId,dewey,docId);
>             return 1;
>         }catch(Exception e){
>             return 0;
>         }
>        
>     }
> }
>
> My function call
>
> select execute_service(16,'1.2',79);
>
> Thanks so much!!!
>
>
>
>
> On 3/29/06, *Thomas Hallgren* <thomas at tada.se <mailto:thomas at tada.se>> 
> wrote:
>
>     Hi Claudio,
>     You must put your class in a package.
>
>     Kind Regards,
>     Thomas Hallgren
>
>     claudio ferraz wrote:
>     >
>     > I am having problem defining functions. Im a new user of Pljava
>     and my
>     > code is the following one:
>     >
>     > Function Definition:
>     >
>     > CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
>     >   RETURNS int4 AS
>     >
>     'Active.executeService(java.lang.Integer,java.lang.String,java.lang.Integer
>     )'
>     >   LANGUAGE 'java' VOLATILE;
>     > ALTER FUNCTION execute_service(int4, text, int4) OWNER TO postgres;
>     >
>     > My Java Class:
>     > public class Active {
>     >     public static int executeService(int serviceId, String
>     dewey,int
>     > docId  ) {
>     >         try{
>     >             GerenteServicos gs = new GerenteServicos();
>     >             gs.prepairService (serviceId,dewey,docId);
>     >             return 1;
>     >         }catch(Exception e){
>     >             return 0;
>     >         }
>     >
>     >     }
>     > }
>     >
>     > My function call :
>     >
>     > select execute_service(1,'1',1);
>     >
>     > My error:
>     > ERROR:  Unable to find static method Active.executeService with
>     > signature
>     (Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;)I
>     >
>     > Sorry my poor english e I hope that somebody help me!!!
>     > Thanks a lot!!!
>     > --
>     > Cl?udio A. Ferraz - Analista de Sistemas
>     > "Se n?o puder fazer tudo, fa?a tudo o que puder."
>     > "Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ?
>     > pobre o suficiente para n?o poder ajudar."
>     >
>     ------------------------------------------------------------------------
>
>     >
>     > _______________________________________________
>     > Pljava-dev mailing list
>     > Pljava-dev at gborg.postgresql.org
>     <mailto:Pljava-dev at gborg.postgresql.org>
>     > http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>     >
>
>
>
>
> -- 
> Cl?udio A. Ferraz - Analista de Sistemas
> "Se n?o puder fazer tudo, fa?a tudo o que puder."
> "Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ? 
> pobre o suficiente para n?o poder ajudar." 





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I
  2006-03-29 03:27 [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  2006-03-29 05:33 ` [Pljava-dev] ERROR: Unable to find static method	Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
  2006-03-30 18:29   ` [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
@ 2006-03-30 19:23     ` 
  0 siblings, 0 replies; 4+ messages in thread

From:  @ 2006-03-30 19:23 UTC (permalink / raw)

Claudio,
In your function declaration you write:

  AS  
'axml.Active.executeService(java.lang.Integer,java.lang.String,java.lang.Integer)'

but your function is:

  public static int executeService(int serviceId, String dewey,int docId)

You can do one of the following:

1. Use 'java.lang.Integer' in both the function AS declaration and the 
method.
2. Use 'int' in both the function AS declaration and the method.
3. Skip the parameters altogether in the function AS declaration, i.e. 
use AS 'axml.Active.executeService'

In case #3, PL/Java will figure out the correct signature by mapping the 
SQL function parameters.

Now PLEASE use the pljava-dev mailing list when you ask questions about 
PL/Java. Further mails that are addressed only to me personally will be 
left unanswered.

Regards,
Thomas Hallgren


claudio ferraz wrote:
>
>
> On 3/30/06, *Thomas Hallgren* <thomas at tada.se <mailto:thomas at tada.se>> 
> wrote:
> Hi Thomas,
>
> The error is 
> ERROR:  Unable to find static method axml.Active.executeService with 
> signature (Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;)I
>
> thanks !!
>
>     Hi Cladio,
>     Since you catch the exception and discard all information in it,
>     I'm not
>     too surprised if you can't see an error :-)
>
>     Try using:
>
>        Logger.getAnonymousLogger().log(Level.SEVERE, e.toString(), e);
>
>     in your catch clause. Another way is to not catch the exception at
>     all.
>     If you define the config parameter 'log_min_messages = DEBUG1' all
>     stacktraces will be printed for uncaught exceptions.
>
>     Regards,
>     Thomas Hallgren
>
>     PS.
>     Please CC the pljava-dev mailing list when you ask questions. The
>     community is there for our mutual benefit.
>
>
>     claudio ferraz wrote:
>     > Hi Tomas,
>     > I placed my project in a package, and partially it functioned.
>     But I
>     > am having problems in the function call. I do not obtain to see
>     where
>     > it is the error.
>     >
>     > My function definition :
>     > CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
>     >   RETURNS int4 AS
>     > 'axml.Active.executeService
>     > (java.lang.Integer,java.lang.String,java.lang.Integer)'
>     >   LANGUAGE 'java' VOLATILE;
>     > ALTER FUNCTION execute_service(int4, text, int4) OWNER TO postgres;
>     >
>     >
>     > My Class:
>     >
>     > package axml;
>     > public class Active {
>     >     public static int executeService(int serviceId, String dewey,int
>     > docId  ) {
>     >         try{
>     >             GerenteServicos gs = new GerenteServicos();
>     >             gs.prepairService(serviceId,dewey,docId);
>     >             return 1;
>     >         }catch(Exception e){
>     >             return 0;
>     >         }
>     >
>     >     }
>     > }
>     >
>     > My function call
>     >
>     > select execute_service(16,'1.2',79);
>     >
>     > Thanks so much!!!
>     >
>     >
>     >
>     >
>     > On 3/29/06, *Thomas Hallgren* <thomas at tada.se
>     <mailto:thomas at tada.se> <mailto:thomas at tada.se
>     <mailto:thomas at tada.se>>>
>     > wrote:
>     >
>     >     Hi Claudio,
>     >     You must put your class in a package.
>     >
>     >     Kind Regards,
>     >     Thomas Hallgren
>     >
>     >     claudio ferraz wrote:
>     >     >
>     >     > I am having problem defining functions. Im a new user of
>     Pljava
>     >     and my
>     >     > code is the following one:
>     >     >
>     >     > Function Definition:
>     >     >
>     >     > CREATE OR REPLACE FUNCTION execute_service(int4, text, int4)
>     >     >   RETURNS int4 AS
>     >     >
>     >     'Active.executeService(java.lang.Integer
>     ,java.lang.String,java.lang.Integer
>     >     )'
>     >     >   LANGUAGE 'java' VOLATILE;
>     >     > ALTER FUNCTION execute_service(int4, text, int4) OWNER TO
>     postgres;
>     >     >
>     >     > My Java Class:
>     >     > public class Active {
>     >     >     public static int executeService(int serviceId, String
>     >     dewey,int
>     >     > docId  ) {
>     >     >         try{
>     >     >             GerenteServicos gs = new GerenteServicos();
>     >     >             gs.prepairService (serviceId,dewey,docId);
>     >     >             return 1;
>     >     >         }catch(Exception e){
>     >     >             return 0;
>     >     >         }
>     >     >
>     >     >     }
>     >     > }
>     >     >
>     >     > My function call :
>     >     >
>     >     > select execute_service(1,'1',1);
>     >     >
>     >     > My error:
>     >     > ERROR:  Unable to find static method Active.executeService
>     with
>     >     > signature
>     >     (Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;)I
>     >     >
>     >     > Sorry my poor english e I hope that somebody help me!!!
>     >     > Thanks a lot!!!
>     >     > --
>     >     > Cl?udio A. Ferraz - Analista de Sistemas
>     >     > "Se n?o puder fazer tudo, fa?a tudo o que puder."
>     >     > "Nigu?m ? rico o suficiente para n?o poder ser ajudado,
>     ningu?m ?
>     >     > pobre o suficiente para n?o poder ajudar."
>     >     >
>     >    
>     ------------------------------------------------------------------------
>     >
>     >     >
>     >     > _______________________________________________
>     >     > Pljava-dev mailing list
>     >     > Pljava-dev at gborg.postgresql.org
>     <mailto:Pljava-dev at gborg.postgresql.org>
>     >     <mailto:Pljava-dev at gborg.postgresql.org
>     <mailto:Pljava-dev at gborg.postgresql.org>>
>     >     > http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>     >     >
>     >
>     >
>     >
>     >
>     > --
>     > Cl?udio A. Ferraz - Analista de Sistemas
>     > "Se n?o puder fazer tudo, fa?a tudo o que puder."
>     > "Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ?
>     > pobre o suficiente para n?o poder ajudar."
>
>
>
>
> -- 
> Cl?udio A. Ferraz - Analista de Sistemas
> "Se n?o puder fazer tudo, fa?a tudo o que puder."
> "Nigu?m ? rico o suficiente para n?o poder ser ajudado, ningu?m ? 
> pobre o suficiente para n?o poder ajudar." 





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-03-30 19:23 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-29 03:27 [Pljava-dev] ERROR: Unable to find static method Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
2006-03-29 05:33 ` [Pljava-dev] ERROR: Unable to find static method	Active.executeService with signature (Ljava/lang/Integer; Ljava/lang/String; Ljava/lang/Integer; )I 
2006-03-30 18:29   ` 
2006-03-30 19:23     ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox