Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XPath Exception

    Hi,

    I defined fields in datasource using valueXPath to find a value in a complex hibernate classes. Some values are optional and don't have to exist.
    I end up with a general exception:

    Note that the class LocCountryregions has a default constructor.
    Code:
    	/** default constructor */
    	public LocCountryregions() {
    	}
    I use smartGWT 2011-06-15.

    Code:
    === 2011-06-17 09:53:38,805 [l0-0] INFO  JXPathContextObjectFactory - Provided XPath has one or more null objects, attempt to create missing object failed. JXPathContext bean: com.isomorphic.datasource.DSResponse@387d147, parent object: com.isomorphic.datasource.DSResponse@387d147, property that creation failed: locCountryregions, property index (in case of collection or array): 0
    java.lang.Exception: Property not found.
    	at com.isomorphic.util.JXPathContextObjectFactory.createObject(JXPathContextObjectFactory.java:99)
    	at org.apache.commons.jxpath.ri.model.beans.PropertyPointer.createPath(PropertyPointer.java:171)
    	at org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.createPath(BeanPropertyPointer.java:238)
    	at org.apache.commons.jxpath.ri.model.beans.PropertyPointer.createChild(PropertyPointer.java:217)
    	at org.apache.commons.jxpath.ri.model.beans.NullPropertyPointer.createPath(NullPropertyPointer.java:134)
    	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:523)
    	at org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:497)
    	at com.isomorphic.datasource.DataSource.setProperties(DataSource.java:1302)
    	at com.isomorphic.base.Reflection.adaptValue(Reflection.java:1499)
    	at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:897)
    	at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:609)
    	at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64)
    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1630)
    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
    	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
    	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
    	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at cz.bcom.smartrise.server.authentication.SpringConcurrentSessionFilter.doFilter(SpringConcurrentSessionFilter.java:54)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:324)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

    #2
    I turned this off in log4.properties by
    Code:
    <category name="com.isomorphic.util.JXPathContextObjectFactory">
    	<priority value="WARN" />
    </category>
    Along with this INFO there is also a WARN from dataSource in case there is an optional object missing.

    Isn't it better to change loginf level to INFO? I don't want to change lo4j settings to ERROR for DataSource. Warnings can be useful.

    Code:
    === 2011-09-18 23:28:20,233 [80-5] WARN  DataSource - Exception trying to create path for valueXPath: locCountryregions/id for datasource: usersDS.  Actual error: org.apache.commons.jxpath.JXPathException: Exception trying to create xpath locCountryregions; Factory com.isomorphic.util.JXPathContextObjectFactory@7aa6870d could not create an object for path: /locCountryregions
    === 2011-09-18 23:28:20,233 [80-5] WARN  DataSource - Exception trying to adapt value for valueXPath: locCountryregions/id for datasource: usersDS.  Actual error: org.apache.commons.jxpath.JXPathNotFoundException: No pointer for xpath: locCountryregions/id

    Comment


      #3
      These all seem to be legitimate warnings. You should avoid them by not providing a value for a field that is impossible to set via xpath - just use DMI logic to remove such values from the inbound dsRequest.values() before calling DataSource.setProperties().

      Comment

      Working...
      X