Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

java.lang.NullPointerException

7 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-06-02 21:15:12.0Z
Magnus Posted on 1997-05-27 14:29:26.0Z
From: "Magnus" <magnus.thall@tv4.se>
Subject: java.lang.NullPointerException
Organization: TV4 AB
Message-ID: <01bc6ab3$17d77e20$8d050ec1@magnus_t>
X-Newsreader: Microsoft Internet News 4.70.1161
Newsgroups: sybase.public.jdbcconnect
Date: Tue, 27 May 1997 10:29:26 -0400
Lines: 28
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:769
Article PK: 252523

I have just installed jConnect and JDK 1.1.1. and have stuck in to some
problems.

1)
When I execute (with Build successful) the sample-code isql.java in
Symantec Visual Café (Applet viewer) I get error
"Unexpected Exception: java.lang.NullPointerException" in the Results
listbox.

2)
When I launch the sample applet "isql.class" (from gateway.html in the same
host machine as the server is running on) I get error
"jdbc.sql.SQLException: An IO exception was caught from a lower layer and
re-thrown.: java.io.IOException: Connection failed to ':-1' Restart
connection."

3) success
When I launch "my own" applet c:\test\isql.class compiled from problem #1)
from test.html then I get connection with my SQL server

---
Here's my setup:

NT 4.0
IE 3.02
Sybase Open Client 10.0.4 (16)
Sybase Open Client 11.1.0 (32)
JDK 1.1.1 in C:\java
JDBC 1.10c in C:\jdbc

CLASSPATH =
C:\jConnect\classes;C:\jdbc\classes;C:\java\lib\classes.zip

JAVA_HOME =
C:\java

JDBC_HOME =
C:\jConnect

--
Thanks in advance for any help at all,
magnus.thall@tv4.se


David Clegg Posted on 1997-05-27 19:31:21.0Z
Message-ID: <338B3689.79425F98@sybase.com>
Date: Tue, 27 May 1997 12:31:21 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: Magnus <magnus.thall@tv4.se>
Subject: Re: java.lang.NullPointerException
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Newsgroups: sybase.public.jdbcconnect
Lines: 43
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:762
Article PK: 252513


Magnus wrote:
>
> I have just installed jConnect and JDK 1.1.1. and have stuck in to some
> problems.
>
> 1)
> When I execute (with Build successful) the sample-code isql.java in
> Symantec Visual Café (Applet viewer) I get error
> "Unexpected Exception: java.lang.NullPointerException" in the Results
> listbox.

I think that your connection failed for some reason -- I think we
have fixed the Isql.java bug where we went ahead and tried to
execute the statement in this case, which resulted in the NullPointer.

>
> 2)
> When I launch the sample applet "isql.class" (from gateway.html in the same
> host machine as the server is running on) I get error
> "jdbc.sql.SQLException: An IO exception was caught from a lower layer and
> re-thrown.: java.io.IOException: Connection failed to ':-1' Restart
> connection."
Sounds like you are trying to start the applet with
"file:/gateway.html".
This doesn't work because the Isql.java applet tries to get the hostname
and port# of the web-server from the Applet context -- you get a
port# of -1 if you started the applet from a file.

>
> 3) success
> When I launch "my own" applet c:\test\isql.class compiled from problem #1)
> from test.html then I get connection with my SQL server
>
> ---
> Here's my setup:
>
> NT 4.0
> IE 3.02
> Sybase Open Client 10.0.4 (16)
> Sybase Open Client 11.1.0 (32)
> JDK 1.1.1 in C:\java
> JDBC 1.10c in C:\jdbc
>
> CLASSPATH =
> C:\jConnect\classes;C:\jdbc\classes;C:\java\lib\classes.zip
>
> JAVA_HOME =
> C:\java
>
> JDBC_HOME =
> C:\jConnect
>
> --
> Thanks in advance for any help at all,
> magnus.thall@tv4.se


Don Blair Posted on 1997-06-02 21:15:12.0Z
Message-ID: <339337E0.319B@sybase.com>
Date: Mon, 02 Jun 1997 17:15:12 -0400
From: Don Blair <dblair@sybase.com>
Reply-To: dblair@sybase.com
Organization: Powersoft
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: David Clegg <davec@sybase.com>
CC: dblair
Subject: Workaround.
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t> <338B3689.79425F98@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 17
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:737
Article PK: 252488


