WebSphere 项目启动出错java.lang.ClassNotFoundException

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WebSphere 项目启动出错java.lang.ClassNotFoundException相关的知识,希望对你有一定的参考价值。

Caused by: java.lang.NoClassDefFoundError: org.apache.log4j.PropertyConfigurator
at com.metlife.ins.util.bwlog.log4j.BwLogProvider.configure(BwLogProvider.java:32)
at com.metlife.ins.util.bwlog.BwLogFactory._configure(BwLogFactory.java:65)
at com.metlife.ins.util.bwlog.BwLogFactory._create(BwLogFactory.java:129)
at com.metlife.ins.util.bwlog.BwLogFactory.create(BwLogFactory.java:183)
at com.metlife.us.ins.product.disability.utilities.DisabilityBwLogFactory.getBwLog(DisabilityBwLogFactory.java:23)
at com.metlife.us.ins.product.disability.dpa.utilities.DPABwLogFactory.getBwLog(DPABwLogFactory.java:19)
at com.metlife.us.ins.product.disability.dpa.utilities.DPABwLogFactory.create(DPABwLogFactory.java:23)
at com.metlife.us.ins.product.disability.dpa.websvc.work.services.WorkListWSBindingImpl.<clinit>(WorkListWSBindingImpl.java:29)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:163)
at com.ibm.ws.webservices.engine.utils.ClassUtils$1.run(ClassUtils.java:164)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
at com.ibm.ws.webservices.engine.utils.ClassUtils.forName(ClassUtils.java:157)
... 35 more

参考技术A NoClassDefFoundError错误一般是jar包缺失或jar包冲突,你这里的问题应该是log4j-版本.jar导致的。看起来出错的位置像是webservice。 参考技术B 1.检查包是否冲突;2清理下部署文件,重新部署追问

怎么检查jar包冲突问题?我是新手,多谢赐教。

hbase 启动缓慢 -- 调用 watcher java.lang.NullPointerException 时出错:ZK 为 null

【中文标题】hbase 启动缓慢 -- 调用 watcher java.lang.NullPointerException 时出错:ZK 为 null【英文标题】:hbase startup slow -- Error while calling watcher java.lang.NullPointerException: ZK is null 【发布时间】:2014-12-21 10:29:36 【问题描述】:

最近与我的本地 0.94 hbase 建立连接的速度非常慢。我收到以下错误。我认为当我将我的 mac 升级到优胜美地时它就开始发生了。我已经尝试了所有简单的修复、重启、清除 data/zk 目录、重新安装 hbase 等,但似乎没有任何帮助。

我的配置很简单,只是覆盖hbase.rootdirhbase.zookeeper.quorumhbase.zookeeper.property.dataDir。我也收到这样的消息:

 java[3323:30250] Unable to load realm info from SCDynamicStore

但之前发生的那些没有异常堆栈/连接速度非常慢。

ZK is null on connection event -- see stack trace for the stack trace when constructor was called on this zkw
java.lang.Exception: ZKW CONSTRUCTOR STACK TRACE FOR DEBUGGING
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:143)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:127)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1506)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:714)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:787)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:175)
    at com.feedly.normandy.persistence.hbase.PersistenceManager.init(PersistenceManager.java:244)
    at com.feedly.normandy.HBaseUnitTest.createPersistenceManager(HBaseUnitTest.java:152)
    at com.feedly.normandy.HBaseUnitTest.beforeClass(HBaseUnitTest.java:159)
    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:601)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
SEVERE: Error while calling watcher 
java.lang.NullPointerException: ZK is null
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.connectionEvent(ZooKeeperWatcher.java:366)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.process(ZooKeeperWatcher.java:303)
    at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:519)
    at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:495)

【问题讨论】:

【参考方案1】:

GrepCode Link Here 声称 ZooKeeperWatcher 抛出 NullPointerException 是因为底层 zooKeeper 句柄在连接相关事件期间变为 null。 我建议在 ZK 主机上做一个 netstat,看看它是否在某个时候断开了你的连接。如果您没有看到这种情况发生,请下载该类的源 jar 并进入 connectionEvent() 方法以准确查看对象何时变为空,这可能会导致您找到根本原因。

【讨论】:

【参考方案2】:

很奇怪,但似乎与本地主机查找有关。我尝试了一些来自

的东西

How can I eliminate slow resolving/loading of localhost/virtualhost (a 2-3 second lag) on Mac OS X Lion?

直到我可以快速进行查找,然后一切又变得敏捷。

【讨论】:

【参考方案3】:

我的机器上也有同样的问题。我通过以下步骤解决了它:

    打开终端并编写命令:hostname - 结果您将看到 PC 的主机名。复制此名称。

    更改文件 /etc/hosts,添加从上一步复制的主机名: 127.0.0.1 localhost 把名字放在这里

希望这对你也有帮助。

【讨论】:

以上是关于WebSphere 项目启动出错java.lang.ClassNotFoundException的主要内容,如果未能解决你的问题,请参考以下文章

websphere启动报错: java.lang.TypeNotPresentException: Type javax.annotation.Resource not present

本地部署Websphere时出错

启动tomcat就报错:java.lang.ClassNotFoundException: org.apache.commons.beanutils.Converter

项目由tomcat迁移到TongWeb之后报java.lang.NoClassDefFoundError

JRebel启动报错

websphere 无法进入 管理控制台 输入完用户名密码后报java.lang.NullPointerException