2017年3月4日土曜日

NoSuchMethodError: com.google.gwt.dev.resource.ResourceOracle.getResourceMap()Ljava/util/Map

現象:

NoSuchMethodError: com.google.gwt.dev.resource.ResourceOracle.getResourceMap()Ljava/util/Map

問題点:

CLASSPATH に異なるバージョンの jar を結合しています。

com/google/gwt/user/client/rpc/core/java/util/map_customfieldserializerbase.class
  C:\Users\Sola\.m2\repository\com\google\gwt\gwt-user\2.8.0\gwt-user-2.8.0.jar
  C:\Users\Sola\.m2\repository\com\google\gwt\gwt-servlet\2.3.0\gwt-servlet-2.3.0.jar

対策:

mvn gwt:compile
→ mvn org.codehaus.mojo:gwt-maven-plugin:2.3.0:compile

mvn gwt:compile は最新版(2.8.0)を取得しようとします。

バージョンを合わせましょう。バージョンが同じであれば、同じ class ファイルを含んでいたとしても、問題ないはずです。

2017年3月1日水曜日

jbpm-designer-standalone.war: WELD-001409: Ambiguous dependencies for type AuthenticationService with qualifiers @Default

現象:

自炊しました jbpm-designer-standalone.war がデプロイに失敗します。

{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"jbpm-designer-standalone.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jbpm-designer-standalone.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type AuthenticationService with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject org.uberfire.ext.security.server.BasicAuthSecurityFilter.authenticationService
  at org.uberfire.ext.security.server.BasicAuthSecurityFilter.authenticationService(BasicAuthSecurityFilter.java:0)
  Possible dependencies: 
  - Managed Bean [class org.uberfire.ext.security.server.ServletSecurityAuthenticationService] with qualifiers [@Any @Default],
  - Managed Bean [class org.jboss.errai.security.server.PicketLinkAuthenticationService] with qualifiers [@Any @Default]
"}}

問題点:

不明

対策:

不明

jbpm-console.war.failed: "Services that were unable to start:" => ["jboss.deployment.unit.\"jbpm-console.war\".PARSE"],

問題点:

"{\"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available.\" => {
    \"Services that were unable to start:\" => [\"jboss.deployment.unit.\\\"jbpm-console.war\\\".PARSE\"],
    \"Services that may be the cause:\" => [
        \"jboss.http-upgrade-registry.default\",
        \"jboss.remoting.remotingConnectorInfoService.http-remoting-connector\"
    ]
}}"


対策:

Apache Tomcat などで http://localhost:8080 をふさいでいないかどうか、確認しましょう。

jbpm-designer-standalone: java.io.IOException: CreateProcess error=206, ファイル名または拡張子が長すぎます。

問題点:

C:\Git\jbpm-designer\jbpm-designer-standalone>mvn -Dfull -DskipTests -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory -DforkMode=never gwt:compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jBPM Designer - Standalone 7.0.0.Beta6
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.wildfly.core:wildfly-cli:jar:2.1.0.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.wildfly.core:wildfly-embedded:jar:2.1.0.Final is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- gwt-maven-plugin:2.8.0:compile (default-cli) @ jbpm-designer-standalone ---
[ERROR] 2 28, 2017 6:02:41 午後 java.util.prefs.WindowsPreferences <init>
[ERROR] 警告: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] Compiling module org.jbpm.designer.jBPMDesigner
...
[INFO]    Compiling 2 permutations
[INFO]       [ERROR] Unable to start external process
[INFO] java.io.IOException: Cannot run program "C:\Java8\jre\bin\java": CreateProcess error=206, ファイル名または拡張子が長すぎます。
[INFO]  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
[INFO]  at com.google.gwt.dev.ExternalPermutationWorkerFactory.launchExternalWorker(ExternalPermutationWorkerFactory.java:282)
[INFO]  at com.google.gwt.dev.ExternalPermutationWorkerFactory.getWorkers(ExternalPermutationWorkerFactory.java:374)
[INFO]  at com.google.gwt.dev.PermutationWorkerFactory.createWorkers(PermutationWorkerFactory.java:351)
[INFO]  at com.google.gwt.dev.PermutationWorkerFactory.compilePermutations(PermutationWorkerFactory.java:254)
[INFO]  at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:211)
[INFO]  at com.google.gwt.dev.Compiler.compile(Compiler.java:219)
[INFO]  at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[INFO]  at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]  at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO] Caused by: java.io.IOException: CreateProcess error=206, ファイル名または拡張子が長すぎます。
[INFO]  at java.lang.ProcessImpl.create(Native Method)
[INFO]  at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
[INFO]  at java.lang.ProcessImpl.start(ProcessImpl.java:137)
[INFO]  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[INFO]  ... 12 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:34 min
[INFO] Finished at: 2017-02-28T18:05:22+09:00
[INFO] Final Memory: 142M/1528M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.8.0:compile (default-cli) on project jbpm-designer-standalone: Command failed with status 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


