pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Petersen <scottpetersen@softhome.net>
To: pgsql-jdbc@postgresql.org
Subject: PL/Java problem.
Date: Wed, 06 Sep 2006 14:03:25 -0600
Message-ID: <44FF298D.3050000@softhome.net> (raw)

Greetings,

Before I start I must admit that I am a newbie to Java.  This means that 
this might actually be my problem and NOT a software issue, but I need help.

I am attempting to execute the "Hello World" demo from 
http://wiki.tada.se/wiki/display/pljava/User+Guide which is part of the 
user guide for the software.  In the process I created the following 
class, and compiled (JAR) with NO errors:

   package com.mycompany.helloworld;
   public HelloWorld {    public String helloWorld() {        return 
"Hello World";    }
   }

Next I ran psql  with the following result:

#psql -U mfgadmin mlp204
Password for user mfgadmin:
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

Warning: Console code page (437) differs from Windows code page (1252)
         8-bit characters may not work correctly. See psql reference
         page "Notes for Windows users" for details.

mlp204=# select sqlj.install_jar('file:///Java source/helloworld.jar', 
'hellowor
ld_jar', false);
 install_jar
-------------

(1 row)

mlp204=# select sqlj.set_classpath('public', 'helloworld_jar');
 set_classpath
---------------

(1 row)

mlp204=# CREATE OR REPLACE FUNCTION helloworld()
mlp204-#   RETURNS "varchar" AS
mlp204-#     'com.mycompany.helloworld.HelloWorld.helloWorld'
mlp204-#   LANGUAGE 'java' VOLATILE;
CREATE FUNCTION
mlp204=# select * from helloworld();
ERROR:  java.lang.ClassNotFoundException: 
com.mycompany.helloworld.HelloWorld
mlp204=#

Everything seems to be working fine except I receive a 
"ClassNotFoundException".  Any help in understanding what I did wrong 
would be appreciated.

Thanks Scott.






view thread (7+ messages)  latest in thread

Message-ID: <44FF298D.3050000@softhome.net>
Permalink:  ../44FF298D.3050000@softhome.net/
Also on:    postgresql.org/message-id/44FF298D.3050000@softhome.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: scottpetersen@softhome.net
  Subject: Re: PL/Java problem.
  In-Reply-To: <44FF298D.3050000@softhome.net>
  References: <44FF298D.3050000@softhome.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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