quarkus-cxf native build failes - UnresolvedElementException - Discovered unresolved method during parsing - cxf

Good day to all :-)
I am using the quarkus-cxf extension and have now encountered the following problem.
In JVM mode everything works fine. Thank you very much for your library.
But I have errors in native mode. For a tip what I am probably doing wrong, I am very grateful …
Quarkus Version: 1.7.1.Final
quarkus-cxf Version: https://github.com/shumonsharif/quarkus-cxf/blob/master/pom.xml
Error occurs on
mvn clean package -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -Dquarkus.container-image.registry=nfrt-docker-staging-local.repo.pnet.ch -Dquarkus.container-image.tag=latest -Pnative
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.apache.cxf.staxutils.validation.W3CMultiSchemaFactory.<init>(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
at parsing org.apache.cxf.staxutils.validation.Stax2ValidationUtils.getValidator(Stax2ValidationUtils.java:164)
Call path from entry point to org.apache.cxf.staxutils.validation.Stax2ValidationUtils.getValidator(Endpoint, ServiceInfo):
at org.apache.cxf.staxutils.validation.Stax2ValidationUtils.getValidator(Stax2ValidationUtils.java:136)
at org.apache.cxf.staxutils.validation.Stax2ValidationUtils.setupValidation(Stax2ValidationUtils.java:115)
at org.apache.cxf.staxutils.validation.WoodstoxValidationImpl.setupValidation(WoodstoxValidationImpl.java:66)
at org.apache.cxf.databinding.source.XMLStreamDataReader.validate(XMLStreamDataReader.java:231)
at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:115)
at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:83)
at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:67)
at org.apache.cxf.wsdl.interceptors.BareInInterceptor.handleMessage(BareInInterceptor.java:131)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.transport.MultipleEndpointObserver.onMessage(MultipleEndpointObserver.java:98)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1201)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:834)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:750)
... 8 more
Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.apache.cxf.staxutils.validation.W3CMultiSchemaFactory.(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.reportUnresolvedElement(SharedGraphBuilderPhase.java:259)
at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedMethod(SharedGraphBuilderPhase.java:249)
at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.handleUnresolvedInvoke(SharedGraphBuilderPhase.java:203)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeSpecial(BytecodeParser.java:1811)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeSpecial(BytecodeParser.java:1801)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5339)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3423)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3230)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1088)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:982)
at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:214)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:225)
at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:352)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:322)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:311)
at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:112)
at com.oracle.graal.pointsto.DefaultAnalysisPolicy$DefaultSpecialInvokeTypeFlow.onObservedUpdate(DefaultAnalysisPolicy.java:373)
at com.oracle.graal.pointsto.flow.TypeFlow.notifyObservers(TypeFlow.java:470)
at com.oracle.graal.pointsto.flow.TypeFlow.update(TypeFlow.java:542)
at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:530)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
... 5 more
Error: Image build request failed with exit status 1

You can retry with last version on https://github.com/quarkiverse/quarkiverse-cxf

Related

Upgrading to maven-plugin-plugin 6.3.4 results in com.thoughtworks.qdox.parser.ParseException: syntax error

After upgrading maven-plugin-plugin from 3.6.0 to 3.6.4, I am getting a the following exception while the build creates the maven-plugin-descriptor:
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.6.4:descriptor failed: syntax error #[60,84] in file:/xyz/Foo.java
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
...
Caused by: com.thoughtworks.qdox.parser.ParseException: syntax error #[60,84] in file:/xyz/Foo.java
at com.thoughtworks.qdox.parser.impl.Parser.yyerror (Parser.java:1963)
at com.thoughtworks.qdox.parser.impl.Parser.yyparse (Parser.java:2085)
at com.thoughtworks.qdox.parser.impl.Parser.parse (Parser.java:1944)
at com.thoughtworks.qdox.library.SourceLibrary.parse (SourceLibrary.java:232)
This is running with Maven 3.8.6.
The code compiles file - it's only when running through the org.apache.maven.plugins:maven-plugin-plugin:3.6.4:descriptor
Turns out this was related to using a restricted identifier (var, yield, record) as a method parameter. The underlying qdox parser seems to be more picky than the Java compiler in the regard.
Running Sonarlint on the file helped identify the issue. They provide a nice description in their java:S6213 rule.

Codenameone: Android Build Failed with strange exception

Since today (28.03.) the build of my app (CN1 build server) throws an build Exception which I don't understand. The Build yesterday worked without an error. The error from the error-log:
Dex: The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$8.updateIndex(DexMerger.java:565)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:574)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:166)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
:transformDexArchiveWithDexMergerForDebug FAILED
:transformDexArchiveWithDexMergerForDebug (Thread[Daemon worker,5,main]) completed. Took 0.334 secs.
FAILURE: Build failed with an exception.
Can anybody help me to understand what went wrong?
The error is:
Dex: The number of method references in a .dex file cannot exceed 64K.
In this case, add the build hint:
android.multidex=true
As written in the developer guide (link):
android.multidex -> Boolean true/false defaults to false. Multidex
allows Android binaries to reference more than 65536 methods. This
slows builds a bit so we have it off by default but if you get a build
error mentioning this limit you should turn this on.

Android Manifest merger error in Codename One

