PDA

View Full Version : WebApp Config and Entity Resolvers


mr.morphic
05-14-2010, 03:45 AM
Hi all.

I'm building a web app that uses a number of jars, one of which emits this error when I start resin:

[10-05-14 14:44:49.426] {resin-34} EjbConfigManager[web-app:http://default/test] reading jar:file:/var/www-resin/webapps/test/WEB-INF/lib/thirdparty.jar!/META-INF/ejb-jar.xml
[10-05-14 14:44:49.426] {resin-34} com.caucho.xml.RemoteURLException: URL `http://java.sun.com/dtd/ejb-jar_2_0.dtd' was not opened because it is a remote URL. Any URL scheme other than file: must be handled by a custom entity resolver.

I have seen reference to this error, but no solution on how to configure resin to get around it. Java provides a resolver mechanism that allows you to grab a URL like this and replace it with a local resource. In my case, I have the resource locally, I just don't know how to configure resin to use it instead of getting it externally.

I've looked through the resin docs on how to add a custom entity resolver, but can't find any reference to it. There seems to be lots of dependency-injection-type configuration, and maybe this is how its done. I'm not a java expert (actually a PHP developer using resin/querus to interface a PHP app to a java back-end).

Any help or pointers would be appreciated.

Thanks
M

mighty
05-14-2010, 08:01 AM
I am also facing same kind of problem. help to morphic might also help me too.

emil
05-14-2010, 11:08 PM
Hi,

Can you post the version (or versions) of Resin that are exhibiting this problem? Also, if you could give an example of a third party library that shows this behavior, that could help us reproduce the problem.

Thanks,
Emil

mr.morphic
05-16-2010, 08:58 PM
Hi. Thanks for your reply.

I am using resin-4.0.4 in a Redhat 5 environment, with jre 1.6 and jboss 5.1. The particular jar is purpose built, and sensitive to the client concerned, unfortunately, although the resource it's attempting to access is widely available.

I have built a small pure-java application that uses the jar, so I know it works for the purpose I need it for. But I need to interface it to PHP, so need it running in resin.

Mark

emil
05-17-2010, 06:05 PM
Hi Mark,

Can you explain how you're using Resin and JBoss together?

Thanks,
Emil

mr.morphic
05-18-2010, 08:47 PM
Hi. JBoss is used by the third-party jar, which is a client for a custom remote service. So I'm not using that directly. The test program I wrote that I run from the command line includes JBoss in the classpath, all the same components. When run from the command line it doesn't have that issue. In the PHP implementation running within resin/quercus, I get that error when the application starts up, so resin must be looking in the included jar for external resources. It doesn't get into the code of the application as far as I can tell.

Sorry for lack of detail. I am constrained by not being able to expose the code in question, and also by my lack of knowledge on resin and in-depth java knowledge :-| I was hoping you could point me in the direction of particular configuration options to look at, which I could use to resolve the referenced URL to a local resource.

Mark

emil
05-18-2010, 09:48 PM
Hi Mark,

I just checked that the entity resolver message is really just a warning and can be ignored. Sounds like you're having another issue that might be coming from another source (try turning on fine or finer logging). It could be related to using EJB 2.0, which Resin 4.0 doesn't support.

HTH,
Emil

mr.morphic
05-19-2010, 08:52 PM
Ok, thanks Emil. Back to the drawing board I guess :-)