title: Getting Error while using camel JPA component: Failed to resolve endpoint: jpa: due to: Expected scheme-specific part at index 4: jpa:
body: <p>Hi I am trying to send an entity to postgresql DB using camel JPA   component.<br>
  I am getting the below error while creating the route. Please help.
  Persistence.xml and route is below. I am using Spring DSL for routes.</p>
  
  <pre><code>Jan 29, 2015 3:49:47 PM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route processSdpRoute at: &gt;&gt;&gt; To[jpa:] &lt;&lt;&lt; in route: Route(processSdpRoute)[[From[direct:processSdpRecord]] -&gt; [p... because of Failed to resolve endpoint: jpa: due to: Expected scheme-specific part at index 4: jpa:
      at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:122)
      at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:318)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)
  Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route processSdpRoute at: &gt;&gt;&gt; To[jpa:] &lt;&lt;&lt; in route: Route(processSdpRoute)[[From[direct:processSdpRecord]] -&gt; [p... because of Failed to resolve endpoint: jpa: due to: Expected scheme-specific part at index 4: jpa:
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:910)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:175)
      at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:780)
      at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2068)
      at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1816)
      at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1683)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1651)
      at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:254)
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
      ... 17 more
  Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jpa: due to: Expected scheme-specific part at index 4: jpa:
      at org.apache.camel.impl.DefaultCamelContext.normalizeEndpointUri(DefaultCamelContext.java:607)
      at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:489)
      at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71)
      at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:190)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
      at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
      at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
      at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:499)
      at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:212)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:907)
      ... 26 more
  Caused by: java.net.URISyntaxException: Expected scheme-specific part at index 4: jpa:
      at java.net.URI$Parser.fail(URI.java:2829)
      at java.net.URI$Parser.failExpecting(URI.java:2835)
      at java.net.URI$Parser.parse(URI.java:3038)
      at java.net.URI.&lt;init&gt;(URI.java:595)
      at org.apache.camel.util.URISupport.normalizeUri(URISupport.java:448)
      at org.apache.camel.impl.DefaultCamelContext.normalizeEndpointUri(DefaultCamelContext.java:605)
      ... 36 more
  
  
  
  
  My Persistence.xml is below
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt;
    &lt;persistence-unit name="PERSISTENCE_UNIT_NAME" transaction-type="JTA"&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
        &lt;properties&gt;
        &lt;property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/fdp-sa-db" /&gt;
        &lt;property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" /&gt;
        &lt;property name="javax.persistence.jdbc.user" value="postgres" /&gt;
        &lt;property name="javax.persistence.jdbc.password" value="postgres" /&gt;
        &lt;/properties&gt;
       &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>My  Spring-config.xml is below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p"
      xmlns:util="http://www.springframework.org/schema/util" xmlns:security="http://www.springframework.org/schema/security"
      xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:task="http://www.springframework.org/schema/task"
      xsi:schemaLocation="http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
          http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
          http://www.springframework.org/schema/security  http://www.springframework.org/schema/security/spring-security-3.1.xsd 
          http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
          http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"&gt;
  
  
      &lt;bean id="transactionManagerlocal" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
          &lt;property name="entityManagerFactory" ref="entityManagerFactorylocal"/&gt;
      &lt;/bean&gt;
  &lt;bean id="entityManagerFactorylocal"
                  class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"&gt;
                  &lt;property name="persistenceUnitName" value="PERSISTENCE_UNIT_NAME" /&gt;
       &lt;/bean&gt;
  
      &lt;bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactorylocal"/&gt;
     &lt;property name="transactionManager" ref="transactionManagerlocal"/&gt;
  &lt;/bean&gt;
  
  &lt;/beans&gt;
  
  Route Definition is below:
  
   &lt;bean id="sdpFileProcessor" class="com.ericsson.sdp.processor.SDPFileProcessor"/&gt; 
  
          &lt;!-- this is an included XML file where we only the the routeContext --&gt;
          &lt;routeContext id="processSdpRoute" xmlns="http://camel.apache.org/schema/spring"&gt;
          &lt;route id="processSdpRoute"&gt;
          &lt;from uri="direct:processSdpRecord"/&gt;
          &lt;!-- &lt;filter&gt;
              &lt;mvel&gt;request.body.offer_type == 3 &amp;amp;&amp;amp; request.body.offer_id == 20&lt;/mvel&gt; --&gt;
                   &lt;process ref="sdpFileProcessor" /&gt; 
              &lt;to uri= "jpa:" /&gt;
           &lt;!--  &lt;/filter&gt; --&gt;
           &lt;/route&gt;
          &lt;/routeContext&gt;
         &lt;/beans&gt;
  </code></pre>