title: apache-camel - Reading a java constants in spring xml
body: <p>Trying to read java constant in spring xml file.</p>
  
  <p>In spring.xml file</p>
  
  <pre><code>&lt;util:constant id="speed"
      static-field="&lt;packageName&gt;.&lt;constantclassname&gt;.&lt;constantName&gt;" /&gt;
  </code></pre>
  
  <p>and using the property placeholder to read it</p>
  
  <pre><code> &lt;bean id="bridgePropertyPlaceHolder" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer"&gt;
        &lt;property name="properties"&gt;
           &lt;props&gt;
             &lt;prop key="testProperty"&gt;#{speed}&lt;/prop&gt;
           &lt;/props&gt;
        &lt;/property&gt;
        &lt;property name="ignoreUnresolvablePlaceholders" value="true"/&gt;
     &lt;/bean&gt;
  </code></pre>
  
  <p>and in route printing the property</p>
  
  <pre><code>&lt;route&gt;
  &lt;from uri=""/&gt;
  &lt;setProperty propertyname="test"&gt;
  &lt;simple&gt;{{testProperty}}&lt;/simple&gt;
  &lt;/setProperty&gt;
  &lt;log message="print ${property[test]"/&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>and in Constants java class file have defined the constant like</p>
  
  <pre><code>public static final String &lt;constantName&gt; ="xxxx";
  </code></pre>
  
  <p>While running this i am getting </p>
  
  <p>Exception in thread "main" org.apache.camel.RuntimeCamelException: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "xxxx" doesnt contain ObjectFactory.class or jaxb.index
   - with linked exception:
  [javax.xml.bind.JAXBException: "xxxx" doesnt contain ObjectFactory.class or jaxb.index]</p>
  
  <p>Am not sure why this requires ObjectFactory.class.</p>
  
  <p>Please help me in resolving this or is there any other way to read a java constant file in spring.xml</p>
  
  <p>Please suggest.</p>
  
  <p>Thanks.</p>