i am trying to deploy struts 1.3 based application using maven.
I want to add Struts-Layout.jar entry in pom.xml.
after goggling i got this answer to add following entry in pom.xml:
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>Struts-Layout</artifactId>
<version>1.3</version>
</dependency>
But it gives this error :
[ERROR] Failed to execute goal on project sample: Could not resolve depe
ndencies for project com.sample.cms:sample:war:1.1.32: Failure to find o
rg.apache.struts:Struts-Layout:jar:1.3 in http://maven.springframework.org/exter
nal was cached in the local repository, resolution will not be reattempted until
the update interval of spring-maven-external has elapsed or updates are forced
version of maven is Maven 3.0.3
How to solve this problem?
See http://bug.improve-community.com/view.php?id=160. It seems that this library is not deployed on any public maven repo. You'll have to download it and add it to your own private repository.
Related
I keep getting:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.conn.ssl.SSLConnectionSocketFactory.<init>(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V
at com.amazonaws.http.conn.ssl.SdkTLSSocketFactory.<init>(SdkTLSSocketFactory.java:56)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.getPreferredSocketFactory(ApacheConnectionManagerFactory.java:87)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:65)
at com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory.create(ApacheConnectionManagerFactory.java:58)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:50)
at com.amazonaws.http.apache.client.impl.ApacheHttpClientFactory.create(ApacheHttpClientFactory.java:38)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:253)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:145)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:136)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:121)
at com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceClient.<init>(AmazonElasticMapReduceClient.java:175)
at com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceClient.<init>(AmazonElasticMapReduceClient.java:155)
at ExtractRelatedPairs.main(ExtractRelatedPairs.java:30)
Visual description which illustrates all the added jars (on the left) and their version for inspection.
Despite the fact that all needed jars are added, tried all the different jars and versions, even tried to change project's settings to work with 1.6 1.7 instead of 1.8...
Any ideas?
Assuming your project is built with Maven, adding this to your pom.xml should take care of that issue:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
My maven builds are fine and able to run groovy from cli. However if I try to run my groovy class inside IntelliJ Idea (version 15 community edition), its gives me below error.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:61)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
at groovy.lang.Closure.<init>(Closure.java:219)
at groovy.lang.Closure.<init>(Closure.java:236)
at groovy.lang.Closure$1.<init>(Closure.java:203)
at groovy.lang.Closure.<clinit>(Closure.java:203)
at filter.App.<clinit>(App.groovy)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.9 and you are trying to load version 2.4.5
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:77)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:71)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:53)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:110)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
... 10 more
Not sure how to get rid of this.
This is my pom dependency.
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.5</version>
</dependency>
And I am using spring boot.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
<relativePath></relativePath>
</parent>
This is my groovy version installed in system.
Groovy Version: 2.4.5 JVM: 1.8.0_60 Vendor: Oracle Corporation OS: Linux
Please let me know if someone knows about this.
you have to delete groovy lib from project settings.
shift+alt+ctrl + s, global libraries - delete groovy. And when trying to run applictaion / test you should have point to groovy from maven dependencies.
#SuperAndrew's suggestion wasn't my situation -- I didn't have Groovy registered under Global Libraries under my Project Structure. But I did find this StackExchange solution resolved my issue. Add this code to your build.gradle file.
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:2.4.4'
}
}
I was seeing this in a recent project after I upgraded Gradle to 7.+
The reason this was causing a problem for me was that Gradle 7.+ is now using Groovy 3.+ and as such various other plugins needed to be upgraded (e.g. spock-core).
It was this incompatibility of various dependencies that were causing this and once I updated all of them this issue went away.
I am trying to create a connector in Mule Studio 3.4 using Devkit 3.3.2.
The following is a maven (3.0.2) command which I used to generate the project structure:
$ mvn archetype:generate -DarchetypeGroupId=org.mule.tools.devkit
-DarchetypeArtifactId=mule-devkit-archetype-cloud-connector
-DarchetypeVersion=3.4.0 -DgroupId=org.hello -DartifactId=hello-connector
-Dversion=1.0-SNAPSHOT -DmuleVersion=3.4.1
-DmuleConnectorName=Hello -Dpackage=org.hello
-DarchetypeRepository=http://repository.mulesoft.org/releases
after this, I did:
"mvn clean package -Ddevkit.studio.package.skip=false -DskipTests"
This gave some errors in Studio that seem related to devkit 3.4.0, therefore decided to change the Mule/Devkit version from 3.4.0 to 3.3.2 in the pom.xml:
<mule.version>3.3.2</mule.version>
<mule.devkit.version>3.3.2</mule.devkit.version>
The following two errors are shown in Studio:
"The project was not built since its build path is incomplete. Cannot
find the class file for org.eclipse.core.runtime.CoreException. Fix
the build path then try building this
project aria-connector Unknown Java Problem"
and
"The type org.eclipse.core.runtime.CoreException cannot be resolved.
It is indirectly referenced from required .class
files AriaActivator.java /aria-connector/target/generated-sources/mule/org/mule/tooling/ui/contribution line
1 Java Problem"
My environment is Mac OS X 10.8.4 (error appears in Windows 7 too), Mule Studio 3.4.0, java version "1.6.0_51".
Has anybody encountered a similar issue or have an idea how to resolve this please?
Thanks
Add:
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>common</artifactId>
<version>3.3.0-v20070426</version>
<scope>provided</scope>
</dependency>
to your POM.
I found net.sf.json-lib in the central repository. Copy-pasted the dependency (with version 2.3), and then when I build I get this error:
[INFO] Unable to find resource 'net.sf.json-lib:json-lib:jar:2.2.3' in repository central (http://repo1.maven.org/maven2)
[ERROR] BUILD ERROR
[INFO] ---------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) net.sf.json-lib:json-lib:jar:2.3
Try downloading the file manually from the project website.
I tried using version 2.2.3, but I'm getting the same error. Why am I getting this error? I can override it by installing it locally, but I want to understand what the problem is.
Edit - I deleted the package from my local repository, and tried again, this time getting a checksum error. I guess I should file a bug report with json-lib.
[WARNING] *** CHECKSUM FAILED - Error retrieving checksum file for net/sf/json-lib/json-lib/2.3/json
-lib-2.3.pom - IGNORING
Looking at the maven-central repo, you need to specify a classifier for this dependency.
Either jdk13 or jdk15, like this:
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
For gradle as sample
compile 'net.sf.json-lib:json-lib:2.4:jdk15'
OR
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.4', classifier: 'jdk15'
I searched for more classifier's could not find anything other than jdk15 (don't go looking or jdk16 or jdk17)
Barring khimarbaise's comment about trustworthiness, you can install it locally using maven install:
http://maven.apache.org/plugins/maven-install-plugin/examples/specific-local-repo.html
mvn install:install-file -Dfile=path-to-your-artifact-jar
-DgroupId=your.groupId
-DartifactId=your-artifactId
-Dversion=version
-Dpackaging=jar
-DlocalRepositoryPath=path-to-specific-local-repo
For ivy users, after trying many different iterations to configure my ivy.xml to properly find this dependency, this finally worked for me:
<dependency org="net.sf.json-lib" name="json-lib" rev="2.4">
<artifact name="json-lib" url="http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar"/>
</dependency>
Update
As of Hudson Findbugs plug-in version 4.3 this is no longer an issue
End Update
As an example of my problem, I'm trying to build the following project http://www.sonatype.com/books/mvnex-book/reference/multimodule.html
I added the following to simple-parent/pom.xml
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<xmlOutput>true</xmlOutput>
</configuration>
</plugin>
</plugins>
</reporting>
And the following to simple-weather/pom.xml and simple-webapp/pom.xml
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</reporting>
I inserted the following horrible equals method into one of the classes to have FindBugs generate some issues (as there is no error on 0 bugs):
public boolean equals(Object o) { return true; }
I'm using Hudson with a maven2 style project. The job is aimed at the simple-parent pom with the goals
clean site
I get the following exception:
[INFO] Generating "FindBugs Report" report.
[java] Warnings generated: 2
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot inherit from final class
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:370)
at sun.reflect.GeneratedMethodAccessor594.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Version info:
Maven 2.2.1
Java 1.5.0_22
Hudson 1.341 (also found on 1.339) running inside JBoss 4.0.5.GA (same error on 4.2.2.GA and 5.1.0.GA)
Maven FindBugs plugin 2.3
Hudson FindBugs plugin 4.1
Any ideas on how to fix this?
According to the FindBugs FAQ, this problem occurs when the wrong version of Apache BCEL is being used (see Q2: When I click the "Find Bugs!" button, I get a NoSuchMethodError or VerifyError). In your case, I suspect that the maven-findbugs-plugin is getting the BCEL library from JBoss because of some obscure classloading issue. There are some very similar bugs in Hudson's Jira, e.g. HUDSON-5134 (the hudson findbugs plugin is also affected).
My understanding is that this problem has been introduced recently (in v1.338) and, even if there is a workaround, it is an Hudson bug (it is a regression, it's not a problem with JBoss).
Now, you have IMO two solutions:
Use a version of Hudson anterior to v1.338 (the regression was reported for this version) but using an old version and sticking with it is certainly not really a viable solution.
Remove or replace the bcel.jar of JBoss (in server/SERVERNAME/lib) with the version used by the maven-findbugs-plugin (see dependencies). I'm not able to say how this will affect JBoss exactly (If you remove it, it seems that you will loose the ability to run JBoss in debug-mode but I can't say if everything will work fine if you replace it).
Whatever you'll do, please create a new Jira issue (http://issues.hudson-ci.org/) as this is a regression in Hudson. They have marked HUDSON-5134 as "Won't fix" because there is a workaround but I don't think that messing with JBoss libraries is a good solution (I'm repeating myself but this is a Hudson bug). So, insisting and letting Hudson developers know that other users are affected by this problem will help all the entire community (at least, I hope so).
The other answers provided are better, but one alternative to add: use Ant or batch file to create a separate build step that doesn't care that the FindBugs step failed. The Hudson plug-in can still be used to display the results.
As Pascal points out, there is a similar bug filed - HUDSON-5134 - and that bug indicates the behavior started with Hudson release 1.338. Since Hudson releases once a week, it can be difficult to pin down which version introduced a bug. I notice there was a classloader related change released with Hudson version 1.337 (HUDSON-5048), and I suspect that is causing the problem here, but I don't have direct evidence of that.
But that likely means you need to roll back to 1.337 or earlier to avoid this problem.