<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>btaz &#187; Logging</title>
	<atom:link href="http://www.btaz.com/category/java/logging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.btaz.com</link>
	<description>Promoting the art of coding</description>
	<lastBuildDate>Fri, 16 Jul 2010 17:01:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Maven, Log4j and javax.jms</title>
		<link>http://www.btaz.com/java/maven-log4j-and-javax-jms/</link>
		<comments>http://www.btaz.com/java/maven-log4j-and-javax-jms/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:37:50 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[jar files]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[jmx]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[pom.xml]]></category>
		<category><![CDATA[unable to find resource]]></category>

		<guid isPermaLink="false">http://www.btaz.com/?p=59</guid>
		<description><![CDATA[Log4j version 1.2.15 added features which has new dependencies on sun and javax packages. When you try to build your project using Maven and log4j 1.2.15 you will see this:
[INFO] Unable to find resource 'com.sun.jmx:jmxri:jar:1.2.1' in repository central (http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'com.sun.jdmk:jmxtools:jar:1.2.1' in repository central (http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'javax.jms:jms:jar:1.1' in repository [...]


Related posts:<ol><li><a href='http://www.btaz.com/java/want-to-use-spring-3-0-milestone-release-from-maven/' rel='bookmark' title='Permanent Link: Want to use Spring 3.0 milestone release from Maven?'>Want to use Spring 3.0 milestone release from Maven?</a></li>
<li><a href='http://www.btaz.com/java/how-to-find-project-dependencies-in-a-maven-project/' rel='bookmark' title='Permanent Link: How to find project dependencies in a Maven project'>How to find project dependencies in a Maven project</a></li>
<li><a href='http://www.btaz.com/java/maven/18/' rel='bookmark' title='Permanent Link: Maven pom.xml structure'>Maven pom.xml structure</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Log4j version 1.2.15 added features which has new dependencies on sun and javax packages. When you try to build your project using Maven and log4j 1.2.15 you will see this:</p>
<pre>[INFO] Unable to find resource 'com.sun.jmx:jmxri:jar:1.2.1' in repository central (http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'com.sun.jdmk:jmxtools:jar:1.2.1' in repository central (http://repo1.maven.org/maven2)
[INFO] Unable to find resource 'javax.jms:jms:jar:1.1' in repository central (http://repo1.maven.org/maven2)</pre>
<p>These packages are not in the Maven repositories due to licensing issues. There are two simple solutions to this problem. You can either modify your pom.xml file to use the previous version of log4j (log4j 1.2.14) which doesn&#8217;t depend on the JMX and JMS packages:</p>
<pre>&lt;dependency&gt;
    &lt;groupId&gt;log4j&lt;/groupId&gt;
    &lt;artifactId&gt;log4j&lt;/artifactId&gt;
    &lt;version&gt;1.2.14&lt;/version&gt;
&lt;/dependency&gt;</pre>
<p>Or you can exclude the dependencies with the caveat that some of the lo4gj appenders  that depend on these packages wont be available</p>
<pre>&lt;dependency&gt;
    &lt;groupId&gt;log4j&lt;/groupId&gt;
    &lt;artifactId&gt;log4j&lt;/artifactId&gt;
    &lt;version&gt;1.2.15&lt;/version&gt;
    &lt;exclusions&gt;
        &lt;!--
        These packages are not in the Maven repository
        If you do this certain log4j appenders will not be available
        --&gt;
        &lt;exclusion&gt;
            &lt;groupId&gt;javax.jms&lt;/groupId&gt;
            &lt;artifactId&gt;jms&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
            &lt;groupId&gt;com.sun.jdmk&lt;/groupId&gt;
            &lt;artifactId&gt;jmxtools&lt;/artifactId&gt;
        &lt;/exclusion&gt;
        &lt;exclusion&gt;
            &lt;groupId&gt;com.sun.jmx&lt;/groupId&gt;
            &lt;artifactId&gt;jmxri&lt;/artifactId&gt;
        &lt;/exclusion&gt;
    &lt;/exclusions&gt;
&lt;/dependency&gt;</pre>


<p>Related posts:<ol><li><a href='http://www.btaz.com/java/want-to-use-spring-3-0-milestone-release-from-maven/' rel='bookmark' title='Permanent Link: Want to use Spring 3.0 milestone release from Maven?'>Want to use Spring 3.0 milestone release from Maven?</a></li>
<li><a href='http://www.btaz.com/java/how-to-find-project-dependencies-in-a-maven-project/' rel='bookmark' title='Permanent Link: How to find project dependencies in a Maven project'>How to find project dependencies in a Maven project</a></li>
<li><a href='http://www.btaz.com/java/maven/18/' rel='bookmark' title='Permanent Link: Maven pom.xml structure'>Maven pom.xml structure</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.btaz.com/java/maven-log4j-and-javax-jms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
