get archetype catalog failed(can't load Ahcwagon)-m2e-0.12.1 - m2eclipse

I'm trying to use m2eclipse api to import projects by archetype.
my code is here:
RemoteCatalogFactory remoteCatalogFactory = new RemoteCatalogFactory("http:/server1/archetype-catalog.xml", null, true);
ArchetypeCatalog catalog = remoteCatalogFactory.getArchetypeCatalog();
List<Archetype> archetypes = catalog.getArchetypes();
for (Archetype archetype : archetypes){
System.out.println(archetype.getArtifactId());
}
m2eclipse version is:0.12.1.
Got below exception:
1) Error injecting: org.sonatype.maven.wagon.AhcWagon
at ClassRealm[plexus.core, parent: null]
while locating org.apache.maven.wagon.Wagon annotated with #com.google.inject.name.Named(value=http)
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:958)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyQualifiedBean.getValue(LazyQualifiedBean.java:66)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:54)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:247)
... 38 more
Caused by: java.lang.TypeNotPresentException: Type org.sonatype.maven.wagon.AhcWagon not present
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:94)
at org.sonatype.guice.bean.reflect.NamedClass.load(NamedClass.java:46)
at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:949)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:995)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:945)
... 42 more
Caused by: java.lang.ClassNotFoundException: org.sonatype.maven.wagon.AhcWagon
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
at org.sonatype.guice.bean.reflect.URLClassSpace.loadClass(URLClassSpace.java:90)
During debug, I found bundleloader is using org.maven.ide.eclipse's bundle classloader to load AhcWagon class.
because maven embedder bundle haven't export AhcWagon's package, so can't load it.
But my question is: caller(plexus-classworlds.jar) is in maven embedder bundle and AhcWagon(in wagon-ahc.jar) is in the same bundle. Why not use maven embedder's bundle loader to load AhcWagon?
Am I something wrong to use this API?
That's great! If there is any sample code.
Regards
Simon

m2eclipse0.12.1's bug, need to export org.sonatype.maven.wagon in manifest.

Related

bootJar fails after upgrading to Gradle v7.6 (project is already evaluated)

I've updated Gradle to v7.6 and now the task bootJar does not work longer.
This is what I have configured in the past and what was working:
bootJar {
mainClass.set("com.dwiner.app.MainApplication")
from("$appDir/dist/angular/browser") {
into 'static'
}
}
bootJar.dependsOn 'npm_run_buildprod'
It seems that the dependsOn has some troubles now, as it the build keeps crashing with the following message:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':bootJar'.
...
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':npm_run_buildprod'.
...
Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type 'NpmTask'.
...
Caused by: org.gradle.api.InvalidUserCodeException: Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
Update:
It seems that the issue occurs when executing npm_run_buildprod and is not dependent on the dependsOn config.
Any help is appreciated.

Quarkus native and org.kohsuke:github-api - Failed to deserialize exception

