0

我有两台 linux 服务器,它们有一个运行在 2 个 WAR 文件中的两个 java 应用程序的 tomcat 7.0.42。我在 linux 上使用 JDK7u25,但其中一个仍然有一个指向 jdk1.4.2 的符号链接(我没有管理员权限,所以我无法更改它)。

具有正确符号链接 /usr/bin/java --> jdk 7 的 Linux 服务器工作正常。应用程序运行没有任何问题。

另一个具有 /usr/bin/java --> jdk1.4.2 的 Linux 服务器,但在 tomcat 中有一个 JAVA_HOME 设置为 jdk 7,(JAVA_HOME=//jdk_1.7.0.25/),在部署我的应用。我的应用需要 Forkjoin API(仅在 jdk 7 中可用)。

我注意到这两个服务器之间的唯一区别是符号链接。

我将工作的tomcat(目录+应用程序+ JDK)复制到不工作的服务器,并将JAVA_HOME设置为导入的工作JDK,但仍然无法工作......它不断向我抛出错误消息并且无法运行应用程序。

这是日志,尽管我认为它不够明确,无法理解我在做什么。


 WARNING: Exception encountered when executing an asynchronous task
com.quartetfs.fwk.QuartetRuntimeException: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube
    at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:493)
    at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:408)
    at jsr166.impl.SingleConsumerQueue.tryConsume(SingleConsumerQueue.java:249)
    at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.compute(DistributedDimensionsManager.java:439)
    at jsr166.cancellable.impl.CancellableRecursiveAction.executeTask(CancellableRecursiveAction.java:28)
    at jsr166.cancellable.impl.CancellableForkJoinTask.exec(CancellableForkJoinTask.java:79)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
    at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:990)
    at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1631)
    at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)
Caused by: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube
    at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.mergeDimensionsInCube(ADistributedActivePivot.java:1014)
    at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.onInitialRemoteCommit(ADistributedActivePivot.java:861)
    at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:479)
    ... 9 more
Caused by: java.lang.IllegalArgumentException: The measure CollateralValue.SUM belongs to more than one cube
    at com.quartetfs.biz.pivot.distribution.impl.PolymorphicLocalityIdentifier.validateAndContribute(PolymorphicLocalityIdentifier.java:235)
    at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$MergeDimensionsTask.compute(ADistributedActivePivot.java:770)
    at jsr166.cancellable.impl.CancellableRecursiveAction.executeTask(CancellableRecursiveAction.java:28)
    at jsr166.cancellable.impl.CancellableForkJoinTask.exec(CancellableForkJoinTask.java:79)
    at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
    at jsr166e.ForkJoinTask.doInvoke(ForkJoinTask.java:360)
    at jsr166e.ForkJoinTask.invoke(ForkJoinTask.java:691)
    at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.mergeDimensionsInCube(ADistributedActivePivot.java:1009)
    ... 11 more

Aug 07, 2013 8:18:11 PM com.quartetfs.tech.distribution.messenger.impl.SafeBroadcastingTask compute INFO: Exception encountered during a broadcasting task. Retrying ... com.quartetfs.fwk.QuartetRuntimeException: java.util.concurrent.ExecutionException: com.quartetfs.fwk.QuartetRuntimeException: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube at com.quartetfs.biz.pivot.distribution.impl.RemoteInstanceDistributionManager.onMembersChanged(RemoteInstanceDistributionManager.java:217) at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger$MembersNotificationAction$1.compute(ADistributedMessenger.java:1046) at jsr166e.RecursiveAction.exec(RecursiveAction.java:161) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264) at jsr166e.ForkJoinTask.doJoin(ForkJoinTask.java:345) at jsr166e.ForkJoinTask.invokeAll(ForkJoinTask.java:756) at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger$MembersNotificationAction.execute(ADistributedMessenger.java:1050) at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:181) at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:157) at jsr166.impl.SingleConsumerQueue.tryConsume(SingleConsumerQueue.java:249) at jsr166.impl.DeferredActionQueue.executeAll(DeferredActionQueue.java:68) at jsr166.impl.DeferredActionQueue$DeferredExecutionAction.compute(DeferredActionQueue.java:274) at jsr166e.RecursiveAction.exec(RecursiveAction.java:161) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264) at jsr166e.ForkJoinTask.doInvoke(ForkJoinTask.java:360) at jsr166e.ForkJoinTask.invoke(ForkJoinTask.java:691) at com.quartetfs.tech.distribution.messenger.impl.SafeBroadcastingTask.compute(SafeBroadcastingTask.java:101) at jsr166e.RecursiveTask.exec(RecursiveTask.java:65) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264) at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:990) at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1631) at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108) Caused by: java.util.concurrent.ExecutionException: com.quartetfs.fwk.QuartetRuntimeException: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getResult(ACompositeFuture.java:155) at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getOrCancel(ACompositeFuture.java:251) at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessages(ADistributedMessenger.java:793) at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessage(ADistributedMessenger.java:864) at com.quartetfs.biz.pivot.distribution.impl.RemoteInstanceDistributionManager.onMembersChanged(RemoteInstanceDistributionManager.java:215) ... 21 more Caused by: com.quartetfs.fwk.QuartetRuntimeException: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:493) at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:408) at jsr166.impl.SingleConsumerQueue.tryConsume(SingleConsumerQueue.java:249) at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.compute(DistributedDimensionsManager.java:439) at jsr166.cancellable.impl.CancellableRecursiveAction.executeTask(CancellableRecursiveAction.java:28) at jsr166.cancellable.impl.CancellableForkJoinTask.exec(CancellableForkJoinTask.java:79) ... 4 more Caused by: com.quartetfs.biz.pivot.MergeException: [rcpcn0c-29706] Could not merge commit 2 from BoNYslNonCashCollateralsCube( r9szn0c-50673) in BoNYslNonCashCollateralsDistributedCube at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.mergeDimensionsInCube(ADistributedActivePivot.java:1014) at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.onInitialRemoteCommit(ADistributedActivePivot.java:861) at com.quartetfs.biz.pivot.distribution.impl.DistributedDimensionsManager$ApplyInitialMessageTask.consume(DistributedDimensionsManager.java:479) ... 9 more Caused by: java.lang.IllegalArgumentException: The measure CollateralValue.SUM belongs to more than one cube at com.quartetfs.biz.pivot.distribution.impl.PolymorphicLocalityIdentifier.validateAndContribute(PolymorphicLocalityIdentifier.java:235) at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$MergeDimensionsTask.compute(ADistributedActivePivot.java:770) at jsr166.cancellable.impl.CancellableRecursiveAction.executeTask(CancellableRecursiveAction.java:28) at jsr166.cancellable.impl.CancellableForkJoinTask.exec(CancellableForkJoinTask.java:79) at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264) at jsr166e.ForkJoinTask.doInvoke(ForkJoinTask.java:360) at jsr166e.ForkJoinTask.invoke(ForkJoinTask.java:691) at com.quartetfs.biz.pivot.impl.ADistributedActivePivot$DistributedTransactionManager.mergeDimensionsInCube(ADistributedActivePivot.java:1009) ... 11 more

