You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Dimitri (JIRA)" <ji...@apache.org> on 2013/04/28 01:02:15 UTC

[jira] [Commented] (TOMEE-263) Trunk regression: declared via context.xml not imported

    [ https://issues.apache.org/jira/browse/TOMEE-263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13643828#comment-13643828 ] 

Dimitri commented on TOMEE-263:
-------------------------------

Same here with 1.6.0-SNAPSHOT. If we configure a <Resource name="jdbc/myDB" type="javax.sql.DataSource" ... /> in context.xml, the following is written into the log:

...
INFO: Configuring Service(id=web/jdbc/myDB, type=Resource, provider-id=ProvidedByTomcat)
Apr 28, 2013 2:39:55 AM org.apache.openejb.assembler.classic.Assembler createRecipe
INFO: Creating Resource(id=web/jdbc/myDB)
Apr 28, 2013 2:39:55 AM org.apache.openejb.config.AutoConfig processResourceRef
INFO: Auto-linking resource-ref 'openejb/Resource/web/jdbc/myDB' in bean mypackage.Comp32236753 to Resource(id=web/jdbc/myDB)
Apr 28, 2013 2:39:55 AM org.apache.openejb.config.AutoConfig processResourceRef
INFO: Auto-linking resource-ref 'openejb/Resource/jdbc/myDB' in bean mypackage.Comp32236753 to Resource(id=web/jdbc/myDB)
...

but the DataSource can't be resolved, say, in a subsequent <Realm dataSourceName="..." />. None of the names work: "jdbc/myDB", "web/jdbc/myDB", "openejb/Resource/jdbc/myDB". Using "java:comp/" prefix doesn't help either. As well, the resource can't be injected with @Resource annotation.

If we define <Resource ...> in tomee.xml, everything works.
                
> Trunk regression: <Resources> declared via context.xml not imported
> -------------------------------------------------------------------
>
>                 Key: TOMEE-263
>                 URL: https://issues.apache.org/jira/browse/TOMEE-263
>             Project: TomEE
>          Issue Type: Task
>            Reporter: David Blevins
>
> This works in 1.0.0, but seems to be failing in trunk:
> {panel}
> $ jar tvf /tmp/foo/tomcatresources.war 
>      0 Fri Jun 29 19:19:02 PDT 2012 META-INF/
>     60 Fri Jun 29 19:19:02 PDT 2012 META-INF/MANIFEST.MF
>      0 Fri Jun 29 19:18:30 PDT 2012 WEB-INF/
>    314 Fri Jun 29 19:18:32 PDT 2012 WEB-INF/context.xml
> {panel}
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Context>
>   <Resource name="jdbc/myDB" auth="Container"
>             type="javax.sql.DataSource" username="sa" password=""
>             driverClassName="org.hsqldb.jdbcDriver"
>             url="jdbc:hsqldb:file:data/hsqldb/hsqldb"
>             maxActive="8"
>       />
> </Context>
> {code}
> Doesn't seem it will be imported and exist in TomEE as a ResourceInfo in the Assembler and therefore not be used.  Instead we'll create a default DataSource and use it for all @Resource refs and persistence.xml files.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira