开发者

IKVM + DatabaseLoader = Classpath issue

开发者 https://www.devze.com 2023-04-05 05:44 出处:网络
Weka in .net through IKVM works great.The tutorial in Wiki is lots of help. However, I think the way that weka loads the jdbc jar file is causing

Weka in .net through IKVM works great. The tutorial in Wiki is lots of help. However, I think the way that weka loads the jdbc jar file is causing some problems in .net. I wonder if anyone has encountered this problem before and knows what I am doing wrong?

  • I have compiled the sql jar using ikvmc: ikvmc -target:library sqljdbc4.jar
  • I have included it in the .net project, and put DatabaseUtils.props in the proper directory.
  • The jar that I'm referencing works great as a stand alone, but fails to find the JDBC once it is loaded through Visual Studio.

Thanks in advanced.

Here is the error output:

Trying to add database driver (JDBC): com.microsoft.sqlserver.jdbc.SQLServerDriver - Warning, not in CLASSPATH?
java.sql.SQLException: No suitable driver found for jdbc:sqlserver://172.30.157.250;DatabaseName=Bidding;integratedSecurity=false;
ssword=expedia1
        at java.sql.DriverManager.getConnection(DriverManager.java:647)
        at java.sql.DriverManager.getConnection(DriverManager.java:226)
        at weka.experiment.DatabaseUtils.connectToDatabase(DatabaseUtils.java:505)
        at weka.experiment.InstanceQuery.retrieveInstances(InstanceQuery.java:287)
        at weka.experiment.InstanceQuery.retrieveInstances(InstanceQuery.java:272)
        at clusterer.InstanceB开发者_开发知识库uilder.getInstances(InstanceBuilder.java:29)
        at clusterer.Clusterer.getTripAdvisorClassified(Clusterer.java:85)
        at clusterer.Clusterer.main(Clusterer.java:39)
        at cli.ConsoleApplication1.Program.Main(Program.cs:14)


Maybe it will help to specify the -classloader option for the ikvmc tool when compiling.

Example :

ikvmc -out:outputDllName.dll 
-classloader:ikvm.runtime.ClassPathAssemblyClassLoader PathToJarsFolder/*.jar

where PathToJarsFolder contains all the jar files that were trying to load from the java classpath.

Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号