対策:

pom.xml<extraJvmArgs>-Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory を追加します。

          <plugin><!-- Keep in sync with soa profile -->
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <configuration>
              <!-- Build all GWT permutations and optimize them -->
              <module>org.jbpm.designer.jBPMDesigner</module>
              <draftCompile>false</draftCompile>
              <extraJvmArgs>-Xms1g -Xmx2g -Xss1M -Dgwt.jjs.permutationWorkerFactory=com.google.gwt.dev.ThreadedPermutationWorkerFactory</extraJvmArgs>
            </configuration>
          </plugin>



2017年2月28日火曜日

jbpm-designer-standalone: Could not reserve enough space for 2097152KB object heap

問題点:

mvn install が失敗します。

[INFO] --- gwt-maven-plugin:2.8.0:compile (gwt-compile) @ jbpm-designer-standalone ---
[INFO] Error occurred during initialization of VM
[INFO] Could not reserve enough space for 2097152KB object heap

INFO レベルになっていて一見何の問題もないように見えるのは、
もう一つ Java を起動していて、そこで実行しているタスクのログを INFO レベルで転送しているからです。

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.8.0:compile (gwt-compile) on project jbpm-designer-standalone: Command failed with status 1 -> [Help 1]

対策:

64-bit 版 jdk を使用しましょう。

jbpm-designer-standalone: de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck failed

現象:


mvn package が失敗します。

エラー

[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-direct-dependencies) @ jbpm-designer-standalone ---
[INFO] Flag 'useClassesFromLastBuild' is set. Try to use existing output folder.
[INFO] Analyze dependencies of artifact 'org.jbpm:jbpm-designer-standalone:war:7.0.0.Beta6'.
[WARNING] Rule 0: de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck failed with message:
Found 194 illegal transitive type dependencies in artifact 'org.jbpm:jbpm-designer-standalone:war:7.0.0.Beta6':
1.) org.drools.workbench.models.datamodel.auditlog.AuditLog
2.) org.drools.workbench.models.datamodel.auditlog.AuditLogEntry
3.) org.drools.workbench.models.datamodel.auditlog.AuditLogFilter

エラー

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-direct-dependencies) on project jbpm-designer-standalone: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]

問題点: 


そもそも何故このような現象が起こるかについてですが、jbpm-designer の親にあたる org.kie:kie-parent:7.0.0.Beta6 にチェックが仕込まれています。

C:\Git\jbpm-designer\pom.xml に次のような記述があります:

  <parent>
    <groupId>org.kie</groupId>
    <artifactId>kie-parent</artifactId>
    <version>7.0.0.Beta6</version>
    <!-- relativePath causes out-of-date problems on hudson slaves -->
    <!--<relativePath>../droolsjbpm-build-bootstrap/pom.xml</relativePath>-->
  </parent>
  <groupId>org.jbpm</groupId>
  <artifactId>jbpm-designer</artifactId>
  <packaging>pom</packaging>


org.kie:kie-parent:7.0.0.Beta6 を求めて…

わたしの場合は、こちらのファイルに: C:\Users\ku_000\.m2\repository\org\kie\kie-parent\7.0.0.Beta6\kie-parent-7.0.0.Beta6.pom

            <execution>
              <id>enforce-direct-dependencies</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <illegalTransitiveDependencyCheck
                      implementation="de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck">
                    <regexIgnoredClasses combine.children="append">
                      <!-- The marshalling classes are generated by Errai during GWT compilation. These classes
                           usually contain references to other dependencies which are not part of the project
                           (transitive dependencies), which then results in the dependency check failure.
                           From the maintenance point of view, ignoring these generated classes seems like the
                           best option. -->
                      <regexIgnoredClass>org\.jboss\.errai\.marshalling\.server\.impl\.ServerMarshallingFactory.*
                      </regexIgnoredClass>
                    </regexIgnoredClasses>
                  </illegalTransitiveDependencyCheck>
                </rules>
              </configuration>
            </execution>

