Re: [GENERAL] Setting up DSPACE for Postgres access

2003-10-24 Thread Ashwin Kutty
 Given everything else you've tried, I think you might be on the right track
 here and somehow your environment variables are getting clobbered. How or why
 I couldn't say (I'd suspect Tomcat, but you say you can't even run the
 create-administator app).

Tomcat only uses the minor few and runs like a charm.  It doesnt seem to
be only the create-administrator app.  As I mentioned earlier, this occurs
with any app trying to connect to pgsql via jdbc.  I used the psql.java
file to compile and test that comes bundled in the postgres source.  The
error I received was as follows:

Exception in thread main java.lang.NoClassDefFoundError: loaded class
psql was in fact named example.psql
   at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x4025bc8e: java.lang.Error.Error(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x4025d6b6: java.lang.LinkageError.LinkageError(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x4025eb36:
java.lang.NoClassDefFoundError.NoClassDefFoundError(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x4022d555: ?? (??:0)
   at 0x4022c96e: _Jv_ClassReader.handleClassBegin(int, int, int)
(/usr/lib/./libgcj.so.3)
   at 0x4022ab61: _Jv_ClassReader.parse() (/usr/lib/./libgcj.so.3)
   at 0x4022a97f: _Jv_DefineClass(java.lang.Class, byte[], int, int)
(/usr/lib/./libgcj.so.3)
   at 0x40247e6f: java.lang.ClassLoader.defineClass0(java.lang.String,
byte[], int, int, java.security.ProtectionDomain) (/usr/lib/./libgcj.so.3)
   at 0x4025aaa3: java.lang.ClassLoader.defineClass(java.lang.String,
byte[], int, int, java.security.ProtectionDomain) (/usr/lib/./libgcj.so.3)
   at 0x4025aa13: java.lang.ClassLoader.defineClass(java.lang.String,
byte[], int, int) (/usr/lib/./libgcj.so.3)
   at 0x402f1f2e: java.net.URLClassLoader.findClass(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x40248197:
gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x4025a904: java.lang.ClassLoader.loadClass(java.lang.String,
boolean) (/usr/lib/./libgcj.so.3)
   at 0x402488d9: _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader)
(/usr/lib/./libgcj.so.3)
   at 0x40244cdd: java.lang.Class.forName(java.lang.String, boolean,
java.lang.ClassLoader) (/usr/lib/./libgcj.so.3)
   at 0x40244d9f: java.lang.Class.forName(java.lang.String)
(/usr/lib/./libgcj.so.3)
   at 0x402ad01d: gnu.gcj.runtime.FirstThread.run()
(/usr/lib/./libgcj.so.3)
   at 0x4024fc4c: _Jv_ThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
   at 0x4021c8ac: _Jv_RunMain(java.lang.Class, byte const, int, byte
const, boolean) (/usr/lib/./libgcj.so.3)
   at 0x08048910: ?? (??:0)
   at 0x420156a4: __libc_start_main (/lib/tls/libc.so.6)
   at 0x080486c1: ?? (??:0)


 The only other thing I can think of is that for some reason it's looking for
 the wrong class. If dspace comes with the source, it might be worth checking
 whether there isn't a mistake in the Class.forname() call.

Put it this way, the build works for the rest and after some testing found
that outside of create-admin I cant connect to it.

 I must admit, I don't know much java - can you use strace to track system
 calls, or is there a similar utility that would let you see what files it is
 searching for?

strace revealed nothing really that could explain this behaviour.

Thanks a lot for all the assistance btw, I really appreciate it.

Hope you have some more ideas to help out.


---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [GENERAL] Setting up DSPACE for Postgres access

2003-10-23 Thread Ashwin Kutty
 It's complaining that it cannot find a driver. The obvious steps are:
  1. Check you have your JDBC driver installed and configured.

Yes.  I have done so.  Included in the Classpath env var as well.  I have
gone so far as to downloading it from jdbc.postgresql.org rather than
using the compiled one I have.  Still no luck.

  2. Check you can connect using it.

Via a test program?  Done, no luck.. Same ol same ol..

  3. Check it is in the relevant PATH

Besides the Classpath, does it need to be in the Path as well?  If so, no
I havent added it in, but will do so if its required.

 How far along this process have you got?

I am actually to the point of pulling teeth, cause I have added every jar
file I can think of and find in the classpath, re-installed everything and
still the case remains the same.  I am guessing its just not finding it
due to some foolish little quirk I am missing some place.  I even have tcp_ip
turned on btw in postgres to accept connections both from the box itself
and another machine through which I am using pgadmin and connecting fine.

 If you've done all those, we'll have to figure out why it can't find the
 driver.

I thought and still under the impression that its looking in the classpath
for this and I have edited /etc/profile to include it, checked env before
running the program and it according to it the jar file is included fine
and the classpath does have it; but still nothing.  Checked file
permissions on the jar file and its fine as well.  I have made changes to
the user's bash_profile as well to see if its a user related issue and
still nothing.  Su'ed in as root and tried it out and yet nothing.  Its
like for some reason the file just cant be found.

Any ideas and assistance would be greatly appreciated.

Thanks.


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [GENERAL] Setting up DSPACE for Postgres access

2003-10-23 Thread Ashwin Kutty
 Looking at the dspace docs (system prerequisites):
 Then when PostgreSQL has compiled, copy the new postgresql.jar to
 dspace-1.1/lib.

 Strikes me as a bit strange it won't just use the classpath, but have you got
 the jar in there too?

Yes and in j2sdk's lib directory and in pgsql's share directory and it is
all being called in the classpath.. no luck, still..


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] Setting up DSPACE for Postgres access

2003-10-23 Thread Ashwin Kutty

Agreed, however if its working fine on someone else's end then the problem
is local to my environment.  People do have difficulties setting up DSPACE
but I currently have the front-end running fine.  The dependencies are
just crazy along with third party apps for DSPACE.  However, all that is
done, its working and the front-end is up.  I have what most others dont
and dont have what most others do.  The jar part of it really gets me
cause all it needs is the CLASSPATH env var pointing to the appropriate
jar as I have done so many times in the past.

I know Java is on ok cause I have Tomcat running on the server fine as
well which is required for DSPACE as well.  I just dont get why the
program cannot find the jar var.  The create-administrator script runs the
script such that the call tends to be:
java -Xmx256m -classpath $FULLPATH org.dspace.administer.CreateAdministrator

Where, $FULLPATH=$CLASSPATH:$JARS:$DSPACEDIR/config
Where $JARS=`echo $DSPACEDIR/lib/*.jar | sed 's/ /\:/g'`

Now, the postgresql.jar gets pointed to twice; once from the script with
the JARS var and the second with the pointing to it from the $CLASSPATH
var set by me.  I even echo the $FULLPATH var right before it hits the
java command and the echo brings up the huge PATH created by the script
that contains the jar files and the directories.  I dont get however how
the script can have it in the $FULLPATH var but not use it when sent to
the command line?

On Thu, 23 Oct 2003, Dardo D Kleiner wrote:

 Whenever I need to use the postgresql JDBC driver in my programs, I
 have to manually include the line:

 Class.forName(org.postgresql.Driver);

 somewhere *before* I call DriverManager.getConnection.

 Try this in your test program and see if it works.  Unfortunately,
 you may not be able to modify the installer to support this, but
 there might be another way?

 HTH!

 --
 Dardo D. Kleiner
 Connection Machine Facility, Center for Computational Sciences
 Naval Research Laboratory (Washington, DC)
 [EMAIL PROTECTED] -- 202.404.7019




---
The difference between genius and stupidity is that genius has its
limits.  - Albert Einstein

Ashwin
kutty..
Systems Administrator
Dalhousie University Libraries
(902) 494-2694


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster