You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by woggle23 <ma...@yahoo.co.uk> on 2011/01/27 11:53:44 UTC

Issues running Apache Camel Examples

Morning Team

I'm very new to Apache-Camel and Apache-Maven, needless to say I'm have a
few issues. I downloaded apache-camel-2.5.0-fuse-00-00.zip and have some
issues when attempting the run the examples via Maven. 

The first example I ran successfully (without any issues) was
"camel-example-jms-file". 

Next I attempted to run "camel-example-pojo-messaging". This compiled ok but
wouldn't run; I received the following errors:

[ERROR] Failed to execute goal on project camel-example-pojo-messaging: 

Could not resolve dependencies for project
org.apache.camel:camel-example-pojo-messaging
:bundle:2.5.0-fuse-00-00: 

Failed to collect dependencies for 
[org.apache.activemq:activemq-core:jar:5.3.2 (compile), 
org.apache.activemq:activemq-camel:jar:5.3.2 (compile), 
org.apache.camel:camel-core:jar:2.5.0-fuse-00-00 (compile), 
org.apache.camel:camel-jms:jar:2.5.0-fuse-00-00 (compile), 
org.apache.camel:camel-spring:jar:2.5.0-fuse-00-00 (compile), 
org.apache.xbean:xbean-spring:jar:3.5 (compile), 
commons-logging:commons-logging:jar:1.1.1 (compile), 
log4j:log4j:jar:1.2.16 (compile), 
junit:junit:jar:4.8.1 (test), 
org.apache.camel:camel-test:jar:2.5.0-fuse-00-00 (test), 
com.sun:tools:jar:1.5.0 (system)]: 

