Glassfish由于与Mac中的java(在jdk和jre中可用)冲突而无法启动

时间:2014-08-24 12:58:20

标签: java eclipse macos glassfish

启动glassfish服务器时出现以下异常(在Mac OS中使用jdk1.7.0_67)。

如果您有任何建议可以解决java冲突并成功启动域,请告诉我。在此先感谢。

以下是Mac OS Mavericks的结果 - >终端

> pwd
/Users/arj/glassfish3/bin
> **./asadmin start-domain domain1**

Waiting for domain1 to start .Error starting domain domain1.
The **server exited prematurely with exit code 1.**
Before it died, it produced the following output:

FATAL ERROR in native method: processing of -javaagent failed
objc[20181]: **Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.**
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at com.advisory.olympus.util.JavaAgentClass.<clinit>(JavaAgentClass.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:382)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 7 more
launchctl bsexec failed: Inappropriate ioctl for device

Command start-domain failed.

如果通过eclipse-&gt; glassfish尝试也会出现同样的问题......

1 个答案:

答案 0 :(得分:0)

升级到 Ojdbc7.jar 解决了这个问题。