> A few days ago, we upgraded to Symantec Cafe pre-release 4,
> and the symptoms have changed. Now, we are ostensibly able to
> load the driver, but the following operation fails:
>
> Connection con = DriverManager.getConnection(
> "jdbc:sybase:Tds:localhost:4444", _cmdline._props);
> *** SQLException caught ***
> SQLState: 08001
> Message: No suitable driver
>
> Again, if I run in non-debug mode, the problem disappears.
> Anyone seen this problem?

I just discovered that Symantec Cafe works correctly as long
as you don't use the debugger to actually STEP OVER the call to
DriverManager.getConnection.

Don


Don Blair Posted on 1997-06-02 19:19:19.0Z
Message-ID: <33931CB7.6075@sybase.com>
Date: Mon, 02 Jun 1997 15:19:19 -0400
From: Don Blair <dblair@sybase.com>
Reply-To: dblair@sybase.com
Organization: Powersoft
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
Subject: Re: java.lang.NullPointerException
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t> <338B3689.79425F98@sybase.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.jdbcconnect
Lines: 27
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:742
Article PK: 252493


> 1)
> When I execute (with Build successful) the sample-code isql.java in
> Symantec Visual Café (Applet viewer) I get error
> "Unexpected Exception: java.lang.NullPointerException" in the Results
> listbox.

We had this same problem when we upgraded to JDK 1.1
last week. The exception occurred when first loading
the driver:

Class.forName("com.sybase.jdbc.SybDriver");

The problem only occurred when running with
the Symantec Cafe (Version 1.53 pre-release 2) debugger.
The problem did not occur when running in non-debug
mode.

A few days ago, we upgraded to Symantec Cafe pre-release 4,
and the symptoms have changed. Now, we are ostensibly able to
load the driver, but the following operation fails:

Connection con = DriverManager.getConnection(
"jdbc:sybase:Tds:localhost:4444", _cmdline._props);
*** SQLException caught ***
SQLState: 08001
Message: No suitable driver

Again, if I run in non-debug mode, the problem disappears.
Anyone seen this problem?

Don


Don Blair Posted on 1997-06-02 19:16:19.0Z
Message-ID: <33931C03.B11@sybase.com>
Date: Mon, 02 Jun 1997 15:16:19 -0400
From: Don Blair <dblair@sybase.com>
Reply-To: dblair@sybase.com
Organization: Powersoft
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: David Clegg <davec@sybase.com>
CC: magnus.thall@tv4.se, "Zhang, Charlie" <CZhang@watcom.on.ca>, dblair
Subject: Re: java.lang.NullPointerException
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t> <338B3689.79425F98@sybase.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.jdbcconnect
Lines: 27
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:743
Article PK: 252495


> 1)
> When I execute (with Build successful) the sample-code isql.java in
> Symantec Visual Café (Applet viewer) I get error
> "Unexpected Exception: java.lang.NullPointerException" in the Results
> listbox.

We had this same problem when we upgraded to JDK 1.1
last week. The exception occurred when first loading
the driver:

Class.forName("com.sybase.jdbc.SybDriver");

The problem only occurred when running with
the Symantec Cafe (Version 1.53 pre-release 2) debugger.
The problem did not occur when running in non-debug
mode.

A few days ago, we upgraded to Symantec Cafe pre-release 4,
and the symptoms have changed. Now, we are ostensibly able to
load the driver, but the following operation fails:

Connection con = DriverManager.getConnection(
"jdbc:sybase:Tds:localhost:4444", _cmdline._props);
*** SQLException caught ***
SQLState: 08001
Message: No suitable driver

Again, if I run in non-debug mode, the problem disappears.
Anyone seen this problem?

Don


Magnus Thall Posted on 1997-05-28 14:17:02.0Z
Message-ID: <338C3E2C.609D@tv4.se>
Date: Wed, 28 May 1997 16:17:02 +0200
From: Magnus Thall <magnus.thall@tv4.se>
Organization: TV4
X-Mailer: Mozilla 3.01 (Macintosh; I; PPC)
MIME-Version: 1.0
Subject: Re: java.lang.NullPointerException
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t> <338B3689.79425F98@sybase.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.jdbcconnect
Lines: 50
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:759
Article PK: 252511

