Manifest.MF问题与MSSQLSERVER 2008和Groovy [英] Manifest.MF issue with MSSQLSERVER 2008 and Groovy

查看:98
本文介绍了Manifest.MF问题与MSSQLSERVER 2008和Groovy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GGTS IDE中创建了一个简单的Groovy项目,连接到Oracle和SQLServer。该程序在IDE内运行良好,但是当我通过命令行运行该程序时,我似乎在MANIFEST.MF中遇到了某种引用错误?请参阅下面的堆栈跟踪:

命令行

  groovy -cp lib\ojdbc14_g.jar lib\sqljdbc4.jar src\Starter.groovy 




$ b

  org.codehaus.groovy.control.MultipleCompilationErrorsException:启动失败:
C:\workspace-ggts-3.1.0.RELEASE\Test\lib\sqljdbc4.jar:1:意外的char:0x3 @第1行第3列。
PK♥h?I @ ¶META-INF /MANIFEST.MF¡|GôΓ┌▓εⁿD∞░= x /Þ¢8◄oïB B

^

1错误

在过去连接MSSQLServer时,我使用了以下jar包:




  • msbase.jar

  • msutil.jar

  • mssqlserver.jar



这一次,当我查找2008年的jdbc jar时,我得到了 sqljdbc4.jar 。它同样可以在IDE中使用,但不能从命令行使用。我已经指出问题在sqljdbc4.jar中,因为我评论了所有与之相关的代码,并且程序运行良好,只有oracle jar引用。


  1. 有人知道为什么会发生这种情况吗?

  2. 使用groovy从命令行连接到sqlserver 2008的jar包是什么?

谢谢。

解决方案

在类路径条目之间需要分号假设你在Windows上)

  groovy -cp lib\ojdbc14_g.jar; lib\sqljdbc4.jar src\Starter .groovy 

如果您使用的是Linux / Mac,请使用冒号

  groovy -cp lib / ojdbc14_g.jar:lib / sqljdbc4.jar src / Starter.groovy 


I have created a simple Groovy project in GGTS IDE that connects to Oracle and SQLServer. The Program runs fine within the IDE but when I run the program through the command line I seem to get some sort of enconding error in MANIFEST.MF?. See the stacktrace below:

Command Line

groovy -cp lib\ojdbc14_g.jar lib\sqljdbc4.jar src\Starter.groovy

Result

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
C:\workspace-ggts-3.1.0.RELEASE\Test\lib\sqljdbc4.jar: 1: unexpected char: 0x3 @ line 1, column 3.
   PK♥ h?I@            ¶   META-INF/MANIFEST.MF¡|GôΓ┌▓εⁿD∞ ░=x/êsä      8◄o ï∟B▲
ë╔
     ^

1 error

In the past to connect to MSSQLServer I have used the following jars:

  • msbase.jar
  • msutil.jar
  • mssqlserver.jar

This time though, when I looked for jdbc jars for 2008 I got the sqljdbc4.jar. Again it works from within the IDE but not from command line. I have singled out the problem to be in the sqljdbc4.jar because I commented all the code related to that and the program ran fine with just the oracle jar references.

  1. Anybody know why this is happening?
  2. What jars are you using to connect to sqlserver 2008 from the command line with groovy?

Thanks.

解决方案

You need semi-colons between classpath entries (assuming you are on Windows)

groovy -cp lib\ojdbc14_g.jar;lib\sqljdbc4.jar src\Starter.groovy

Or colons if you're on Linux/Mac

groovy -cp lib/ojdbc14_g.jar:lib/sqljdbc4.jar src/Starter.groovy

这篇关于Manifest.MF问题与MSSQLSERVER 2008和Groovy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