In a bare bones project, I added these build hints:
android.gradleDep=compile 'com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5'
android.min_sdk_version=23
I would like to import the following Android library to make a CN1Lib (that requires at least Android SDK 23):
https://github.com/erikagtierrez/multiple-media-picker
To be short: I spent one day trying to import that, I also experimented with Android Studio and with suggestions found on Stack Overflow (trying to make a custom .aar), without success.
Could you help me to import that library? There is manifest merger error.
In fact, the issue reported by the build server is:
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute application#label value=(BareBones) from AndroidManifest.xml:15:17-42
is also present at [com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5] AndroidManifest.xml:23:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:15:3-43:103 to override.
I also tried to add the build hint:
android.xapplication_attr=tools:replace="android:label"
as suggested by the previous error, without success.
In the last case, I get:
Merging result: ERROR
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml:15:3-43:103 Error:
tools:replace specified at line:15 for attribute android:label, but no new value specified
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml Error:
Validation failed, exiting
-- Merging decision tree log ---
The last full log is here: https://gist.github.com/jsfan3/dd6c23f86a2ac949f996910c8cece62b
Thank you
This is happening because our code things you injected android:label on your own and doesn't inject it to avoid collision...
Change the code to this:
android.xapplication_attr=tools:replace="android:label" android:label="App Name"

Facebook native SDK conflicts with Parse4CN1 on Android

I'm currently having some trouble with an issue that was previously fixed through a build hint some time ago as you can see in the following thread:
https://groups.google.com/forum/#!searchin/codenameone-discussions/parse4cn1%7Csort:date/codenameone-discussions/4xipU9Sy5rY/IbX1YMmGBQAJ
I'm still keeping the build hint android.excludeBolts=true as well as the facebook.appId build hint set to my app id, but it now fails with the following error:
2019-03-19 00:35:44.832 9571-9571/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.guarumo.ego, PID: 9571
java.lang.NoClassDefFoundError: Failed resolution of: Lbolts/AppLinks;
at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155)
at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101)
at android.app.Application.dispatchActivityCreated(Application.java:208)
at android.app.Activity.onCreate(Activity.java:1110)
at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306)
at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53)
at android.app.Activity.performCreate(Activity.java:7383)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
at android.app.ActivityThread.-wrap12(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.ClassNotFoundException: Didn't find class "bolts.AppLinks" on path: DexPathList[[zip file "/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.guarumo.ego-nsZJW8Y8XXNjxF5pwA3RMQ==/lib/arm64, /system/lib64, /vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.facebook.appevents.internal.SourceApplicationInfo$Factory.create(SourceApplicationInfo.java:131)
at com.facebook.appevents.internal.ActivityLifecycleTracker.onActivityCreated(ActivityLifecycleTracker.java:155)
at com.facebook.appevents.internal.ActivityLifecycleTracker$1.onActivityCreated(ActivityLifecycleTracker.java:101)
at android.app.Application.dispatchActivityCreated(Application.java:208)
at android.app.Activity.onCreate(Activity.java:1110)
at com.codename1.impl.android.CodenameOneActivity.onCreate(CodenameOneActivity.java:306)
at com.guarumo.ego.EgoStub.onCreate(EgoStub.java:53)
at android.app.Activity.performCreate(Activity.java:7383)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3256)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
at android.app.ActivityThread.-wrap12(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
On the other hand, if I set the android.excludeBolts build hint to false I get the problem presented on the previously mentioned thread:
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AggregateException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/AndroidExecutors$UIThreadExecutor;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/BoltsExecutors$ImmediateExecutor;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationToken;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lbolts/CancellationTokenRegistration;
Dex: Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Translation has been interrupted
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:615)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:313)
at com.android.dx.command.dexer.Main.runDx(Main.java:291)
at com.android.dx.command.dexer.Main.main(Main.java:247)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:607)
... 4 more
:transformClassesWithDexForRelease FAILED
:transformClassesWithDexForRelease (Thread[Daemon worker,5,main]) completed. Took 22.043 secs.
I think this might be being caused by the change to a newer version of the Facebook SDK, but couldn't confirm it. Could you please help me out with this problem?
Thanks in advance.
I'm guessing this relates to the second answer in this question. This was caused because of this fix. As a temporary workaround you can probably set the SDK to the older/deprecated facebook SDK with the build hint: android.facebookSdkVersion=4.7.0.
To property fix this problem (if that answer is indeed correct) you will need to add parse bolts to the build hints:
android.gradleDep=compile 'com.parse.bolts:bolts-tasks:1.4.0'; compile 'com.parse.bolts:bolts-applinks:1.4.0';

Weblogic manage node not coming up

I am getting below error while starting one of the manage node in my cluster. There are around 6 manage node and the other 5 are coming up fine. However one node is giving below error. Can someone let me know where i need to look for the cause of this.
<Mar 3, 2017 9:26:10 AM CST> <Error> <Deployer> <WL-149231> <Unable to set the activation state to true for the application 'apsp-ear-trp'.
weblogic.application.ModuleException: Could not setup environment
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1516)
at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:444)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
Truncated. see log file for complete stacktrace
Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'UserManager' declared in the ejb-ref or ejb-local-ref 'ejb/UserManager' in the application module 'admin-tools.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:469)
at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:496)
at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3164)
at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1514)
Truncated. see log file for complete stacktrace
<Mar 3, 2017 9:26:10 AM CST> <Error> <Deployer> <WL-149250> <Unable to unprepare application 'apsp-ear-trp'.
java.lang.NoClassDefFoundError: org/hibernate/event/EventListeners$2
at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:656)
at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NoClassDefFoundError: org/hibernate/event/EventListeners$2
at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:656)
at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
Truncated. see log file for complete stacktrace

Resources