简体   繁体   English

Oracle Weblogic将jar添加到类路径?

[英]Oracle Weblogic adding jars to the classpath?

How do you add jars to the class path for Oracle 10.3.5...As I understood it, there is a bug (or incorrect info) with the documentation (readme) that states that any jars placed in the $DOMAIN_HOME/lib directory would be added to the classpath dynamically...but in the real documentation for 10.3.3 it states that these files dont get added to the classpath anymore... 如何将jar添加到Oracle 10.3.5的类路径中......正如我所理解的,文档(自述文件)中存在一个错误(或不正确的信息),指出放在$ DOMAIN_HOME / lib目录中的任何jar文件将动态添加到类路径...但在10.3.3的真实文档中,它声明这些文件不再被添加到类路径...

so here I am trying to find out -- how do you add jars to the classpath...I have tried changing the commonEnv.sh and am currently looking for the setDomainEnv.sh (but cant find it as of yet) and none of these things have worked to add this jar to the classpath... 所以在这里我试图找出 - 如何将jar添加到类路径...我已经尝试更改commonEnv.sh并且我正在寻找setDomainEnv.sh(但是暂时找不到它)并且没有这些东西已经成功地将这个jar添加到类路径中......

my whole problem is that i added datasources to my server...and I am trying to add the DB2 jar to the environment so that it can be used...funny thing is that after adding the jar in the $DOMAIN_HOME/lib I was able to get rid of a connection error in the admin console when trying to test the connection to the database...and that all seems to work but now im getting a class definition error... 我的问题是我将数据源添加到我的服务器......我正在尝试将DB2 jar添加到环境中以便可以使用...有趣的是,在$ DOMAIN_HOME / lib中添加jar后我在尝试测试与数据库的连接时能够摆脱管理控制台中的连接错误...而且一切似乎都有效但现在我得到了一个类定义错误...

]] Root cause of ServletException.
java.lang.NoClassDefFoundError: com/ibm/db2/jcc/DB2Connection
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:630)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:343)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Connection
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    Truncated. see log file for complete stacktrace

idk what else to try - i searched for some answers but seemingly all of them are old and outdated... 还有什么可以尝试 - 我搜索了一些答案,但看起来所有这些都是陈旧的和过时的......

$DOMAIN/lib should work fine, but not dynamically. $ DOMAIN / lib应该可以正常工作,但不能动态。 You have to restart. 你必须重新启动。 However, handling JAR files for data source drivers is likely different. 但是,处理数据源驱动程序的JAR文件可能有所不同。

Just curious - have you confirmed the jar file(s) contain he class in question? 只是好奇 - 你确认jar文件包含他的课程吗?

Also try: http://docs.oracle.com/cd/E17904_01/web.1111/e13753/db2.htm 另请尝试: http//docs.oracle.com/cd/E17904_01/web.1111/e13753/db2.htm

我最终发现问题是我在windows上编辑commEnv.sh文件而不是commEnv.cmd文件...真的很笨,但编辑并将jar添加到类路径中有效...哇!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM