How can i run beans validation with webcontainer apache tomcat?

I just add:

			<dependency>
				<groupId>org.hibernate.validator</groupId>
				<artifactId>hibernate-validator</artifactId>
				<version>6.0.8.Final</version>
			</dependency>

			<dependency>
				<groupId>org.glassfish</groupId>
				<artifactId>javax.el</artifactId>
				<version>3.0.1-b09</version>
			</dependency>

I am using CDI.

Thanks

These dependencies look about right. Do you run into any specific problem? Some more description of what you’re trying to do and what isn’t working as you expect, would help. If you’re using CDI, you also might want to add the HV portable extension:

<dependency>
    <groupId>org.hibernate.validator</groupId>
    <artifactId>hibernate-validator-cdi</artifactId>
    <version>6.0.9.Final</version>
</dependency>

Hi Nykel,

I ran into a similar setup recently with Tomcat + CDI + Hibernate Validator. You’ll need Weld for CDI support. Add this to your web.xml:

<listener>
    <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>

And add it if you’re planning to inject validators:

<dependency>
    <groupId>org.hibernate.validator</groupId>
    <artifactId>hibernate-validator-cdi</artifactId>
    <version>6.0.9.Final</version>
</dependency>