2

I have seen the same kind of questions in stackoverflow but those questions were not helping me. I wanted to run my app from outside of Tomcat, so I have used "Context" of Tomcat. In the context I have given the docBase like below.

<Context docBase="../IdP/IdPserver/idp" // which is relative path
         privileged="true"
         antiResourceLocking="false"
         antiJARLocking="false"
         unpackWAR="false" />

The actual location(absolute path) is D://SRDM2.3/srdm/svr//IdP/IdPserver/idp. But it was not working with relative path but is working with absolute path. I got the following error while using relative path.

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base D:\SDC-Builds\SRDM2.3.0.6904.10\SRDM\Svr\tomcat\webapps\..\IdP\IdPserver\idp does not exist or is not a readable directory
    at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4324)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4493)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
majji
  • 169
  • 2
  • 3
  • 19

1 Answers1

1

Do you think the actual:

D://SRDM2.3/srdm/svr//IdP/IdPserver/idp

is the same as the missing?

D:\SDC-Builds\SRDM2.3.0.6904.10\SRDM\Svr\tomcat\webapps\..\IdP\IdPserver\idp

Resolving the .. in the second one results in

D:\SDC-Builds\SRDM2.3.0.6904.10\SRDM\Svr\tomcat\IdP\IdPserver\idp

You sill need another .., so try this one:

<Context docBase="../../IdP/IdPserver/idp"
icza
  • 389,944
  • 63
  • 907
  • 827
  • actually it should not go into tomcat folder, my expected path is D:/SRDM2.3.0.6904.10/SRDM/Svr/IdP/IdPserver/idp – majji Nov 12 '14 at 08:24
  • @majji Exactly. See the suggestion at the end of my answer. If you use that, it will not go into the Tomcat folder. – icza Nov 12 '14 at 08:28
  • Thanks for your help @icza, that part is working but i don't know why i am unable to start idp in tomcat. – majji Nov 12 '14 at 09:14
  • Hello @icza, Please look into http://stackoverflow.com/questions/26887190/idp-status-page-returns-http-status-404 which is related tothis relative path, it is completely eating my time, I hope i will get a good solution from you. – majji Nov 13 '14 at 04:56
  • hello @icza i have used the above concept but for me it is coming like D:\SDC-Builds\SRDM2.3.0.6904.10\SRDM\Svr\tomcat\..\..\IdP\IdPserver\metadata\idp-metadata.xml does not exist, how to resolve it? – majji Nov 13 '14 at 10:26