和另一个重复的日志错误:


    SEVERE: HelloMessage [HelloMessage-rcpcn0c-47329-62] could not be transmitted
    java.util.concurrent.CancellationException
        at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getResult(ACompositeFuture.java:159)
        at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getOrCancel(ACompositeFuture.java:251)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessages(ADistributedMessenger.java:793)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessage(ADistributedMessenger.java:864)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.broadcast(ADistributedMessenger.java:881)
        at com.quartetfs.tech.distribution.messenger.impl.JGroupsMessenger.ensureMembersCommunication(JGroupsMessenger.java:174)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger$MembersNotificationAction.execute(ADistributedMessenger.java:1004)
        at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:181)
        at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:157)
        at jsr166.impl.SingleConsumerQueue.tryConsume(SingleConsumerQueue.java:249)
        at jsr166.impl.DeferredActionQueue.executeAll(DeferredActionQueue.java:68)
        at jsr166.impl.DeferredActionQueue$DeferredExecutionAction.compute(DeferredActionQueue.java:274)
        at jsr166e.RecursiveAction.exec(RecursiveAction.java:161)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
        at jsr166e.ForkJoinTask.doInvoke(ForkJoinTask.java:360)
        at jsr166e.ForkJoinTask.invoke(ForkJoinTask.java:691)
        at com.quartetfs.tech.distribution.messenger.impl.SafeBroadcastingTask.compute(SafeBroadcastingTask.java:101)
        at jsr166e.RecursiveTask.exec(RecursiveTask.java:65)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
        at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:990)
        at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1631)
        at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)

    Aug 07, 2013 8:18:29 PM com.quartetfs.tech.distribution.messenger.impl.SafeBroadcastingTask compute
    INFO: Exception encountered during a broadcasting task. Retrying ...
    com.quartetfs.fwk.QuartetRuntimeException: Could not connect to remote instances
        at com.quartetfs.tech.distribution.messenger.impl.JGroupsMessenger.ensureMembersCommunication(JGroupsMessenger.java:188)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger$MembersNotificationAction.execute(ADistributedMessenger.java:1004)
        at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:181)
        at jsr166.impl.DeferredActionQueue$ConsumerProcedure.consume(DeferredActionQueue.java:157)
        at jsr166.impl.SingleConsumerQueue.tryConsume(SingleConsumerQueue.java:249)
        at jsr166.impl.DeferredActionQueue.executeAll(DeferredActionQueue.java:68)
        at jsr166.impl.DeferredActionQueue$DeferredExecutionAction.compute(DeferredActionQueue.java:274)
        at jsr166e.RecursiveAction.exec(RecursiveAction.java:161)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
        at jsr166e.ForkJoinTask.doInvoke(ForkJoinTask.java:360)
        at jsr166e.ForkJoinTask.invoke(ForkJoinTask.java:691)
        at com.quartetfs.tech.distribution.messenger.impl.SafeBroadcastingTask.compute(SafeBroadcastingTask.java:101)
        at jsr166e.RecursiveTask.exec(RecursiveTask.java:65)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:264)
        at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:990)
        at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1631)
        at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)
    Caused by: java.util.concurrent.CancellationException
        at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getResult(ACompositeFuture.java:159)
        at com.quartetfs.tech.distribution.messenger.future.impl.ACompositeFuture.getOrCancel(ACompositeFuture.java:251)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessages(ADistributedMessenger.java:793)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.sendMessage(ADistributedMessenger.java:864)
        at com.quartetfs.tech.distribution.messenger.impl.ADistributedMessenger.broadcast(ADistributedMessenger.java:881)
        at com.quartetfs.tech.distribution.messenger.impl.JGroupsMessenger.ensureMembersCommunication(JGroupsMessenger.java:174)
        ... 16 more

即使我已将 JAVA_HOME 设置到正确的位置,它是否可以来自 /usr/bin/java 下的 java?我找不到tomcat如何真正使用java ...

4

2 回答 2

1

正如斯蒂芬所指出的,Tomcat 根据服务器配置使用多种不同的方式来确定正在使用的 java。

在大多数情况下,我会首先检查工作服务器是否存在 $JAVA_HOME,以及自定义 $PATH 设置。检查通常的嫌疑人:/etc/profile、/etc/profile.d/ 、.bash、.profile 等。

您甚至可能会发现 JAVA_HOME 既是在用户级别指定的,也是在初始化脚本中的服务级别指定的,如果您将它作为实际服务运行的话。

目前,您的问题中有许多变量没有答案:

1.) 您是否在两个位置以同一用户身份运行该进程?2.) 用户在两个位置的配置是否相同,具有相同的 PATH 优先级和 ENV 变量?3.) 初始化脚本是否相同?

通过向我们提供尽可能多的细节,我们可以提供更完整/彻底的回应。

于 2013-08-08T01:48:35.113 回答
0

Tomcat是否使用符号链接/usr/bin/java下的java?

这完全取决于您如何配置 Tomcat 以及如何启动它。

但好消息是,所有这些都发生在您可以轻松阅读的 shell 脚本中……如果有必要,还可以“破解”以找出java正在使用的命令。从启动命令或 init.d 脚本或其他任何内容开始,并跟踪它。

另外,请记住,很多这些东西都取决于您使用的 Linux 发行版,以及它们如何组合 Tomcat“包”。

于 2013-08-08T01:35:28.840 回答