You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2015/10/05 19:30:26 UTC

[jira] [Commented] (CAY-2033) Specifying filter name in web.xml not starting with "cayenne-" ends up with an obscure error HTTP Status 500 - DataRowStore name can't be null

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

Andrus Adamchik commented on CAY-2033:
--------------------------------------

Thanks for the Jira. The docs actually talk about the naming here: http://cayenne.apache.org/docs/3.1/cayenne-guide/starting-cayenne.html#webapps 

"When started by the web container, it creates a instance of ServerRuntime and stores it in the ServletContext. Note that the name of Cayenne XML project file is derived from the "filter-name". In the example above CayenneFilter will look for an XML file "cayenne-project.xml". This can be overridden with "configuration-location" init parameter."

However naming of CayenneFilter did cause questions from other users. So we will probably need to improve the docs. And you are right - we don't talk about the new project naming anywhere in the docs.

> Specifying filter name in web.xml not starting with "cayenne-" ends up with an obscure error HTTP Status 500 - DataRowStore name can't be null
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAY-2033
>                 URL: https://issues.apache.org/jira/browse/CAY-2033
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library, Documentation
>    Affects Versions: 3.1
>            Reporter: Misha Doronin
>            Priority: Minor
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In version prior to 3.1 it was possible to specify an arbitrary filter-name in web.xml and 3.0 documentation uses <filter-name>CayenneFilter</filter-name> as an example.
> When upgrading to Cayenne 3.1, if a user keeps the naming in web.xml and renames instead cayenne-project.xml into CayenneFilter.xml he will get an obscure error "HTTP Status 500 - DataRowStore name can't be null".
> (Stack trace:
> java.lang.IllegalArgumentException: DataRowStore name can't be null.
> 	org.apache.cayenne.access.DataRowStore.<init>(DataRowStore.java:101)
> 	org.apache.cayenne.access.DataDomain.nonNullSharedSnapshotCache(DataDomain.java:367)
> 	org.apache.cayenne.access.DataDomain.getSharedSnapshotCache(DataDomain.java:355)
> 	org.apache.cayenne.configuration.server.DataContextFactory.createdFromDataDomain(DataContextFactory.java:108)
> 	org.apache.cayenne.configuration.server.DataContextFactory.createContext(DataContextFactory.java:56)
> 	org.apache.cayenne.configuration.web.SessionContextRequestHandler.requestStart(SessionContextRequestHandler.java:70)
> 	org.apache.cayenne.configuration.web.CayenneFilter.doFilter(CayenneFilter.java:105)
> )
> It should be specified in the 3.0 to 3.1 upgrade guide, as well as in the 3.1 documentation, that the name of the filter in web.xml must start with "cayenne-".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)