[
https://hibernate.onjira.com/browse/HHH-7012?page=com.atlassian.jira.plug...
]
Mathevet commented on HHH-7012:
-------------------------------
Main difference, if is it, is NamedParser isn't same, in hibernate:
{code:java}
private Name parseName(String jndiName, Context context) {
try {
return context.getNameParser( "" ).parse( jndiName );
}
catch ( InvalidNameException e ) {
throw new JndiNameException( "JNDI name [" + jndiName + "] was not
valid", e );
}
catch ( NamingException e ) {
throw new JndiException( "Error parsing JNDI name [" + jndiName + "]",
e );
}
}
{code}
and in tomcat
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/Selector...
:
{code:java}
@Override
554 public NameParser getNameParser(Name name)
555 throws NamingException {
556 return getBoundContext().getNameParser(parseName(name));
557 }
{code}
and parse name return (name.getSuffix(1));
Jndi lookup doesn't found datasource with tomcat
------------------------------------------------
Key: HHH-7012
URL:
https://hibernate.onjira.com/browse/HHH-7012
Project: Hibernate ORM
Issue Type: Bug
Affects Versions: 4.0.1
Environment: oracle 10g, tomcat 7
Reporter: Mathevet
I migrate my application from hibernate 3 to 4, but at startup I got an exception that I
couldn't get datasource. Seem that InitialContext is empty. I let tomcat manages
connection.
Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name
[java:comp/env/jdbc/myCompDb]
at
org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68)
at
org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116)
I ask on forum at:
https://forum.hibernate.org/viewtopic.php?f=1&t=1013101
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira