Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4099

Camel PropertyPlaceHolder throws an Error when using ${user.home} environment variable in Windows

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      Error happens when I try to configure using properyconfigurer
      <camel:propertyPlaceholder location="file://${user.home}/aventurine-config/aventurine-config.properties" id="propertyPlaceHolder"/> and try to use an environment variable. THis happens only on windows environment. This works on Ubuntu, It seems that camel is removing the slashes in ${user.home}

      org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route areaFileRoute: Route[[Fromfile:{{upload.folder}}] -> [DoTry[[process[ref:... because of Failed to resolve endpoint: file:upload.folder due to: C:Userscarloc\aventurine-config\aventurine-config.properties (The system cannot find the path specified)
      at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
      at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238)
      at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
      at org.mortbay.jetty.Server.doStart(Server.java:222)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
      at com.ccti.StartUFM.main(StartUFM.java:35)
      Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route areaFileRoute: Route[[Fromfile:{{upload.folder}}] -> [DoTry[[process[ref:... because of Failed to resolve endpoint: file:upload.folder due to: C:Userscarloc\aventurine-config\aventurine-config.properties (The system cannot find the path specified)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:170)
      at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:706)
      at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1643)
      at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1432)
      at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1336)
      at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)
      at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
      at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
      at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1314)
      at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
      at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
      ... 18 more
      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: file:upload.folder due to: C:Userscarloc\aventurine-config\aventurine-config.properties (The system cannot find the path specified)
      at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:407)
      at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:47)
      at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:180)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
      at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
      at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
      at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:793)
      at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
      ... 28 more
      Caused by: java.io.FileNotFoundException: C:Userscarloc\aventurine-config\aventurine-config.properties (The system cannot find the path specified)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(FileInputStream.java:106)
      at java.io.FileInputStream.<init>(FileInputStream.java:66)
      at org.apache.camel.component.properties.DefaultPropertiesResolver.loadPropertiesFromFilePath(DefaultPropertiesResolver.java:67)
      at org.apache.camel.component.properties.DefaultPropertiesResolver.resolveProperties(DefaultPropertiesResolver.java:49)
      at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:96)
      at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:83)
      at org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:963)
      at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:405)
      ... 36 more

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              carloc Carlo M. Camerino

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment