You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Francesco Pretto <ce...@gmail.com> on 2007/03/21 14:55:05 UTC

Tomcat5 and jndi context using fscontext from Sun

Hi! I use tomcat 5.0.30 with java 1.4 for my app (constrained to them,
unfortunately). My os is Gnu/Linux Ubuntu 6.10.

I use hibernate plus Sun fscontext (class
com.sun.jndi.fscontext.RefFSContextFactory ) to create a jndi context
( stored in the filesystem) for my application, so hibernate can
easily lookup sessions. It works very well launching a test app
outside tomcat, but when launching it inside the tomcat container,
fscontext is unable to create the files/dirs it need to store the jndi
context. I can't find them anywhere, neither if a specify a workDir
attribute for the tomcat container (inside the <context> tag).

I tryed a lot of combination of specifying the path for store the jndi
context (inside the hibernate.cfg.xml, "jndi.url" property), relative,
"file:/", "file://", "file://.", "file:.", and absolute (after
previously setting the workDir attribute), "file:///tmp/context",
"file:/tmp/context", etc., but nothing: files are not created
anywhere...

I'm doing it right? Or in general there's other settings that regulate
the permission for webapps classes to write in the fs? Or another
approach? Maybe there's another dir where fscontext could try to write
in? A lot of dirs at $CATALINA_HOME aren't writable by the tomcat5
user...

Unfortunately, the log is not useful (most probably the i/o exception
is catched immediately by fscontext, and not reported to the user, or
piped to some tty i'm unable to find). Got only errors from Hibernate
unable to bound to the jndi context (or unable to bound to the tomcat
one, that's read only). However, you can find it here:
http://www.webalice.it/ceztko/tomcat5log

Thanks for the help!

Francesco

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat5 and jndi context using fscontext from Sun

Posted by Francesco Pretto <ce...@gmail.com>.
I forgot my app context configuration:

<Context path="/visionehrcv" docBase="visionehrcv" debug="99"
reloadable="true" workDir="/tmp/visionehrcv" >
    <Realm className="org.apache.catalina.realm.JAASRealm"
           appName="visionehrcv"
           userClassNames="com.tagish.auth.TypedPrincipal"
           roleClassNames="com.tagish.auth.TypedPrincipal"
           debug="99"
           useContextClassLoader="false" />
</Context>

is there anything i can to do to let that class to write inside, let's
say, /tmp/visionehrcv ? (absolute path in the real fs, i intend)
or am i doing something wrong?

Please note that fscontext.jar and providerutil.jar are in the
WEB-INF/lib directory, so no problem with the classpath.


Thanks again,
Francesco

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org