FAQ Database Discussion Community


error: No validator could be found for type: java.time.LocalDate

java,java-ee,bean-validation,java-ee-7,hibernate-validator
I'm working on a project that uses bean validation (Hibernate Validator 5.1.3.Final). My bean has a attribute with the @Past annotation. @Past(message = "A data deve estar no passado.") private LocalDate dataAbertura; But, when the validation occurs I get the following exception: 21:46:12,424 ERROR [io.undertow.request] (default task-35) UT005023: Exception handling...

Instantiate EJB Via Factory

java,dependency-injection,ejb,java-ee-7
So I have a service I am hooking by instantiating it through a factory that creates a proxy so it can process some annotations I have on the service. So my question is this...is there a way with JavaEE to have my dependency injection instantiate the instances of said service...

javaee-api-7.0 with JSF 2.2: f:ajax does not submit

jsf,java-ee-7
I have a Spring 4.1.1, JSF 2.2.3, Primefaces 5.1 web application that run on Java 8 and Tomcat 8. Everything worked perfectly until my colleague added the javaee-api-7.0 as a dependency for javax for ActiveMQ. With this jar in, every ajax call doesn't submit data to the backend. For example...

JAX-WS with user-defined types

web-services,jaxb,jax-ws,java-ee-7
I am trying to learn about JAX-WS, in particular how to use a complex type. In all three books on Java EE that I have access to, they mention that it is possible, but do not give any example... Strangely, neither search on the web finds one that is complete...

Intercept Exceptions for logging with CDI's AOP on Java EE 7

