javax.mdb package not found - jms

I'm triing to buld a MDB on jboss7.1.1, i have a maven project but the javax.jms package cann not be imported, I've puted the folowing dependency in the pom.xml
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1.1</version>
</dependency>
I have also this repo defined in the pom.xml
<repository>
<id>jboss-public-repository</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
<!-- These optional flags are designed to speed up your builds
by reducing remote server calls -->
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
In eclipse I get the rerror
ArtifactDescriptorException: Failed to read artifact descriptor for javax.jms:jms:jar:1.1:
ArtifactResolutionException: Failure to transfer javax.jms:jms:pom:1.1 from
http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact javax.jms:jms:pom:1.1 from/to central (http://repo.maven.apache.org/maven2):
Remotely Closed [id: 0x01c17b4c, /0:0:0:0:0:0:0:1:54960 :> repo.maven.apache.org/185.31.16.185:80] pom.xml /fourPMOperations-ejb line 1 Maven Dependency Problem
Any hints? It must be some config problem.

I have found the solution I've inclouded this dependency in pom:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>

Related

Repository Version Policy : ignore missing poms?

Having looked at this some more I realise
The thing that confuses me is that maven is searching the repo for this file and not finding it. I don’t understand why a different local repo (one of 6 listed repos in the POM file) should be a problem.
My assumption is that the problem comes in the Version Policy of the repository being Release. This is surely what the error implies but the old repository also had a policy of release and anyway I’m not storing the snapshot on there is is only looking for it as it is the dependency of a dependency stored on Maven Central that isn’t found.
Is there a way I can either change the policy to allow it to be searched for snapshots or stop maven from searching this repo for snapshots ?
We have moved our internal repo from on server to another and upgraded it to 3.12.1-01 from 2.14.9-01.
We have migrated the artifacts over using the agent. I have built a couple of simple projects using the new repo and all seems well.
However on one app I am getting this error
[INFO] ------------------------------------------------------------------------
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b06-SNAPSHOT/javax.el-3.0.1-b06-SNAPSHOT.pom
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b07-SNAPSHOT/javax.el-3.0.1-b07-SNAPSHOT.pom
Downloading: http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b08-SNAPSHOT/javax.el-3.0.1-b08-SNAPSHOT.pom
...
[INFO] -----------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project :
Could not resolve dependencies for project :
Failed to collect dependencies at org.eclipse.jetty:jetty-
jsp:jar:9.2.19.v20160908 -> org.glassfish.web:javax.servlet.jsp:jar:2.3.2 ->
org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT:
Failed to read artifact descriptor for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT:
Could not transfer artifact org.glassfish:javax.el:pom:3.0.1-b06-SNAPSHOT from/to releases.new
(http://reposerver:8081/repository/releases/): Failed to transfer file:
http://reposerver:8081/repository/releases/org/glassfish/javax.el/3.0.1-b06-SNAPSHOT/javax.el-3.0.1-b06-SNAPSHOT.pom.
Return code is: 400 , ReasonPhrase:Repository version policy: RELEASE does
not allow version: 3.0.1-b06-SNAPSHOT. -> [Help 1]
If I point back to the old repo I don't have a problem at all. I had a quick go trying to change jetty versions and exclude javax.el to just avoid using the snapshot dependency and get the project to build but I can't seem to easily do this without causing catastrophic build failures.
Checking again I have missed this ongoing warning when using the old repositorty
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b07-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.glassfish:javax.el:jar:3.0.1-b08-SNAPSHOT is missing, no dependency information available
I have tried adding this repo which seems to have the snapshot
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
but this makes no difference.
As I understand it maven is trying all repos to recursively find all dependencies and as my local repo is last it is reporting the error after checking my local repo. The error about snapshot policies is a false message and the issue is it can't find the POM for the javax-el jar and so can't continue looking for dependencies. I don't understand why it iognores after looking at one repo and fails when it is instructed to look at another ?
The only difference between success an failure at my end is
Success:
<repository>
<id>releases</id>
<name>App Repository</name>
<url>http://oldserver:8081/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshots</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
FAILURE
<repository>
<id>releases</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
<repository>
<id>snapshots</id>
<name>App Repository</name>
<url>http://newserver:8081/repository/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Is this a setting on the new nexus repository ? At the moment I'm hoping for a simple like for like fix but if you think I need to change the dependencies I'm calling then that's fine
Jetty dependencies called
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>9.0.6.v20130930</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>apache-jstl</artifactId>
<version>9.2.19.v20160908</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.2.19.v20160908</version>
</dependency>
Okay I haven't found an answer for why the versions of Nexus seem to act differently (this my be my misunderstanding of the root cause!)
I have fixed it with a simple pom mod (which I thought I had tried before but I must have gone round in some silly circles)
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp</artifactId>
<version>9.2.19.v20160908</version>
<exclusions>
<exclusion>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.el -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
</dependency>

spring-security-saml missing jar in repo

As per the instructions on http://projects.spring.io/spring-security-saml/, I have the following in my pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml</artifactId>
<version>1.0.0.RC2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
When I execute mvn clean install -U, I receive the following error:
[ERROR] Failed to execute goal on project myproj: Could not resolve dependencies
for project com.acme.myproj:myproj:war:1.0.0-SNAPSHOT: Could not find artifact org.
springframework.security.extensions:spring-security-saml:jar:1.0.0.RC2 in spring
-milestones (http://repo.spring.io/milestone) -> [Help 1]
The repo is there at http://repo.spring.io/milestone/org/springframework/security/extensions/spring-security-saml/1.0.0.RC2/, but there is no .jar file.
The correct dependency to use is:
<dependency>
<groupId>org.springframework.security.extensions</groupId>
<artifactId>spring-security-saml2-core</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>
The jar is available both in Maven Central and http://repo.spring.io/list/release/
The Spring SAML web will get fixed soon.

Maven build error because of an unresolved Maven POM property used in repository URL when specifying Spring's bill-of-material POM

I'm facing a reproducible strange behavior when referencing a Maven POM property in the POM's repositories section and having a bill of materials POM (here Spring-Framework-BOM) defined.
Setup to reproduce the problem:
Maven 3.0.5, JDK 1.7.0.51.x86_64
Maven POM with a property that holds my Nexus-URL prefix
that property is referenced in the pluginRepositories and repositories section
additionally having spring-framework-bom dependency in dependencyManagement section defined
The build error occurring in the log:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:4.0.3.RELEASE from/to mycompany.public (${nexus.baseUrl}/content/groups/public/): No connector available to access repository mycompany.public (${nexus.baseUrl}/content/groups/public/) of type default using the available factories WagonRepositoryConnectorFactory # line 692, column 16
Here the excerpt from my Maven POM file:
<properties>
<nexus.baseUrl>http://nexus.mycompanydomain.com</nexus.baseUrl>
<spring.version>4.0.3.RELEASE</spring.version>
</properties>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<url>${nexus.baseUrl}/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>mycompany.public</id>
<name>MyCompany Public Repository</name>
<url>${nexus.baseUrl}/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Hotfix
I could solve the problem by replacing the nexus.baseUrl by it's value in the repositories section of the POM:
<repository>
<id>mycompany.public</id>
<name>MyCompany Public Repository</name>
<url>http://nexus.mycompanydomain.com/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Question
Is anyone able to explain why the resolution of the nexus.baseUrl property is not taking place while the spring.version property is resolved successfully (see error log)?
IMHO the the problem lies in the order of evaluation of the pom.
Properties, like in your case, the property "nexus.baseUrl" are not getting evaluated before the import scope is getting triggered.
In my case, replacing property reference (nexus.baseUrl) in the repository url element with the concrete url solved the problem.

Maven uses wrong repository to lookup dependencies

In my settings.xml I declared a custom repository in a profile like this:
<servers>
<server>
<id>server.id</id>
<username><uname></username>
<password><pw></password>
</server>
</servers>
<profiles>
<profile>
<id>dev.id</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>repo.id</id>
<url>valid working url</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
what works great for all dependencies located there, but build fails whenever I declare dependencies which are located in the central repository. For instance:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
results in:
[ERROR] Failed to execute goal on project <name>: Could not resolve dependencies for project…
…Failed to read artifact descriptor for junit:junit-dep:jar:4.9.1-SNAPSHOT: Could not transfer artifact junit:junit-dep:pom:4.9.1-SNAPSHOT from/to <server.id>…
How can I make maven load dependencies correctly?
You are trying to use a -SNAPSHOT dependency which is not available in Maven Central.
junit:junit-dep:jar:4.9.1-SNAPSHOT: Could not transfer artifact junit:junit-dep:pom:4.9.1-SNAPSHOT fr
In Maven central there are only releases available.
Furthermore the above dependency is not coming into your build by the junit:junit:4.11:jar dependency it must be comming from other sources.

Apache Airavata dependency in Maven

I'm building a Java application which has a dependency on the Apache Airavata project. I can get it up and running by putting all dependency jar's on the classpath but I have problems setting up the project using Maven.
Problem seems to be some maven repositories are not available. I tried this a couple of months ago with the same result.
Update
I got an answer on the Airavata mailing list that they were aware of the problem, that they supposedly had fixed it and are planning to work away away the dependency. Still, the server does not seem to work:
http://markmail.org/search/+list:org.apache.airavata.users#query:%20list%3Aorg.apache.airavata.users+page:1+mid:y37nleni7hocoftg+state:results
Anyhow, I have now realized that I should use airavata-messenger-client, and that is possible to use with maven with the following dependencies:
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-messenger-client</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-messenger-commons</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.6.2</version>
</dependency>
Error message
The container 'Maven Dependencies' references non existing library '[hidden]\.m2\repository\org\apache\airavata\airavata-message-broker\0.5\airavata-message-broker-0.5.jar'
[ERROR] [..] Failed to collect dependencies for [org.apache.airavata:airavata-message-broker:jar:0.5 (compile)]:
Failed to read artifact descriptor for xmlbeans:xbean:jar:2.5.0:
Could not transfer artifact xmlbeans:xbean:pom:2.5.0 from/to ogce.m2.all (http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all):
Connection to http://community.ucs.indiana.edu:9090 refused:
Connection refused: connect
pom.xml
<repositories>
<repository>
<id>repository.apache.org-public</id>
<name>Apache</name>
<url>http://repository.apache.org/content/groups/public</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-message-broker</artifactId>
<version>0.5</version>
</dependency>
</dependencies>
Airavata has some third party jars pulled from a repo. Please copy paste the following two repos to your pom and see if the problem goes
<repository>
<id>central</id>
<name>Maven Central</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<name>ogce.m2.all</name>
<id>ogce.m2.all</id>
<url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
</repository>

Resources