Failed to read artifact descriptor for log4j:log4j:jar:1.2.16: 
Could not transfer artifact log4j:log4j:pom:1.2.16 from/to central
(http://repo1.maven.org/maven2): 
Error transferring file: repo1.maven.org: Unknown host repo1.maven.org ->
[Help 1]

Amending the pom.xml file as follows allowed the example to run (not sure
why this worked - I was just playing really!):

<?xml version="1.0" encoding="UTF-8"?>

	<!--
		Licensed to the Apache Software Foundation (ASF) under one or more
		contributor license agreements. See the NOTICE file distributed with
		this work for additional information regarding copyright ownership.
		The ASF licenses this file to You under the Apache License, Version
		2.0 (the "License"); you may not use this file except in compliance
		with the License. You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
		applicable law or agreed to in writing, software distributed under the
		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
		CONDITIONS OF ANY KIND, either express or implied. See the License for
		the specific language governing permissions and limitations under the
		License.
	-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.apache.camel</groupId>
		<artifactId>examples</artifactId>
		<version>2.5.0-fuse-00-00</version>
	</parent>

	<artifactId>camel-example-pojo-messaging</artifactId>
	<packaging>bundle</packaging>
	<name>Camel :: Example :: POJO Messaging</name>
	<description>An example showing how to produce and consume messages from
Camel endpoints using annotated POJOs</description>

	<properties>
	
<camel.osgi.export.pkg>org.apache.camel.example.pojo_messaging.*</camel.osgi.export.pkg>
	
<camel.osgi.import.additional>org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool</camel.osgi.import.additional>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-core</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jms</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-core</artifactId>
		</dependency>


		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-camel</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.apache.camel</groupId>
					<artifactId>camel-web</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		
		
		<dependency>
			<groupId>org.apache.xbean</groupId>
			<artifactId>xbean-spring</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring</artifactId>
				</exclusion>
			</exclusions>
		</dependency>


		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-spring</artifactId>
		</dependency>


	<!--
		
		


		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
		</dependency>

		
		
	-->
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>target/classes/features.xml</file>
									<type>xml</type>
									<classifier>features</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Allows the example to be run via 'mvn camel:run' -->
			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-maven-plugin</artifactId>
				<version>${project.version}</version>
			</plugin>

		</plugins>
	</build>

	<reporting>
		<plugins>
			<!-- let's generate nice PNG / SVG diagrams from our routes -->
			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-maven-plugin</artifactId>
				<version>${project.version}</version>
			</plugin>
		</plugins>
	</reporting>
</project>

Following this I attempted to run "camel-example-bam". Again, this seemed to
compile ok, but wouldn't run; I received the following error messages:

[ERROR] Failed to execute goal
org.apache.camel:camel-maven-plugin:2.5.0-fuse-00-00:run (default-cli) on
project camel-example-bam: null: MojoExecutionException
: InvocationTargetException: 

Error creating bean with name 'template': Initialization of bean failed; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'camel': Invocation of init method failed; 
nested exception is org.apache.camel.RuntimeCamelException:
org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'activities' defined in file 
[C:\Program
Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]: 
Cannot resolve reference to bean 'jpaTemplate' while setting bean property
'jpaTemplate'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'jpaTemplate' defined in file 
[C:\Program
Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]: 
Cannot resolve reference to bean 'entityManagerFactory' while setting bean
property 'entityManagerFactory'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'entityManagerFactory' defined in file 
[C:\Program
Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]:
Invocation of init method failed; nested exception is
java.lang.RuntimeException: 
error trying to scan <jar-file>: 
file:/C:/Program
Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/: 
Not a valid URL: file:/C:/Program
Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/:
Illegal character in path at index 16: 
file:/C:/Program
Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/
-> [Help 1]

I'm using Apache Maven 3.0.2 and Java version 1.6.0_23.

As mentioned I'm completely new to this so appreciate that I could be doing
something completely wrong. Any help you can provide would be much
appreciated.

Many thanks

Matt
-- 
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359515.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issues running Apache Camel Examples

Posted by Hadrian Zbarcea <hz...@gmail.com>.
Perfect, thanks.
Hadrian

On Jan 27, 2011, at 11:23 AM, Claus Ibsen wrote:

> On Thu, Jan 27, 2011 at 5:16 PM, Hadrian Zbarcea <hz...@gmail.com> wrote:
>> Claus, is there a problem with the Apache Camel 2.6.0 release?
>> Hadrian
>> 
> 
> No the Apache version is fine.
> 
> Its the FuseSource which lacks <repository> in the pom.xml so you can
> access the FuseSource repo to download the JARs we provide.
> 
> The Apache JARs is in central maven repo so there is never such a problem.
> 
> 
> 
>> 
>> On Jan 27, 2011, at 9:36 AM, Claus Ibsen wrote:
>> 
>>> Hi
>>> 
>>> Yeah we should take this conversation at FuseSource.
>>> 
>>> Just one last remark though.
>>> 
>>> The problem you have is only in the latest 2.6.0 release.
>>> 
>>> I have created a ticket to track this:
>>> http://fusesource.com/issues/browse/MR-406
>>> 
>>> I will provide details for the workaround you can do in that link above.
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> FuseSource
>>> Email: cibsen@fusesource.com
>>> Web: http://fusesource.com
>>> Twitter: davsclaus
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/


Re: Issues running Apache Camel Examples

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 27, 2011 at 5:16 PM, Hadrian Zbarcea <hz...@gmail.com> wrote:
> Claus, is there a problem with the Apache Camel 2.6.0 release?
> Hadrian
>

No the Apache version is fine.

Its the FuseSource which lacks <repository> in the pom.xml so you can
access the FuseSource repo to download the JARs we provide.

The Apache JARs is in central maven repo so there is never such a problem.



>
> On Jan 27, 2011, at 9:36 AM, Claus Ibsen wrote:
>
>> Hi
>>
>> Yeah we should take this conversation at FuseSource.
>>
>> Just one last remark though.
>>
>> The problem you have is only in the latest 2.6.0 release.
>>
>> I have created a ticket to track this:
>> http://fusesource.com/issues/browse/MR-406
>>
>> I will provide details for the workaround you can do in that link above.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Issues running Apache Camel Examples

Posted by Hadrian Zbarcea <hz...@gmail.com>.
Claus, is there a problem with the Apache Camel 2.6.0 release?
Hadrian


On Jan 27, 2011, at 9:36 AM, Claus Ibsen wrote:

> Hi
> 
> Yeah we should take this conversation at FuseSource.
> 
> Just one last remark though.
> 
> The problem you have is only in the latest 2.6.0 release.
> 
> I have created a ticket to track this:
> http://fusesource.com/issues/browse/MR-406
> 
> I will provide details for the workaround you can do in that link above.
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/


Re: Issues running Apache Camel Examples

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah we should take this conversation at FuseSource.

Just one last remark though.

The problem you have is only in the latest 2.6.0 release.

I have created a ticket to track this:
http://fusesource.com/issues/browse/MR-406

I will provide details for the workaround you can do in that link above.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Issues running Apache Camel Examples

Posted by woggle23 <ma...@yahoo.co.uk>.
Will do, apologies for any inconvenience.

Claus, many thanks for your help!

Cheers

Matt
-- 
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359826.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issues running Apache Camel Examples

Posted by Hadrian Zbarcea <hz...@gmail.com>.
Matt, could you please move this discussion to the fusesource forums? [1]
This mailing list has a lot of traffic as it is and should be used for issues/questions related to the Apache distro, not a vendor's.

Thanks,
Hadrian

[1] http://fusesource.com/forums/index.jspa


On Jan 27, 2011, at 9:01 AM, woggle23 wrote:

> 
> Hi 
> 
> I tried to use the 2.6.0 version that you pointed me to. I attempted to
> compile the pojo-messaging example, and received the following error:
> 
> [INFO] Scanning for projects...
> Downloading:
> http://repo1.maven.org/maven2/org/apache/camel/camel-parent/2.6.0-f
> use-00-00/camel-parent-2.6.0-fuse-00-00.pom
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project
> org.apache.camel:camel-example-pojo-messaging:2.6.0-fuse-0
> 0-00 (C:\Documents and Settings\Administrator\My
> Documents\MF\Fuse\apache-camel-
> 2.6.0-fuse-00-00\apache-camel-2.6.0-fuse-00-00\examples\camel-example-pojo-messa
> ging\pom.xml) has 1 error
> [ERROR]     Non-resolvable parent POM for
> org.apache.camel:examples:2.6.0-fuse-0
> 0-00: Could not find artifact
> org.apache.camel:camel-parent:pom:2.6.0-fuse-00-00
> in central (http://repo1.maven.org/maven2) and 'parent.relativePath' points
> at
> wrong local POM @ org.apache.camel:examples:2.6.0-fuse-00-00, C:\Documents
> and S
> ettings\Administrator\My
> Documents\MF\Fuse\apache-camel-2.6.0-fuse-00-00\apache-
> camel-2.6.0-fuse-00-00\examples\pom.xml, line 21, column 11 -> [Help 2]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> swit
> ch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> rea
> d the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
> gException
> [ERROR] [Help 2]
> http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableMo
> delException
> 
> I attempted to manually find the missing artifact
> (org.apache.camel:camel-parent:pom:2.6.0-fuse-00-00), but didn't manage to
> find it.
> 
> I don't have Maven 2.2.1 at present. I'll get a copy of it now and try it
> with Apache Camel 2.5.0.
> 
> Cheers
> 
> Matt
> -- 
> View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359733.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issues running Apache Camel Examples

Posted by woggle23 <ma...@yahoo.co.uk>.
Hi 

I tried to use the 2.6.0 version that you pointed me to. I attempted to
compile the pojo-messaging example, and received the following error:

[INFO] Scanning for projects...
Downloading:
http://repo1.maven.org/maven2/org/apache/camel/camel-parent/2.6.0-f
use-00-00/camel-parent-2.6.0-fuse-00-00.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project
org.apache.camel:camel-example-pojo-messaging:2.6.0-fuse-0
0-00 (C:\Documents and Settings\Administrator\My
Documents\MF\Fuse\apache-camel-
2.6.0-fuse-00-00\apache-camel-2.6.0-fuse-00-00\examples\camel-example-pojo-messa
ging\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for
org.apache.camel:examples:2.6.0-fuse-0
0-00: Could not find artifact
org.apache.camel:camel-parent:pom:2.6.0-fuse-00-00
 in central (http://repo1.maven.org/maven2) and 'parent.relativePath' points
at
wrong local POM @ org.apache.camel:examples:2.6.0-fuse-00-00, C:\Documents
and S
ettings\Administrator\My
Documents\MF\Fuse\apache-camel-2.6.0-fuse-00-00\apache-
camel-2.6.0-fuse-00-00\examples\pom.xml, line 21, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
rea
d the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException
[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableMo
delException

I attempted to manually find the missing artifact
(org.apache.camel:camel-parent:pom:2.6.0-fuse-00-00), but didn't manage to
find it.

I don't have Maven 2.2.1 at present. I'll get a copy of it now and try it
with Apache Camel 2.5.0.

Cheers

Matt
-- 
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359733.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issues running Apache Camel Examples

Posted by Claus Ibsen <cl...@gmail.com>.
And there is a getting started guide which you may want to checkout as well
http://fusesource.com/docs/router/2.5/getting_started/index.html



On Thu, Jan 27, 2011 at 1:29 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Thu, Jan 27, 2011 at 1:25 PM, woggle23 <ma...@yahoo.co.uk> wrote:
>>
>> Hi Claus
>>
>> I don't appear to have an issue with my connection. I can access the
>> following url fine.
>>
>> http://repo1.maven.org/maven2
>>
>> Any other ideas??
>>
>
> Do you happen to have Maven 2.2.1 on your computer?
> As support for Maven 3.0 is something we only recently managed to
> implement in the next Camel 2.6 release.
>
> BTW: Fuse MR 2.6.0-fuse-00-00 has been released. But hasn't been
> promoted on the website. Additional release notes, migration guides
> and whatnot is in the works.
>
> You can download the ZIP file from the fuse maven repo
> http://repo.fusesource.com/nexus/content/groups/public/org/apache/camel/apache-camel/2.6.0-fuse-00-00/
>
> I suggest to try that version with your Maven 3.0
>
>> Cheers
>>
>> Matt
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359609.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Issues running Apache Camel Examples

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 27, 2011 at 1:25 PM, woggle23 <ma...@yahoo.co.uk> wrote:
>
> Hi Claus
>
> I don't appear to have an issue with my connection. I can access the
> following url fine.
>
> http://repo1.maven.org/maven2
>
> Any other ideas??
>

Do you happen to have Maven 2.2.1 on your computer?
As support for Maven 3.0 is something we only recently managed to
implement in the next Camel 2.6 release.

BTW: Fuse MR 2.6.0-fuse-00-00 has been released. But hasn't been
promoted on the website. Additional release notes, migration guides
and whatnot is in the works.

You can download the ZIP file from the fuse maven repo
http://repo.fusesource.com/nexus/content/groups/public/org/apache/camel/apache-camel/2.6.0-fuse-00-00/

I suggest to try that version with your Maven 3.0

> Cheers
>
> Matt
> --
> View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359609.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Issues running Apache Camel Examples

Posted by woggle23 <ma...@yahoo.co.uk>.
Hi Claus

I don't appear to have an issue with my connection. I can access the
following url fine.

http://repo1.maven.org/maven2

Any other ideas??

Cheers

Matt
-- 
View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359609.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issues running Apache Camel Examples

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Do you have an issue with your internet connection or DNS lookup?

There is this error reported:
Error transferring file: repo1.maven.org: Unknown host repo1.maven.org ->

You should be able to hit this url from a web browser
http://repo1.maven.org/maven2

Its the central maven repo where all the JAR files is being downloaded from.



On Thu, Jan 27, 2011 at 11:53 AM, woggle23 <ma...@yahoo.co.uk> wrote:
>
> Morning Team
>
> I'm very new to Apache-Camel and Apache-Maven, needless to say I'm have a
> few issues. I downloaded apache-camel-2.5.0-fuse-00-00.zip and have some
> issues when attempting the run the examples via Maven.
>
> The first example I ran successfully (without any issues) was
> "camel-example-jms-file".
>
> Next I attempted to run "camel-example-pojo-messaging". This compiled ok but
> wouldn't run; I received the following errors:
>
> [ERROR] Failed to execute goal on project camel-example-pojo-messaging:
>
> Could not resolve dependencies for project
> org.apache.camel:camel-example-pojo-messaging
> :bundle:2.5.0-fuse-00-00:
>
> Failed to collect dependencies for
> [org.apache.activemq:activemq-core:jar:5.3.2 (compile),
> org.apache.activemq:activemq-camel:jar:5.3.2 (compile),
> org.apache.camel:camel-core:jar:2.5.0-fuse-00-00 (compile),
> org.apache.camel:camel-jms:jar:2.5.0-fuse-00-00 (compile),
> org.apache.camel:camel-spring:jar:2.5.0-fuse-00-00 (compile),
> org.apache.xbean:xbean-spring:jar:3.5 (compile),
> commons-logging:commons-logging:jar:1.1.1 (compile),
> log4j:log4j:jar:1.2.16 (compile),
> junit:junit:jar:4.8.1 (test),
> org.apache.camel:camel-test:jar:2.5.0-fuse-00-00 (test),
> com.sun:tools:jar:1.5.0 (system)]:
>
> Failed to read artifact descriptor for log4j:log4j:jar:1.2.16:
> Could not transfer artifact log4j:log4j:pom:1.2.16 from/to central
> (http://repo1.maven.org/maven2):
> Error transferring file: repo1.maven.org: Unknown host repo1.maven.org ->
> [Help 1]
>
> Amending the pom.xml file as follows allowed the example to run (not sure
> why this worked - I was just playing really!):
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>        <!--
>                Licensed to the Apache Software Foundation (ASF) under one or more
>                contributor license agreements. See the NOTICE file distributed with
>                this work for additional information regarding copyright ownership.
>                The ASF licenses this file to You under the Apache License, Version
>                2.0 (the "License"); you may not use this file except in compliance
>                with the License. You may obtain a copy of the License at
>
>                http://www.apache.org/licenses/LICENSE-2.0 Unless required by
>                applicable law or agreed to in writing, software distributed under the
>                License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
>                CONDITIONS OF ANY KIND, either express or implied. See the License for
>                the specific language governing permissions and limitations under the
>                License.
>        -->
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
>        <modelVersion>4.0.0</modelVersion>
>
>        <parent>
>                <groupId>org.apache.camel</groupId>
>                <artifactId>examples</artifactId>
>                <version>2.5.0-fuse-00-00</version>
>        </parent>
>
>        <artifactId>camel-example-pojo-messaging</artifactId>
>        <packaging>bundle</packaging>
>        <name>Camel :: Example :: POJO Messaging</name>
>        <description>An example showing how to produce and consume messages from
> Camel endpoints using annotated POJOs</description>
>
>        <properties>
>
> <camel.osgi.export.pkg>org.apache.camel.example.pojo_messaging.*</camel.osgi.export.pkg>
>
> <camel.osgi.import.additional>org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool</camel.osgi.import.additional>
>        </properties>
>
>        <dependencies>
>                <dependency>
>                        <groupId>org.apache.camel</groupId>
>                        <artifactId>camel-core</artifactId>
>                </dependency>
>
>                <dependency>
>                        <groupId>org.apache.camel</groupId>
>                        <artifactId>camel-jms</artifactId>
>                </dependency>
>
>                <dependency>
>                        <groupId>org.apache.activemq</groupId>
>                        <artifactId>activemq-core</artifactId>
>                </dependency>
>
>
>                <dependency>
>                        <groupId>org.apache.activemq</groupId>
>                        <artifactId>activemq-camel</artifactId>
>                        <exclusions>
>                                <exclusion>
>                                        <groupId>org.apache.camel</groupId>
>                                        <artifactId>camel-web</artifactId>
>                                </exclusion>
>                        </exclusions>
>                </dependency>
>
>
>                <dependency>
>                        <groupId>org.apache.xbean</groupId>
>                        <artifactId>xbean-spring</artifactId>
>                        <exclusions>
>                                <exclusion>
>                                        <groupId>org.springframework</groupId>
>                                        <artifactId>spring</artifactId>
>                                </exclusion>
>                        </exclusions>
>                </dependency>
>
>
>                <dependency>
>                        <groupId>junit</groupId>
>                        <artifactId>junit</artifactId>
>                        <scope>test</scope>
>                </dependency>
>
>                <dependency>
>                        <groupId>org.apache.camel</groupId>
>                        <artifactId>camel-test</artifactId>
>                        <scope>test</scope>
>                </dependency>
>
>
>                <dependency>
>                        <groupId>org.apache.camel</groupId>
>                        <artifactId>camel-spring</artifactId>
>                </dependency>
>
>
>        <!--
>
>
>
>
>                <dependency>
>                        <groupId>commons-logging</groupId>
>                        <artifactId>commons-logging</artifactId>
>                </dependency>
>                <dependency>
>                        <groupId>log4j</groupId>
>                        <artifactId>log4j</artifactId>
>                </dependency>
>
>
>
>        -->
>        </dependencies>
>
>        <build>
>                <resources>
>                        <resource>
>                                <directory>src/main/resources</directory>
>                                <filtering>true</filtering>
>                        </resource>
>                </resources>
>                <plugins>
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>                                <artifactId>maven-resources-plugin</artifactId>
>                                <executions>
>                                        <execution>
>                                                <phase>process-resources</phase>
>                                                <goals>
>                                                        <goal>resources</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                        </plugin>
>                        <plugin>
>                                <groupId>org.codehaus.mojo</groupId>
>                                <artifactId>build-helper-maven-plugin</artifactId>
>                                <executions>
>                                        <execution>
>                                                <id>attach-artifacts</id>
>                                                <phase>package</phase>
>                                                <goals>
>                                                        <goal>attach-artifact</goal>
>                                                </goals>
>                                                <configuration>
>                                                        <artifacts>
>                                                                <artifact>
>                                                                        <file>target/classes/features.xml</file>
>                                                                        <type>xml</type>
>                                                                        <classifier>features</classifier>
>                                                                </artifact>
>                                                        </artifacts>
>                                                </configuration>
>                                        </execution>
>                                </executions>
>                        </plugin>
>                        <!-- Allows the example to be run via 'mvn camel:run' -->
>                        <plugin>
>                                <groupId>org.apache.camel</groupId>
>                                <artifactId>camel-maven-plugin</artifactId>
>                                <version>${project.version}</version>
>                        </plugin>
>
>                </plugins>
>        </build>
>
>        <reporting>
>                <plugins>
>                        <!-- let's generate nice PNG / SVG diagrams from our routes -->
>                        <plugin>
>                                <groupId>org.apache.camel</groupId>
>                                <artifactId>camel-maven-plugin</artifactId>
>                                <version>${project.version}</version>
>                        </plugin>
>                </plugins>
>        </reporting>
> </project>
>
> Following this I attempted to run "camel-example-bam". Again, this seemed to
> compile ok, but wouldn't run; I received the following error messages:
>
> [ERROR] Failed to execute goal
> org.apache.camel:camel-maven-plugin:2.5.0-fuse-00-00:run (default-cli) on
> project camel-example-bam: null: MojoExecutionException
> : InvocationTargetException:
>
> Error creating bean with name 'template': Initialization of bean failed;
> nested exception is org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'camel': Invocation of init method failed;
> nested exception is org.apache.camel.RuntimeCamelException:
> org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'activities' defined in file
> [C:\Program
> Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]:
> Cannot resolve reference to bean 'jpaTemplate' while setting bean property
> 'jpaTemplate';
> nested exception is org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'jpaTemplate' defined in file
> [C:\Program
> Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]:
> Cannot resolve reference to bean 'entityManagerFactory' while setting bean
> property 'entityManagerFactory';
> nested exception is org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'entityManagerFactory' defined in file
> [C:\Program
> Files\apache-camel-2.5.0-fuse-00-00\apache-camel-2.5.0-fuse-00-00\examples\camel-example-bam\target\classes\META-INF\spring\camel-context.xml]:
> Invocation of init method failed; nested exception is
> java.lang.RuntimeException:
> error trying to scan <jar-file>:
> file:/C:/Program
> Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/:
> Not a valid URL: file:/C:/Program
> Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/:
> Illegal character in path at index 16:
> file:/C:/Program
> Files/apache-camel-2.5.0-fuse-00-00/apache-camel-2.5.0-fuse-00-00/examples/camel-example-bam/target/classes/
> -> [Help 1]
>
> I'm using Apache Maven 3.0.2 and Java version 1.6.0_23.
>
> As mentioned I'm completely new to this so appreciate that I could be doing
> something completely wrong. Any help you can provide would be much
> appreciated.
>
> Many thanks
>
> Matt
> --
> View this message in context: http://camel.465427.n5.nabble.com/Issues-running-Apache-Camel-Examples-tp3359515p3359515.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/