Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in org.hdiv.filter.ValidatorFilter #45

Closed
dillon-sellars opened this issue Nov 19, 2013 · 5 comments
Closed

NullPointerException in org.hdiv.filter.ValidatorFilter #45

dillon-sellars opened this issue Nov 19, 2013 · 5 comments

Comments

@dillon-sellars
Copy link

Just upgraded from 2.1.4 to 2.1.5. Getting this error on some requests during automated tests.

java.lang.NullPointerException
at org.hdiv.filter.ValidatorFilter.doFilterInternal(ValidatorFilter.java:128)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

@gillarramendi
Copy link
Member

Hi,
have you also updated the hdiv-config and use Hdiv schema for configuration?

Please give us more information about your automated tests

Gotzon

@dillon-sellars
Copy link
Author

They are Selenium tests so the webapp is fully deployed. This error comes up in about 1 out of every 1,000 requests with a very light user load. I'm guessing it will be much worse in production.

@gillarramendi
Copy link
Member

Hi,

can you give us an example of the web.xml and hdiv-config.xml files that you use?
What framework and version do you use?

@dillon-sellars
Copy link
Author

web.xml fragment:

  <!-- HDIV -->
  <listener>
    <listener-class>org.hdiv.listener.InitListener</listener-class>
  </listener>

  <!-- HDIV Validator Filter -->
  <filter>
    <filter-name>ValidatorFilter</filter-name>
    <filter-class>org.hdiv.filter.ValidatorFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>ValidatorFilter</filter-name>
    <servlet-name>mvc</servlet-name>
  </filter-mapping>

applicationContext-hdiv.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:hdiv="http://www.hdiv.org/schema/hdiv"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                           http://www.hdiv.org/schema/hdiv http://www.hdiv.org/schema/hdiv/hdiv.xsd">

  <hdiv:config errorPage="/error" randomName="true" excludedExtensions="js,css,png,gif,jpg,jpeg,pdf" strategy="cipher">
    <hdiv:startPages>
      /,/home,/index,/login
    </hdiv:startPages>
    <hdiv:paramsWithoutValidation>
      <hdiv:mapping url=".*" parameters="recaptcha_response_field,recaptcha_challenge_field"/>
    </hdiv:paramsWithoutValidation>
  </hdiv:config>

  <bean id="editableParametersValidations" class="org.hdiv.config.HDIVValidations">
    <property name="urls">
      <map>         <!--  URLs to which the validations  will be applied to  -->   </map>
    </property>
  </bean>

</beans>

@gillarramendi
Copy link
Member

Reopen the issue if it continues in the last HDIV version.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants