weixin_33734785 2015-11-23 09:54 采纳率: 0%
浏览 29

tomcat上下文元素

I have a strange effect defining a tomcat context element. With development i used META-INF/context.xml. On deployment it's $TOMCAT_HOME/conf/engine/myfooservice.xml

Is a plain simple context def - path and datasource:

<Resource
  name="dataSourceName"
  type="javax.sql.DataSource"
  password="s3cr3t"
  driverName="oracle.jdbc.OracleDriver"
  maxIdle="32"
  maxWaitMillis="5000"
  username="stupidLooser"
  url="jdbc:oracle:thin:@HHHHHHH:1521:XXX"
  maxTotal="64"/>

Using META-INF it work's as expected. Using $TOMCAT_HOME/conf/engine/myapp.xml there is a different behaviour with URLs.

Some 'App' calls a rest Service (myfooservice) to display some information before realm login on the login screen. App ---AJAX----> myfooservice on same Tomcat (/App /myfooservice).

Using $TOMCAT_HOME/conf/engine/myapp.xml the url on login is changed to http://$host:$port/APPContext/index/$myfooserviceCONTEXT/RestURL which is pretty wrong - non existent (all browsers). Breaks login.

Using META-INF/context.xml the login work's as expected. j_security is called and the final URL is http://$host:$port/APPContext/index (all Browsers) as expected.

I have no idea why $TOMCAT_HOME/conf/engine/myfooservice.xml behaves differently. From the docs i would conclude that there is no difference.

  • 写回答

1条回答 默认 最新

  • weixin_33670713 2015-11-23 16:04
    关注

    Property Naminng error - opps. The Context was also defined in META-INF/context.xml - correct - with driverClassName="oracle.jdbc.OracleDriver".

    The conf/... entry has priority over META-INF/context.xml. Seems i got a mix (Datasource worked) and a strange side effect as result (path problem).

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器