対策:

(1) スキップしたい


スキップすることができます。 mvn package -Denforcer.skip=true
参考

スキップできたとしても、デプロイが失敗します。本質的な対策にはなりえません。

2017-03-01 13:43:47,282 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jbpm-designer-standalone.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"jbpm-designer-standalone.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"jbpm-designer-standalone.war\".WeldStartService: Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException: org/ext/uberfire/social/activities/model/SocialUser
    Caused by: java.lang.NoClassDefFoundError: org/ext/uberfire/social/activities/model/SocialUser
    Caused by: java.lang.ClassNotFoundException: org.ext.uberfire.social.activities.model.SocialUser from [Module \"deployment.jbpm-designer-standalone.war:main\" from Service Module Loader]"}}

(2) 対策したい

不足しているものを調査しないといけません。

mvn dependency:analyze -Denforcer.fail=false -DoutputXML=true

で、一覧化できます。<dependency> についてくる <version>...</version> は親プロジェクトの pom へ記述するようにし、末端プロジェクトの pom では削除するようにします。

<listMissingArtifacts>true</listMissingArtifacts> のほうを使います。記述方法については、オフィシャルを参照

こうすると mvn package で次のようにパッケージ情報つきで教えてくれます。


[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-direct-dependencies) @ jbpm-designer-client ---
[INFO] Flag 'listMissingArtifacts' is set. Transitively used artifacts are resolved.
[INFO] Flag 'useClassesFromLastBuild' is set. Try to use existing output folder.
[INFO] Analyze dependencies of artifact 'org.jbpm:jbpm-designer-client:jar:7.0.0.Beta6'.
[WARNING] Rule 0: de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck failed with message:
Found 361 illegal transitive type dependencies in artifact 'org.jbpm:jbpm-designer-client:jar:7.0.0.Beta6':
1.) org.drools.workbench.models.datamodel.auditlog.AuditLog, [org.drools:drools-workbench-models-datamodel-api:jar:7.0.0.Beta6]
2.) org.drools.workbench.models.datamodel.auditlog.AuditLogEntry, [org.drools:drools-workbench-models-datamodel-api:jar:7.0.0.Beta6]
3.) org.drools.workbench.models.datamodel.auditlog.AuditLogFilter, [org.drools:drools-workbench-models-datamodel-api:jar:7.0.0.Beta6]

内容は itd-org.jbpm-jbpm-designer-client-jar-7.0.0.Beta6.txt にも保存されます。 



以下、手作業で抽出したもの:

C:\Git\jbpm-designer\jbpm-designer-standalone\pom.xml で、
<!-- dependencies added because of new illegal transitive dependency check --> のところに不足している dependency を追加していきます。

    <!-- New! 7.0.0.Beta6 -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-workbench-models-datamodel-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-asset-mgmt-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-cdi-shared</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-marshalling</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-form-modeler-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench.screens</groupId>
      <artifactId>kie-wb-common-default-editor-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench.screens</groupId>
      <artifactId>kie-wb-common-project-editor-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench.services</groupId>
      <artifactId>kie-wb-common-datamodel-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kie.workbench.services</groupId>
      <artifactId>kie-wb-common-refactoring-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-backend-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons-editor-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-properties-editor-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-security-management-api</artifactId>
    </dependency>


jbpm-console 自炊


64-bitjdk で。

これらを順にビルド:
https://github.com/droolsjbpm/jbpm-designer.git
https://github.com/droolsjbpm/jbpm-form-modeler.git
https://github.com/droolsjbpm/kie-wb-distributions.git


mvn package -Dfull -DskipTests -Denforcer.skip=true

jbpm-designer をフルビルドして作られる
C:\Git\jbpm-designer\jbpm-designer-standalone\target\jbpm-designer-standalone.war
が、
jbpm-console.war
の正体です。