Hi

As already said make use of the *latest* release of the 2.9.x branch which's
2.9.3:

http://camel.apache.org/camel-293-release.html

Then the example should work out of the box. The problem was only on the
2.10.x branch as well as trunk which is already resolved now.

And about the "classpath:META-INF/cxf/cxf.xml" you asked about, it get's
loaded from the CXF libs itself:

http://cxf.apache.org/docs/embedding-cxf-inside-spring.html

I verified the "camel-example-reportincident" example both on WIN-XP as well
as OS-X which works just fine, e.g. on WIN-XP here is the output I get:

P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident>mvn
jetty:run
[INFO] Scanning for projects...
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Camel :: Example :: Report Incident 2.9.3
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:7.5.4.v20111024:run (default-cli) @
camel-example-reportincident >>>
[INFO]
[INFO] --- maven-antrun-plugin:1.6:run (create-prop) @
camel-example-reportincident ---
[INFO] Executing tasks

main:
     [echo] Maven version: 2.9.3
     [echo] OSGi version: 2.9.3
[INFO] Executed tasks
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties
(default) @ camel-example-reportincident ---
[INFO]
[INFO] --- cxf-codegen-plugin:2.5.5:wsdl2java (generate-sources) @
camel-example-reportincident ---
[INFO] Using proxy server configured in maven.
[INFO]
[INFO] --- maven-remote-resources-plugin:1.1:process (default) @
camel-example-reportincident ---
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
camel-example-reportincident ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default) @
camel-example-reportincident ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
camel-example-reportincident ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources
(default-testResources) @ camel-example-reportincident ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\src\test\resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
camel-example-reportincident ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< jetty-maven-plugin:7.5.4.v20111024:run (default-cli) @
camel-example-reportincident <<<
[INFO]
[INFO] --- jetty-maven-plugin:7.5.4.v20111024:run (default-cli) @
camel-example-reportincident ---
[INFO] Configuring Jetty for project: Camel :: Example :: Report Incident
[INFO] webAppSourceDirectory P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\src\main\webapp
does not exist. Defaulting to P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\target\classes
[INFO] Context path = /
[INFO] Tmp directory = P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file =
file:/P:/My%20Documents/dev/tmp/apache-camel-2.9.3/examples/camel-example-reportincident/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = P:\My
Documents\dev\tmp\apache-camel-2.9.3\examples\camel-example-reportincident\src\main\webapp
2012-09-17 16:15:41.697:INFO:oejs.Server:jetty-7.5.4.v20111024
2012-09-17 16:15:42.682:INFO:oejpw.PlusConfiguration:No Transaction manager
found - if your webapp requires one, please configure one.
2012-09-17 16:15:43.322:INFO:/:Initializing Spring root
WebApplicationContext
2012-09-17 16:15:43,322 [main           ] INFO  ContextLoader                 
- Root WebApplicationContext: initialization started
2012-09-17 16:15:43,635 [main           ] INFO  XmlWebApplicationContext      
- Refreshing Root WebApplicationContext: startup date [Mon Sep 17 16:15:43
CEST 2012]; root of context hierarchy
2012-09-17 16:15:43,916 [main           ] INFO  XmlBeanDefinitionReader       
- Loading XML bean definitions from class path resource [camel-config.xml]
2012-09-17 16:15:44,166 [main           ] INFO  XmlBeanDefinitionReader       
- Loading XML bean definitions from class path resource
[META-INF/cxf/cxf.xml]
2012-09-17 16:15:48,712 [main           ] INFO  XmlWebApplicationContext      
- Bean 'cxf' of type [class org.apache.cxf.bus.spring.SpringBus] is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
2012-09-17 16:15:48,791 [main           ] INFO  DefaultListableBeanFactory    
- Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@3813c:
defining beans
[cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,template,consumerTemplate,camel:beanPostProcessor,camel];
root of factory hierarchy
2012-09-17 16:15:49,634 [main           ] INFO  SpringCamelContext            
- Apache Camel 2.9.3 (CamelContext: camel) is starting
2012-09-17 16:15:49,650 [main           ] INFO  ManagementStrategyFactory     
- JMX enabled. Using ManagedManagementStrategy.
2012-09-17 16:15:49,759 [main           ] INFO 
ultManagementLifecycleStrategy - StatisticsLevel at All so enabling load
performance statistics
2012-09-17 16:15:50,072 [main           ] INFO 
AnnotationTypeConverterLoader  - Found 3 packages with 15 @Converter classes
to load
2012-09-17 16:15:50,119 [main           ] INFO  DefaultTypeConverter          
- Loaded 170 core type converters (total 170 type converters)
2012-09-17 16:15:50,150 [main           ] INFO 
AnnotationTypeConverterLoader  - Loaded 3 @Converter classes
2012-09-17 16:15:50,181 [main           ] INFO  DefaultTypeConverter          
- Loaded additional 19 type converters (total 189 type converters) in 0.062
seconds
2012-09-17 16:15:51,056 [main           ] INFO  ReflectionServiceFactoryBean  
- Creating Service
{http://reportincident.example.camel.apache.org}ReportIncidentEndpointService
from WSDL: etc/report_incident.wsdl
2012-09-17 16:15:53,665 [main           ] WARN 
stractWSDLBasedEndpointFactory - Could not find endpoint/port for
{http://reportincident.example.camel.apache.org}ReportIncidentEndpointPort
in wsdl. Using
{http://reportincident.example.camel.apache.org}ReportIncidentService.
2012-09-17 16:15:53,837 [main           ] INFO  ServerImpl                    
- Setting the server's publish address to be /incident
2012-09-17 16:15:53,993 [main           ] INFO  SpringCamelContext            
- Route: route1 started and consuming from:
Endpoint[cxf:///incident?bus=%23cxf&serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint&wsdlURL=etc%2Freport_incident.wsdl]
2012-09-17 16:15:54,056 [main           ] INFO  SpringCamelContext            
- Route: route2 started and consuming from:
Endpoint[file://target/subfolder]
2012-09-17 16:15:54,056 [main           ] INFO  SpringCamelContext            
- Total 2 routes, of which 2 is started.
2012-09-17 16:15:54,071 [main           ] INFO  SpringCamelContext            
- Apache Camel 2.9.3 (CamelContext: camel) started in 4.422 seconds
2012-09-17 16:15:54,087 [main           ] INFO  ContextLoader                 
- Root WebApplicationContext: initialization completed in 10749 ms
2012-09-17 16:15:54.087:INFO:oejsh.ContextHandler:started
o.m.j.p.JettyWebAppContext{/,file:/P:/My%20Documents/dev/tmp/apache-camel-2.9.3/examples/camel-example-reportincident/src/main/webapp/},file:/P:/My%20Documents/dev/tmp/apache-camel-2.9.3/examples/camel-example-reportincident/src/main/webapp/
2012-09-17 16:15:54.243:INFO:oejs.AbstractConnector:Started
SelectChannelConnector@0.0.0.0:9080 STARTING

Babak


domenico wrote
> 
> Hi Babak
> 
> Many thanks for the hint. But again, no success. I still get the same
> exception on mvn jetty:run
> 
> java.lang.ClassNotFoundException:
> org.springframework.web.context.ContextLoaderListener
> java.lang.ClassNotFoundException:
> org.apache.cxf.transport.servlet.CXFServlet
> javax.servlet.UnavailableException:
> org.apache.cxf.transport.servlet.CXFServlet
> java.lang.NullPointerException
> 
> I had a look at the web.xml. Both, ContextLoaderListener and CXFServlet
> are requested in there. Now loolking at the classpath I see that it is
> defined as follows in the web.xml:
> 
> <param-value>classpath:camel-config.xml</param-value>
> 
> So I checked "the camel-config.xml" and it contains the following
> classpath:
> 
> <import resource="classpath:META-INF/cxf/cxf.xml"/>
> 
> which I cannot find anywhere. Am I on the wrong track here?
> 
> many thanks again
> Domenico
> 




--
View this message in context: 
http://camel.465427.n5.nabble.com/Tutorial-1-fails-running-with-exception-tp5719278p5719476.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to