I'm playing with Quarkus native and org.kohsuke:github-api:1.111 and I see Failed to deserialize exception in native mode when doing simple new GitHubBuilder().withOAuthToken(ghToken).build();. This works in JVM mode.
The main problem is probably the fact that org.kohsuke:github-api is not ready for native mode.
I still want to ask if there are any options to workaround this, maybe some jackson tricks for https://github.com/github-api/github-api/blob/master/src/main/java/org/kohsuke/github/GHMyself.java (stacktrace contains Cannot construct instance of org.kohsuke.github.GHMyself (no Creators, like default construct, exist)).
Exception details:
2020-05-05 10:47:06,891 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /hello failed, error id: a71018e5-de46-43a0-a194-80bd0b477f3d-1: org.jboss.resteasy.spi.UnhandledException: org.kohsuke.github.HttpException: Server returned HTTP response code: 200, message: '200 OK' for URL: https://api.github.com/user
...
Caused by: java.io.IOException: Failed to deserialize {"login":"rsvoboda","id":925259,"node_id":"MDQ6VXNlcjkyNTI1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/925259?v=4","gravatar_id":"","url":"https://api.github.com/users/rsvoboda","html_url":"https://github.com/rsvoboda","followers_url":"https://api.github.com/users/rsvoboda/followers","following_url":"https://api.github.com/users/rsvoboda/following{/other_user}","gists_url":"https://api.github.com/users/rsvoboda/gists{/gist_id}","starred_url":"https://api.github.com/users/rsvoboda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsvoboda/subscriptions","organizations_url":"https://api.github.com/users/rsvoboda/orgs","repos_url":"https://api.github.com/users/rsvoboda/repos","events_url":"https://api.github.com/users/rsvoboda/events{/privacy}","received_events_url":"https://api.github.com/users/rsvoboda/received_events","type":"User","site_admin":false,"name":"Rostislav Svoboda","company":"JBoss by Red Hat by IBM","blog":"https://twitter.com/r_svoboda","location":"Brno, Czech Republic","email":"rsvoboda#redhat.com","hireable":null,"bio":null,"public_repos":138,"public_gists":3,"followers":18,"following":2,"created_at":"2011-07-19T12:18:08Z","updated_at":"2020-04-29T14:38:31Z"}
at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:87)
at org.kohsuke.github.GitHubClient.lambda$fetch$0(GitHubClient.java:146)
at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:404)
at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:358)
... 37 more
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.kohsuke.github.GHMyself` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
at [Source: (String)"{"login":"rsvoboda","id":925259,"node_id":"MDQ6VXNlcjkyNTI1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/925259?v=4","gravatar_id":"","url":"https://api.github.com/users/rsvoboda","html_url":"https://github.com/rsvoboda","followers_url":"https://api.github.com/users/rsvoboda/followers","following_url":"https://api.github.com/users/rsvoboda/following{/other_user}","gists_url":"https://api.github.com/users/rsvoboda/gists{/gist_id}","starred_url":"https://api.github.com/users/rsvobod"[truncated 734 chars]; line: 1, column: 2]
at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1592)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1058)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1297)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)
at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:84)
Reproducer details:
generate the app - https://quarkus.io/guides/getting-started#bootstrapping-the-project
add dependencies and quarkus.native.enable-https-url-handler propery for native
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.111</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
...
<properties>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.native.enable-https-url-handler>true</quarkus.native.enable-https-url-handler>
</properties>
change GreetingResource
GitHub github = new GitHubBuilder().withOAuthToken(ghToken).build();
GHRepository ghRepo = github.getRepository("quarkusio/quarkus");
return ghRepo.toString();
drop .body(is("hello")) from GreetingResourceTest
run mvn clean verify -Dnative
You can also use #RegisterForReflection(targets = GHObject.class) on any of your classes
My guess is that you will need to register all the GHObject hierarchy for reflection using a ReflectiveHierarchyBuildItem.
So that requires an extension. It would be a useful addition for the Platform IMHO.
If you are running in native mode and getting the error is because of reflection to resolve the annotate your class with #RegisterForReflection also add a no-args constructor in your class then rebuild the application and run your error will be resolved.
for more reference see quarkus guide on the link

CDIIntegrationService errors were found when Weblogic upgrade from 12.1.2 to 12.1.3

I have upgraded Weblogic version in linux server by changing the wl_home path in the setDomainEnv.sh for 12.1.2 to 12.1.3 and restart. when restarting it gives below errors.
Appreciate if anyone can give idea about this.
java.lang.IllegalAccessError: tried to access method com.bea.logging.LogBufferHandler.bufferLogObject(Ljava/lang/Object;)V from class weblogic.logging.log4j.WLLog4jMemoryBufferAppender
java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.diagnostics.lifecycle.LoggingServerService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.diagnostics.lifecycle.DiagnosticFoundationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.diagnostics.lifecycle.DiagnosticFoundationService
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.oracle.injection.integration.CDIIntegrationService errors were found
java.lang.IllegalStateException: Unable to perform operation: resolve on com.oracle.injection.integration.CDIIntegrationService
Use the wllog4j.jar which is part of WLS 12.1.3 build. The one part of WLS_HOME/server/lib diretory.
If your domains-home/lib folder holds older wllog4.jar which was part of 12.1.2 then you will face this issue

My Firebase Authentication Dependency Issue

I added this line of code to my android Manifest in trying to add the Firebase Authentication Dependency:
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
}
apply plugin: 'com.google.gms.google-services'
And this is what the error I keep seeing when I sync the Gradle:
Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'ng.org.fafic.fafic'
How do I resolve this error, please?
Now, when I leave my gradle to be like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.google.firebase:firebase-auth:9.4.0'
}
My project will compile without any error. It will even allow me to use the Firebase classes for authentication. But when I try to run the app, the app crashes and I am left with this error:
Process: ng.org.fafic.fafic, PID: 24478
java.lang.RuntimeException: Unable to start activity ComponentInfo{ng.org.fafic.fafic/ng.org.fafic.fafic.RegisterActivity}: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2808)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2873)
at android.app.ActivityThread.access$900(ActivityThread.java:181)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6145)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.getInstance(Unknown Source)
at ng.org.fafic.fafic.RegisterActivity.onCreate(RegisterActivity.java:35)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2752)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2873) 
at android.app.ActivityThread.access$900(ActivityThread.java:181) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1482) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6145) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) 
> No matching client found for package name 'ng.org.fafic.fafic'
This error happens when the google-services.json is missing in your build.
Also check if the package_name in the google-services.json has a correct value according to your package name.
{
"project_info": {
},
"client": [
{
"client_info": {
"android_client_info": {
"package_name": "xxxxxxxxxx"
}
...
}
As i've seen from your replies with #Gabriele, Please check with me as the following.
First, Check if you've already downloaded the SDK for using Google Play Services/Firebase .
After checking, you need to add Google play services lib in your build.gradle app's level, and the firstbase, for me i used the messaging one too :
compile 'com.google.android.gms:play-services:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.0.1'
compile 'com.google.firebase:firebase-core:9.2.1'
And in the last line ( out of all brackets {} ), you need to add this :
apply plugin: 'com.google.gms.google-services'
Now, in your build.gradle Project's level, you need to add this inside 'dependencies' brackets
classpath 'com.google.gms:google-services:3.0.0'
the most important piece is your json file, download the json file and navigate to your project/your-app folder and paste it there, your app folder is the folder that contain files/folders like src/libs/build etc ..

Error while starting the Glassfish server + BIRT dependencies

I'm trying to deploy a Java web application on a GlassFish server (v 3.1.2) using Eclipse Indigo 3.7.1 but I'm always having this Exception:
cannot Deploy MetricsReportingProject
Deployment Error for module: MetricsReportingProject: Error occurred during deployment:
Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
java.lang.RuntimeException:
com.sun.faces.config.ConfigurationException:
java.util.concurrent.ExecutionException:
com.sun.faces.config.ConfigurationException:
Unable to parse document 'bundle://136.0:1/com/sun/faces/jsf-ri-runtime.xml':
DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.. Please see server.log for more details.
Here are my project's dependencies:
Hibernate 3.4.0 dependencies
BIRT DE and BIRT Viewer 3.7.1
JSF 2.0
PrimeFaces 3.2
The project was working when I'had created it but the problem appears after making some modifications and restarting the server many times.
Can anyone help me to solve this problem.
I hand the same problem.
Glassfish provides a
- xercesImpl-2.9.1.jar
- xml-apis-1.3.04.jar
But in the Birt Lib, they have xercesImpl-2.9.0.jar
I just deleted xercesImpl-2.9.0.jar from Birt Lib and redeployed. It worked fine.

Resources