Hi again.
I made some mistakes when I launched my applet Isql.class (compiled with
Symantec Visual Café from the latest isql.java) from isqlTest.html

Here is the error-message again.
-
D:\VC_TEST>appletviewer isqlTest.html

Copyright 1997 Sybase, Inc.
All Rights Reserved
java.lang.NullPointerException:
at Isql.start(Isql.java:200)
at sun.applet.AppletPanel.run(AppletPanel.java:287)
at java.lang.Thread.run(Thread.java:474)
-


When I run the downloaded sample applet ”isql.class” then it works
perfect.

But I have had some success with old isql.java!
When I compile and run the old isql.java in Symantec Visual Café then I
get it to work if I change the declaration
import java.sql.*; to -> import jdbc.sql.*;

But the applet only works inside Visual Café.
Outside Visual Café (in appletviewer) I get error
"sun.applet.AppletSecurityException:checkconnect.networknone"
when I click on OK-button.
And with IE 3.02 I get a green background with no text-fields or
OK-button.



Regarding problem #1:
This is what happens when I try to compile the new Isql.java with javac

--
D:\VC_TEST>javac Isql.java
Note: Isql.java uses a deprecated API. Recompile with "-deprecation"
for detail
s.
1 warning

D:\VC_TEST>javac Isql.java -deprecation
Isql.java:99: Note: The method boolean action(java.awt.Event,
java.lang.Object)
in class java.awt.Component has been deprecated, and class Isql (which
is not de
precated) overrides it.
public boolean action(Event evt, Object arg)
^
Isql.java:261: Note: The method void appendText(java.lang.String) in
class java.
awt.TextArea has been deprecated.
_result.appendText("\n" + column.toString());
^
Note: Isql.java uses a deprecated API. Please consult the documentation
for a b
etter alternative.
3 warnings

D:\VC_TEST
--


Thanks again,
magnus.thall@tv4.se


Magnus Thall Posted on 1997-05-28 10:42:01.0Z
Message-ID: <338C0BE6.39E8@tv4.se>
Date: Wed, 28 May 1997 12:42:01 +0200
From: Magnus Thall <magnus.thall@tv4.se>
Organization: TV4
X-Mailer: Mozilla 3.01 (Macintosh; I; PPC)
MIME-Version: 1.0
Subject: Re: java.lang.NullPointerException
References: <01bc6ab3$17d77e20$8d050ec1@magnus_t> <338B3689.79425F98@sybase.com>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Newsgroups: sybase.public.jdbcconnect
Lines: 58
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:760
Article PK: 252514

Hi again

My problem #1 still remains but problem #2 was solved when I removed
the following line in gateway.html
<param name=proxy value=”localhost:8000”>

--
Regarding problem #1:
When I run the sample applet ”isql.class” then it works perfect.
But this is what happens when I run my applet that is compiled with
Symantec Visual Café.

D:\VC_TEST>appletviewer isqlTest.html
java.io.FileNotFoundException: \classes\Isql.class
at java.io.FileInputStream.<init>(FileInputStream.java:64)
at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
.java:150)
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:170)
at
sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:115)
at
sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:259)
at
sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:352)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:419)
at sun.applet.AppletPanel.run(AppletPanel.java:223)
at java.lang.Thread.run(Thread.java:474)
File not found when looking for: Isql
java.lang.NullPointerException
at sun.applet.AppletPanel.runLoader(AppletPanel.java:419)
at sun.applet.AppletPanel.run(AppletPanel.java:223)
at java.lang.Thread.run(Thread.java:474)


Regarding problem #1:
This is what happens when I try to compile with javac

D:\VC_TEST>javac Isql.java
Note: Isql.java uses a deprecated API. Recompile with "-deprecation"
for detail
s.
1 warning

D:\VC_TEST>javac Isql.java -deprecation
Isql.java:99: Note: The method boolean action(java.awt.Event,
java.lang.Object)
in class java.awt.Component has been deprecated, and class Isql (which
is not de
precated) overrides it.
public boolean action(Event evt, Object arg)
^
Isql.java:261: Note: The method void appendText(java.lang.String) in
class java.
awt.TextArea has been deprecated.
_result.appendText("\n" + column.toString());
^
Note: Isql.java uses a deprecated API. Please consult the documentation
for a b
etter alternative.
3 warnings

D:\VC_TEST>

Thanks in advance for any help at all,
magnus.thall@tv4.se