exception,logging,cdi,aop,java-ee-7
I have the following class snippet, from which I'd like to remove the repetitive logging code and move it to an Interceptor using CDI's AOP. /** * Javadoc omitted */ public abstract class JpaDao<T extends LongIdentifiable> implements GenericDao<T> { @Override @Transactional public Long persist(T type) throws GeneralPersistenceException { if (type...

@InterceptorBinding / CDI/ EJB 3.2 - problems with injection

java,java-ee,cdi,wildfly-8,java-ee-7
My dev environment is: WildFly 8.1, CDI, EJB 3.2, JDK 1.7. App is packed as an ear archive (one ejb + one war) because probably it gonna have other web modules in the future. I'm struggling with a custom @InterceptorBinding type used inside my EJB stateless bean. @Inherited @InterceptorBinding @Target({...

Are batchlets the correct way of implementing ETL steps in JavaEE Batch?

java,java-ee,java-ee-7,java-batch
I am studying Javaee Batch API (jsr-352) in order to test the feasibility of changing out current ETL tool for our own solution using this technology. My goal is to build a job in which I: get some (dummy) data from a datasource in step1, some other data from other...

JEE7 + WildFly (HornetQ) - Pause queue from application

java,jms,wildfly-8,java-ee-7,hornetq
We are using WildFly + HornetQ as our application server and JMS message queue, and have the requirement to be able to pause/resume queues from the application. Is this possible?

Routing all Jersey REST requests through a method prior to execution

jersey,java-ee-7
What I would like to do is define a method at the root resource level that is called prior to any sub resources of that class. Looking through the API I see nothing like this. Jersey 1.6...

jsp is not reachable

jsp,java-ee,servlets,wildfly,java-ee-7
I have a simple web application that contains: a web service: @Path("hello") public class Hello { @GET public String hello() { return "Hello"; } } in the webapp folder, a login.jsp file that says hello I can access the former on http://my-ip:8080/my-app/hello but I can't access the latter on http://my-ip:8080/my-app/login.jsp....

Getting WELD-001303 error when implementing custom CDI extension for @SessionScoped scope

java-ee,cdi,java-ee-7,named-scope,java-ee-web-profile
I'm trying to implement a custom CDI scope and I thought it's the easiest to start by extending the existing @SessionScoped. I started by following this tutorial. However, when visiting an XHTML page which references a CDI bean with my scope, this leads to org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for...

How to deploy a Java web application with Travis CI to an OpenShift WildFly server?

continuous-integration,openshift,travis-ci,java-ee-7,wildfly-8
I want to deploy my web app from GitHub with Travis CI to my WildFly application server on OpenShift. I followed the How to Build and Deploy OpenShift Java Projects using Travis CI tutorial but my index.html page from my Java EE 7 web app does not show up. Instead...

Remote JMS communication works, EJB communication fails

ejb,jms,wildfly,java-ee-7
I'm currently introducing myself into Java EE, especially into how to use EJB and JMS. The Issue in a Nutshell I have a local client and a remote server in the internet. JMS communication works fine, EJB communication doesn't. Either communication succeeds in my local network. The Issue in More...

Using causes EvaluationException on Submit but executes properly with standard

maven,jsf,glassfish,cdi,java-ee-7
Development Environment 1.8.0_45 JDK Glassfish 4.1 (latest) Maven 3.3.3 NetBeans 8.0.2 MS SQL 2012 Project Details Maven Enterprise Application 2 EJBs 1 WAR (JSF 2.2 Library from Glassfish) EAR Deployment Problem Statement When I use standard <head></head> tags, everything works properly. My CDI works, values are processed, and the site...

how to create ejb jar with conditional statement

java,web-services,ejb,java-ee-7
I have a web service that will be deployed two separate VM (example: VM123 and VM300). Depending on the VM id (VM123 or VM300), a subset of message driven beans should be deployed. Is it possible to create ejb-jar.xml with a conditional statement to specify or define the set of...

Transferring CDI qualifier to injected field

java,java-ee,cdi,java-ee-7
I'm working on a Java EE 7 application in a Wildfly 8.2 container which contains some entites that exist in two data sources. Example: I have a jar with Setting entity: @Entity public class Setting { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotNull private String name; private String value;...

WildFly: randomly salted passwords in Java EE application

security,salt,java-ee-7,wildfly-8
What is the WildFly (8.2) way to work with randomly salted passwords stored in a database? Is an implementation of org.jboss.crypto.digest.DigestCallback (in the password validation process) meant to have access to the salt part from the database? Or should I simply hash and salt passwords by my self before handing...

what is the difference between jndi binding of module and app in Java ee 6/7?

jboss,jboss7.x,jndi,jboss6.x,java-ee-7
We migrated from Jboss EAP 5 to EAP 6 in our development environment. I now see the following in my JBOSS logs. I am trying to understand how this binding happens. I have read JBOSS docs on JNDI namespace binding. Still I am not totally clear how it works. Here...

Implementing WebSocket in Java Swing Application

java,websocket,java-ee-6,java-ee-7
I created a small java swing application and I want to use WebSocket for the transferring of data from the server to the client. Can someone give me a step by step instructions on how to do it? I'm using JBoss application server.

insert/update an entity that has a many to many relationship with another entity using java criteria api

jpa,criteria,java-ee-7,metamodel
as the question says. I have two tables Products and categories. Product table ... create table products ( id int primary key generated always as identity(start with 100, increment by 1), name varchar(30), quantity int, unit_cost decimal not null, brand_name varchar(30) ) ... Categories table ... create table categories (...

Dropwizard Hibernate Configuration

mysql,hibernate,dropwizard,java-ee-7
I am new to Dropwizard and so far everything was going well till I started messing with Hibernate and MySQL. My problem is: Hibernate won't create tables and consequently no columns in my DB. The only warning I get when running my jar file is: org.hibernate.cfg.environment hibernate.properties not found But...

Hibernate Criteria aPI Multiselect

java,hibernate,postgresql-9.2,java-ee-7,jpa-2.1
If I use Hibernate Criteria API like: CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(); Root<OneEntity> entityOneRoot = criteriaQuery.from(OneEntity.class); Root<TwoEntity> entityTwoRoot = criteriaQuery.from(TwoEntity.class); criteriaQuery.multiselect(OneEntity, TwoEntity); Do I need to use EQUAL-restriction (as ON-restriction in SQL) for equaling IDs between both tables (entities)? Because of Cartesian product of both tables?...

Producer method with Qualifier

cdi,java-ee-7
I´m currently working through a JavaEE7 tutorial and I´ve came to an exercise I can´t solve. I have to split my logging into tech log and operational log using qualifiers. Here´s the class where I define these qualifiers: import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.PARAMETER; import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; import...

Can Inject (@EJB) Bean in method of other Bean Session(Remote or Local) class

java,ejb,ejb-3.1,glassfish-4,java-ee-7
I'm a newbie to EJB. I want to know is can inject EJB in method of other bean session, if not why? as code below: @Local interface car { public void drive(); } @Stateless public class Toyota implements Car { @Override public void drive() { @EJB Color color; ... }...

“Traditional” threads cannot lookup JNDI names in WildFly

java-ee,jndi,wildfly,java-ee-7,managedthreadfactory
I'm migrating an old application (uses no beans or dependency injection) from Weblogic to WildFly. For the most part, it now works fine. However, it also creates threads in "traditional way" (new Thread()), and these threads cannot lookup JNDI names, meaning database and mailing is not available to them. It...

Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS

html5,java-ee,ssl,websocket,java-ee-7
I am using GlassFish Server 4.1/Java EE 7. In my web.xml file, I mentioned the following security constraints. <security-constraint> <display-name>UserConstraint</display-name> <web-resource-collection> <web-resource-name>Provide a Name</web-resource-name> <description/> <url-pattern>/admin_side/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <auth-constraint>...

Database manipulation in Java EE

java,java-ee-6,java-ee-7
I know the usual way of connecting Java application to to the database using the following code: Class.forName("com.mysql.jdbc.Driver"); DriverManager .getConnection("jdbc:mysql://localhost/......."); How about in Java EE? Is there a new approach in database manipulation or should I use the same code above?...