how to ignore ivy revision number? - ivy

I have certain jar files without revision number. But as rev is mandatory attribute for ivy dependency, I am providing the revision attribute. But I have something like (-[revision]) in url resolver.
But its taking the module number instead of ignoring the revision attribute. I know it won't ignore the revision attribute as its not null.
Following is the output that i get
default-cache: no cached resolved revision for perltools#perltools;latest.integration
[ivy:retrieve] tried httP://myrepo/ivyRepository/perltools/jars/[revision]/perltools-[revision].jar
[ivy:retrieve] listing all in httP://myrepo/ivyRepository/perltools/jars/[revision]/perltools-[revision].jar
[ivy:retrieve] using privateRepo to list all in httP://myrepo/ivyRepository/perltools/jars/
[ivy:retrieve] ApacheURLLister found URL=[httP://myrepo/ivyRepository/perltools/jars/perltools.jar].
[ivy:retrieve] found 1 resources
[ivy:retrieve] found revs: [perltools.jar]
[ivy:retrieve] HTTP response status: 404 url=httP://myrepo/ivyRepository/perltools/jars/perltools.jar/perltools-perltools.jar.jar
[ivy:retrieve] CLIENT ERROR: Not Found url=httP://myrepo/ivyRepository/perltools/jars/perltools.jar/perltools-perltools.jar.jar
Can somebody please explain why its taking module.ext as revision where revision I specified is latest.integration and in myrepo,Ii dont have revision attribute.
It just has
[http://myrepo/ivyRepository/perltools/jars//perltools.jar]
Can somebody please help me so that I can avoid revision attribute?

In order to ignore the revision and download a ZIP from a Jenkins server, I use a resolver (in ivysettings.xml) like
<url name="jenkins" m2compatible="true" checksums="">
<artifact pattern="http://jenkins:8080/job/[organization]/ws/sources/[module]/*[ext]*/[artifact].[ext]" />
</url>
and a dependency (in ivy.xml) like
<dependency org="source-build" name="project" rev="+">
<artifact name="project" type="zip" />
</dependency>
So I'm using + for the revision as latest.release just did not resolve correctly and an empty string (rev="") worked but left the artifact with a trailing dash in the local cache, which I disliked.
Note that I also had to disable checksums in the resolver definition due to a bug in Ivy.

Can you just use "latest.integration" as the revision?

Related

java.lang.NoClassDefFoundError: Could not initialize class org.apache.pdfbox.pdmodel.font.PDFont

I am using Apache Tika( tika-app 1.17) in wildfly modules.
While I start extracting PDF it always throws the error:
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.pdfbox.pdmodel.font.PDFont
For other file extensions it works fine.
Things I have tried out dependencies in apache-tika module.xml to PDFbox
Explicitly loaded org.apache.pdfbox from standalone.xml
I have also tried with the below structure
app1.war->(WEB-INF)lib-->app.jar->lib-->tika-app-1.17.jar
I have also jboss-deployment-structure.xml where
<dependencies>
<module name="com.company.tika" />
</dependencies>
is mentioned as a module dependency.
In MANIFEST.MF of the jar also, I have dependency to com.company.tika
Nothing seems to work.
Any suggestions or help would be thankful.
Thanks in Advance
Dwai
I could resolve the issue. The problem was the minor version of pdfbox, fontbox and jempbox were not the same. Hence the PDFFont was not initialized, because internally it needs to load the classes of fontbox also and probably there was a mismatch in the version id of the classes
setting SOLR_JAVA_STACK_SIZE='-Xss256M' only and not making any changes to libs solved this issue for me
I had similar problem.
Under linux i just install missing library pdfbox by:
apt-get install libpdfbox-java
and restart solr server
After this modification i need to change solr start parameter in ./bin/solr
from
SOLR_JAVA_STACK_SIZE='-Xss256kb'
to
SOLR_JAVA_STACK_SIZE='-Xss256M'
because i had error
java.lang.StackOverflowErrorjava.lang.RuntimeException: java.lang.StackOverflowError
of course i restart solr server again.
I hope, it help you reolve this problem.

java.lang.NoSuchMethodError: org.apache.xml.security.encryption.XMLCipher.martial(Document;ReferenceList;)

I m trying to encrypt my XMl with this call:
XMlCipher.martial(Document context,ReferenceList referenceList)
for this the Project is referencing the xmlsec-1.5.3.jar
I'm able to build and deploy the code successfully on weblogic server , but post execution I'm getting the below error in logs.
Caused by: java.lang.NoSuchMethodError:
org.apache.xml.security.encryption.XMLCipher.martial(Lorg/w3c/dom/Document;Lorg/apache/xml/security/encryption/ReferenceList;)Lorg/w3c/dom/Element;
at com.ally.util.encryption.EncryptionUtil.generateEncryptedXML(EncryptionUtil.java:381)
at com.ally.util.encryption.EncryptionUtil.getEnryptedXMLDocument(EncryptionUtil.java:443)
at com.ally.partner.fis.acctinq.FISSoapHandler.getFISEncryptedHeader(FISSoapHandler.java:154)
This kind of error is ALWAYS caused by having more than one reference of the XMlCipher on your classpath. It could be a duplicate xmlsec.jar or another instance of the XMlCipher in a different jar.
You have a few options to debug the problem:
Edit your war file to remove the duplicate jar and/or different version of the XMlCipher class
Connect to your weblogic managed server with jconsole and look at the classpath. See if you notice another instance of the xmlsec.jar being included
You may need to tell weblogic to prefer the instance of the class that lives within your .war/.ear file by specifying the following in your weblogic.xml:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.apache.xml.security.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
See the docs for more details and similar questions like: Weblogic 10.3.1.0 is using com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar... I want to use commons-net-2.0.jar from my code
I realize you didn't mention the use of Maven or SoapUI, but I was receiving a similar exception (java.lang.NoSuchMethodError: org.apache.xml.security.encryption.XMLCipher.setSecureValidation) when attempting to use the soapui-maven-plugin and wanted to post my solution to hopefully help.
The fix for me was to add an xml-security dependency to the soapui-maven-plugin inside the pom.xml like so:
<!-- To run, enter this command from the module directory: mvn soapui:test -->
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.1</version>
<dependencies>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.2</version>
</dependency>
</dependencies>
<configuration>
<projectFile>src/test/soap-ui/your-soapui-xml-file.xml</projectFile>
</configuration>
</plugin>
</plugins>
In my case, I didn't have an xml security dependency anywhere else in my project.
In other cases, it seems like some may be experiencing this error due to having multiple xml security dependencies throughout their project (and they are conflicting, like one answer is already alluding to). So, if the above fix doesn't work for you in that scenario, you may need to look into which dependencies in your project are including xml security and deciding which one you want to include and which one you want to exclude (e.g. using Maven's exclusion or provided scope markings in the given pom).

Liquibase 3.2 not finding dbchangelog-3.2.xsd

Running version 3.2 I am getting an error
[WARN] liquibase - schema_reference.4: Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .
When I look for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd it is not there, although http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is.
I came accross this https://liquibase.jira.com/browse/CORE-1840, which I interpret to say you dont need access to the internet to get dbchangelog-3.2.xsd. It doesnt seem to help when the internet is available but the .xsd is not there.
I have reverted back to 3.1 but would like to know the root cause of my 3.2 problem.
Updating the liquibase version to the latest solved my problem
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.3</version>
</dependency>
I solved it by distributing the schema with my application and referring to it locally (relative path). In the example below I have the schema file in the same folder as the changelog.
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog-3.1.xsd">
<!-- all the things -->
</databaseChangeLog>
Liquibase does not looking for xsd in Internet. http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd will be replaced to path to java recources
More detailed info can be find here
I fixed the issue following what found here.
The solution works only for the one using maven-liquibase-plugin.
You have to run liquibase migration with the following option -Dprefer.internal.xsd=true:
mvn -Dprefer.internal.xsd=true liquibase:update
Check your changlog.xml file headers having xsd document version.
If it doesn't match it will during spring boot:run

maven 3.1.0 compile does not use proxy username

Running on Windows XP, I set up my ~/.m2/settings.xml to include the following proxy settings:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>davidho</username>
<password>mypassword</password>
<host>192.168.0.35</host>
<port>3128</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
mvn archetype:generate then worked great, downloading all the required files and succeeding.
But then I tried
mvn compile
and got:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http.//repo.maven.apache.org/maven2): Error transferring file: Server returned HTTP response code: 407 for URL: http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom from http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom with proxyInfo ProxyInfo{host='192.168.0.35', userName='null', port=3128, type='http', nonProxyHosts='null'}
Huh ?! Why does it say userName='null' when I have specified a username and password in my
settings.xml ?
I then tried:
mvn compile -Dhttp.proxyUser=davidho -Dhttp.proxyPassword=mypassword
and it made no difference - it still said userName='null'
How can I fix this thanks ?
n.b. stackoverflow forced me to change the "http:" in the error message to "http."
Same here, using parameters on the cmd line or in the settings file.
There are few things you need to check!
if you are using IDE then you might be facing issues with Embedded maven installation which is by default value and you can get it resolved by changing maven installation. try this answer.
if you are behind NTLM windows proxy you need to use CNTLM software to get you authenticated which is batter described in this answer.if you are using IDE please change installation as described in first point.

Cannot find message resources under key org.apache.struts.action.MESSAGE in struts

I am getting the following error in the browser window :
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
I have included the resource file in the struts-config.xml using
And my resource file is stored as WEB-INF/classes/Application.properties file.
Well this is an old post, but my answer can help, I guess...
I personally wasted some time to make work a poject that had been developped under Tomcat 5.5 under Tomcat 7.
Note : You should name your ressource file : "ApplicationResources"...
There is several reasons why it wouldn't work, but the most common answer I found on the net was : put the line
<message-resources parameter="ApplicationResources" null="false" />
in your "struts-config.xml".
In my case, this line was already present, and this was the contrary : I had to remove it and replace at the "web.xml" file level by :
<context-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</context-param>
in the "servlet" tag.
I'm sorry that I don't have a valuable explanation for this, but my application behaves just fine now.
Does anyone has (an explanation) ?
This happened to me because I was converting my project to maven and my resources directory was not correct.
I had struts-config.xml like this:
<message-resources parameter="messages.appResources" null="false"/>
My pom.xml was like this:
<resource>
<directory>src/main/resources</directory>
</resource>
But my messages folder was in my project root. So I moved it to:
${project.basedir}/src/main/resources/messages
Make sur that you are using the same version of the DTD in the header of struts-config.xml:
I had this error when using two differents versions:
//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">
and the Pb was solved once the correction made:
An XML might be missing...
In which context is your application running ? Tomcat ? JBoss ?
Try including xalan and xerces dependencies.
The following solved my problem:
In Struts Config, include:
(At the top)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">
<message-resources
parameter="common.properties.Common" /> (or the path to your resources file)
This error seems to be caused by a lack of a path to message-resource in struts-config.xml
and the DOCTYPE definition at the top of the same.
you should put this line in your struts-config.xml
< message-resources parameter="ApplicationResources" null="false" key="ApplicationResources" />
In my case problem was fixed after delete all unnecessary attributes from message-resources element in struts-config.xml file. Just like following:
<message-resources parameter="ApplicationResources"/>