java-ee-7

FacesServlet URL Patterns

眉间皱痕 提交于 2019-12-02 02:52:48
I am not sure what I am doing wrong here but when I put the faces context twice in the URL it bypasses all of my Realm Securities. My URL Pattern: <servlet-mapping> <servlet-name>Faces</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> Security Constraint <security-constraint> <display-name>ADMIN</display-name> <web-resource-collection> <web-resource-name>Protected Admin Area</web-resource-name> <description/> <url-pattern>/faces/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <description/> <role-name>ADMIN</role-name> </auth-constraint> <user-data

Mock or build a Jersey InboundJaxrsResponse

好久不见. 提交于 2019-12-01 15:34:30
I'm fairly new developing jersey client, and has run into some problems with some testing. First off all I maybe should mention that my application is all client side, no server side stuff at all. My problem is that I would like to create a Response object of instance InboundJaxrsResponse , so far I've tried to achieve this by mocking a Response using Mockito and ResponseBuilder.build() Using Mockito: Response response = mock(Response.class); when(response.readEntity(InputStream.class)) .thenReturn(ClassLoader.getSystemResourceAsStream("example_response.xml"); this works fine, when I read out

Weblogic 12c and Java EE 7 Features

浪尽此生 提交于 2019-12-01 05:27:11
As we know, WebLogic Server 12c supports natively Java EE 7. However, if we take a look at the WebLogic 12c documentation of standards there will be a lot of versions differences. Such as: Java EE 7: Servlet 3.1, JPA 2.1, EL 3.0, JAX-RS 2.0, EJB 3.2, JMS 2.0 WLS 12c: Servlet 3.0, JPA 2.0, EL 2.2, JAX-RS 1.1, EJB 3.1, JMS 1.1 It's just a matter of importing the libraries? Or there is any restriction to use these latest versions? Thanks a lot! ** UPDATE: WebLogic 12.2.1 is now released. It is Java EE 7 and JDK 8 certified. ** Wrong! WebLogic 12c (12.1.3) is Java EE 6 certified. Versions 12.1.1

WELD-001408 Unsatisfied dependencies for type [Validator]

流过昼夜 提交于 2019-12-01 05:07:22
问题 I'm unable to deploy my project after migrating it from Java EE 6 to Java EE 7. I already have CDI enabled (beans.xml with bean-discovery-mode="all" for backwards compatibility) The deployment error does not seem to be related to my code since it mentions a "Validator" class trying to be injected at org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor I don't have a clue of what is going on here. I'm using GlassFish 4.0. Here's the stack trace of the exception generated at

Weblogic 12c and Java EE 7 Features

こ雲淡風輕ζ 提交于 2019-12-01 02:43:53
问题 As we know, WebLogic Server 12c supports natively Java EE 7. However, if we take a look at the WebLogic 12c documentation of standards there will be a lot of versions differences. Such as: Java EE 7: Servlet 3.1, JPA 2.1, EL 3.0, JAX-RS 2.0, EJB 3.2, JMS 2.0 WLS 12c: Servlet 3.0, JPA 2.0, EL 2.2, JAX-RS 1.1, EJB 3.1, JMS 1.1 It's just a matter of importing the libraries? Or there is any restriction to use these latest versions? Thanks a lot! 回答1: ** UPDATE: WebLogic 12.2.1 is now released. It

Configuring proxy for JAX-RS 2.0 client API

不羁岁月 提交于 2019-11-30 22:38:06
I have an application that is running on a Java EE 7 application server (WildFly), that queries another service using REST resources. In previous applications I have used the Jersey 1.x client API. Access to the REST service is granted through a web proxy. In Jersey I create the Client instance like this: public Client create() { Client client; if ( proxyConfiguration != null && proxyConfiguration.getHost() != null && !proxyConfiguration.getHost().trim().isEmpty() ) { HttpURLConnectionFactory urlConnectionFactory = new ProxyUrlConnectionFactory( proxyConfiguration ); client = new Client( new

CompletableFuture/parallelStream in JavaEE app server

不打扰是莪最后的温柔 提交于 2019-11-30 19:18:13
Given the new Java8 we are getting really nice features for asynchronous tasks, e.g. CompletableFuture and .paralellStream(). If you run this in Java SE as I've understood it you will utilize the ForkJoinPool, but what happens if I run the following examples in e.g. Wildfly or TomcatEE? //Here I start a comp.Future without giving an Executor test = CompletableFuture.supplyAsync(() -> timeConsumingMethod()); //Here I start a parallel stream mList.paralell().filter(...).collect(Collectors.toList()) What happens and where will I borrow my resources from if The examples are ran in a @Stateful bean

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

十年热恋 提交于 2019-11-30 18:07:53
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 request to /financeiro/clientes/pessoafisica: javax.servlet.ServletException: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type: java.time.LocalDate. at br.com.caelum.vraptor.VRaptor.doFilter

Configuring proxy for JAX-RS 2.0 client API

╄→гoц情女王★ 提交于 2019-11-30 17:50:15
问题 I have an application that is running on a Java EE 7 application server (WildFly), that queries another service using REST resources. In previous applications I have used the Jersey 1.x client API. Access to the REST service is granted through a web proxy. In Jersey I create the Client instance like this: public Client create() { Client client; if ( proxyConfiguration != null && proxyConfiguration.getHost() != null && !proxyConfiguration.getHost().trim().isEmpty() ) { HttpURLConnectionFactory

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

假装没事ソ 提交于 2019-11-30 16:50:17
问题 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 request to /financeiro/clientes/pessoafisica: javax.servlet.ServletException: javax.validation.UnexpectedTypeException: HV000030