Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

missing dependancy?

1 view
Skip to first unread message

Steve Hansen

unread,
Nov 22, 2001, 6:16:35 PM11/22/01
to
Hello,

I get the following run time error:
java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown
Source)
at Main.main(Main.java:14)
Exception in thread "main"

I've search the supplied jar files and I can find no reference to SpyLogger
anywhere! Has com/merant/jdbcspy/SpyLogger been left out?

Using DriverManager.getConnection seems to work ok.

Has anyone used the com.microsoft.jdbcx.sqlserver.SQLServerDataSource
approach?

Below is a code snipet of what I'm trying to do..
code (snipet):
import java.sql.*; // import JDBC2.0 core
import javax.sql.*; // import optional package
import javax.naming.*; // jndi naming api

public class Main {

public static void main(String args[]){
try {
com.microsoft.jdbcx.sqlserver.SQLServerDataSource
ds = new com.microsoft.jdbcx.sqlserver.SQLServerDataSource();
ds.setServerName("192.168.0.6:1433");
Connection con = ds.getConnection("sa","");
....


--
Steven Hansen
Sinex Aviaiton Technologies


Phillip Morelock

unread,
Nov 26, 2001, 5:21:48 PM11/26/01
to
Hey, i will paste in my reply from earlier. Bottom line: HELP! please,
maybe joseph or sarah?

I just came up with the same problem and was coming here to get an answer
(possibly):

here's my code (not using JNDI obviously):
ssds = new SQLServerDataSource();
ssds.setServerName("192.168.75.203");
ssds.setPortNumber(1433);
ssds.setDatabaseName("shanghai");
ssds.setUser("sa");
ssds.setPassword("p4r4d1s0");
msdatasource = (DataSource) new SQLServerDataSource();

so you see my problem? it's that last line. So the error message you got
was the one i received when (subsequent to having set up the datasource like
this) i called getConnection().

After fixing the code like so:

ssds = new SQLServerDataSource();
ssds.setServerName("192.168.75.203");
ssds.setPortNumber(1433);
ssds.setDatabaseName("shanghai");
ssds.setUser("sa");
ssds.setPassword("p4r4d1s0");
msdatasource = (DataSource) ssds;

I still get the same error.


java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown Source)
at

com.ivianetwork.shanghai.util.ShanghaiConnectionFactory.getConnection(Shangh
aiConnectionFactory)

(ShanghaiConnectionFactory is my class that simply calls getConnection() on
the DataSource)

so we're in the same boat. Anyone?


"Steve Hansen" <bird...@hotmail.com> wrote in message
news:#iH6$y6cBHA.568@tkmsftngp02...
> I've made a post regarding using
> com.microsoft.jdbcx.sqlserver.SQLServerDataSource and a runtime error I
get:


>
> java.lang.NoClassDefFoundError: com/merant/jdbcspy/SpyLogger
> at com.microsoft.jdbcx.base.BaseDataSource.getConnection(Unknown
> Source)
> at Main.main(Main.java:14)
>

> I also am interested in using this driver for connection pooling and
seeing
> how this is an essential step I'm wonder if anyone else has received this
> error?
>
> Steve Hansen
>
> "Phillip Morelock" <phi...@SPAMivianetwork.com> wrote in message
> news:#7cu0PtbBHA.2036@tkmsftngp02...
> > i'm about to start that myself. keep in touch on this thread if you
come
> > across anything. I'll do the same. Thanks!
> >
> > fillup
> >
> >
> > "Tom Berry" <tbe...@vhb.com> wrote in message
> > news:7af301c16ead$aefbce20$37ef2ecf@TKMSFTNGXA13...
> > > Is anyone implementing connection pooling with the JDBC
> > > driver? If so, what webserver are you using? Any problems
> > > with the driver? I'm currently just using Tomcat 3.2.3.
> > >
> > > Thanks
> > > Tom Berry
> >
> >
>
>


"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...

Phillip Morelock

unread,
Nov 26, 2001, 5:54:00 PM11/26/01
to
i also just found the following (I was trying to unjar the jars so that I
could see if that "missing" class was even provided)...don't know if this is
relevant:

C:\Temp\tmp>jar -xvf mssqlserver.jar
java.util.zip.ZipException: invalid EXT descriptor signature
at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:348)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:144)
at sun.tools.jar.Main.extractFile(Main.java:715)
at sun.tools.jar.Main.extract(Main.java:678)
at sun.tools.jar.Main.run(Main.java:191)
at sun.tools.jar.Main.main(Main.java:904)


"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...

Phillip Morelock

unread,
Nov 26, 2001, 5:57:20 PM11/26/01
to
idea:
can we use setLogWriter to get around this? not sure, investigating.....

"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...

Phillip Morelock

unread,
Nov 26, 2001, 8:17:19 PM11/26/01
to
okay
i even went back and unjarred the mssqlserver.jar (the one giving jar a
headache) using winzip, then rejarring it manually. The jar is no longer
corrupt. But i still get this same error.


"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...

Phillip Morelock

unread,
Nov 27, 2001, 3:20:30 PM11/27/01
to
Alright, well, screw it.

I went with a set of wrapper classes that I used to use that would make a
JDBC 1.0 Driver look like a JDBC 2.0 DataSource, and also implements its own
Connection pool. So I'm treating the MS driver as a "dumb" driver (1.0).

Now i'm getting the "cloned connections / transactions" problem everyone
else on this newsgroup has already had ;)


"Steve Hansen" <bird...@hotmail.com> wrote in message
news:OXkYJv6cBHA.1540@tkmsftngp03...

Koen Van Exem

unread,
Nov 29, 2001, 5:44:53 AM11/29/01
to
Hello,

I guess you are using a jdk 1.2 or higher so this
probably is a security issue.

Security has changed considerably in the Java2 platform,
from a pure sandbox to an access control list (acl)
based security scheme.

Here are the 2 steps for an allow all security policy:

a) provide a java.policy file
---start---
grant {
permission java.security.AllPermission;
};
---stop---

b) add -Djava.security.policy=java.policy to your command that invokes
your application (and your JavaVM as a result)
java -Djava.security.policy=java.policy com.mycompany.MyApplication

In a deployment scenario you should change the allow all to something
more suitable.

With kind regards,
Koen

-----
Koen Van Exem
Projekto – No Cure, No pay!
visit http://www.projekto.com


"Steve Hansen" <bird...@hotmail.com> wrote in message news:<OXkYJv6cBHA.1540@tkmsftngp03>...

0 new messages