[ 
https://issues.apache.org/roller/browse/ROL-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14391#action_14391
 ] 

Mike Jackson commented on ROL-1741:
-----------------------------------

Oops, I didn't type some stuff.  For the first sentence I forgot to say that 
this is in the JNDI datasource lookup code, although if you look at the source 
it's obvious.  

I've also thought about this a bit more and really the idea of prefixing the 
JNDI name with anything ("java:comp/env/" for instance) is a bad idea.  The 
problem here is that roller is making assumptions about how the JNDI tree will 
be structured, which in this case are valid for Tomcat, and probably some other 
containers, but aren't valid for other containers (JBOSS).  It's safest, at 
least here, to not assume otherwise it runs the risk of causing problems in 
certain environments.

> jndi prefix should not be used
> ------------------------------
>
>                 Key: ROL-1741
>                 URL: https://issues.apache.org/roller/browse/ROL-1741
>             Project: Roller
>          Issue Type: Bug
>          Components: Database Access & Data Model
>    Affects Versions: 4.0
>         Environment: solaris within jboss container
>            Reporter: Mike Jackson
>            Assignee: Roller Unassigned
>
> On line 124 of org.apache.roller.weblogger.business.DatabaserProvider is 
> prefixed with "java:comp/env/".  May or may not work for all containers and 
> will definately lead to frustration on the part of the installer expecting to 
> have to supply the "java:" part of the JNDI url.  JBoss for instance tends to 
> put datasources at "java:/<datasource name>".  If it were up to me I'd 
> re-write that line as follows:
>   String name = ( getJndiName().indexOf(":") == -1 ? "java:comp/env/" + 
> getJndiName() : getJndiName());
> This assumes that a value JNDI lookup will always have a ":" in it.  This is 
> probably a safe bet.  
> <sandbox>It'd be nice if there was a document out there that went through all 
> of the options available to be configured via the roller-custom.properties 
> file, such as this one.  The install guide is really sparse in this 
> regard.</sandbox>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to