java-ee-6

JPA Criteria query Path.get left join is it possible

╄→гoц情女王★ 提交于 2019-12-04 19:16:12
问题 I have a question regarding JPA criteria. Here is my JPA criteria query: CriteriaBuilder criteriaBuilder = getEm().getCriteriaBuilder(); CriteriaQuery<InventoryItemSumReport> query = criteriaBuilder.createQuery(InventoryItemSumReport.class); Root<InventoryItemDetail> from = query.from(InventoryItemDetail.class); Join<InventoryItemDetail, InventoryItem> joinItem = from.join(InventoryItemDetail_.inventoryItem); Predicate where = criteriaBuilder.lessThanOrEqualTo(from.get(InventoryItemDetail_

spring configuration files relationship?

百般思念 提交于 2019-12-04 19:06:54
I am using spring3.x. i have below configuration files in my application. applicationContext.xml spring-ws-servlet.xml web.xml <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:config/applicationContext.xml</param-value> </context-param> <servlet> <servlet-name>spring-ws</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:config/spring-ws-servlet.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name

What happens behind the scenes of deploying a Spring MVC application to tomcat outside of eclipse?

寵の児 提交于 2019-12-04 18:49:05
I guess a drawback of using such an awesome IDE like eclipse is that you miss the point for what happens behind the scenes of an application. I'm a ruby developer so not a java veteran. So I've been coding a project in java and using the spring framework for IOC and MVC. Can someone explain to me what is going on when I select run on server in eclipse? Because eventually I will be deploying this masterpiece of an application to a Linux server. Here is my setup. I am using Spring MVC 3 and the maven plugin in eclipse. In the pom.xml file, I have stuff like latest spring release version, log4j,

Why does maven not copy the properties files during the build process?

喜你入骨 提交于 2019-12-04 17:26:00
问题 Nothing I've found has been able to help me solve this one specific case. I recently switched from a plain old java web app project (which was working) to a maven web project. I get the following runtime exception: java.util.MissingResourceException: Can't find bundle for base name com.myapp.config, locale en I am using Netbeans to create a JSF 2.0, Spring, and Hibernate web app. I have the following directory structure: src\main\java\com\myapp Contains config.properties src\main\resources

How do I upgrade an existing NetBeans Java EE 6 Web project to Java EE 7?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 15:29:05
The project uses JavaServer Faces and JPA. NetBeans 7.3.1 IDE does not allow to change the Java EE version. I already found this question: How do I upgrade an existing enterprise project from Java EE5 to Java EE 6 in Netbeans (6.9) tries to apply the changes as described. I have updated project.properties. endorsed.classpath=\ ${libs.javaee-endorsed-api-7.0.classpath} ... j2ee.platform=1.7-web ... javac.source=1.7 javac.target=1.7 I just had to do the same thing, I had an Java EE 6 Application and wanted to go to Java EE 7. I just made a new project in Netbeans, then I selected Java Web in

Deploy JSF composite components for shared use

不打扰是莪最后的温柔 提交于 2019-12-04 15:20:05
I work on a Java EE project which is planned to become quite large in future and I want to share as much code as possible. This included not only Java code, but also code for UI elements. I think about developing enterprise components based on clear defined subjects (like user administration, taxes, products) which interact on basis of messages, beans and so on. I also think about giving all these components some managed beans and JSF composites to provide some basic functionality for later use in the web UI. That's the context... To make it concrete: Let's say I have an EAR (um.ear) for user

@Observes in sessionscoped bean?

社会主义新天地 提交于 2019-12-04 15:11:12
is following scenario possible? "SessionService" which is a stateless EJB fires an event "LoggedInEvent". A SessionScoped (Weld) bean "SessionBean" having a non static method observing the LoggedInEvent is called and initializes some things for that specific user. Is the correct instance of "SessionBean" called? Are all instances called? I can not find anything in the documentation. "The correct instance" is a slightly misleading wording. What happens is this: The SessionService is invoked (probably triggered by a web request). If it fires its LoggedInEvent , all registered observers are

Java EE 6 embedded glassfish embedded derby EJB unit test

泄露秘密 提交于 2019-12-04 14:40:53
问题 questing is about javaee6 with embedded glassfish and embedded derby jndi lookup for data source at the time of deployment before unit test is executed.... Please find the persistence.xml here... <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence

Why session bean method throw EjbTransactionRolledbackException when RuntimeException was thrown

别等时光非礼了梦想. 提交于 2019-12-04 13:52:15
问题 I am trying to persist the entity with constraint validation, when invoke persist - there is constraint that thrown and the caller get EjbTransactionRolledbackException ... so I try to call the validation explicit and throw ConstraintViolationException / RuntimeException and still the caller get EjbTransactionRolledbackException ... when I throw MyException extends Exception - the caller get MyException Even when I call explicit sc.setRollBackOnly it's still happened :( This shouldn't be the

Is there a way to know if a state is active without catching ContextNotActiveException?

眉间皱痕 提交于 2019-12-04 13:03:40
问题 I would like to know if the RequestScoped context is currently active in a method or not. At the moment, here is what I do : @Inject private BeanManager beanManager; public boolean isRequestScopeActive() { try { if (beanManager.getContext(RequestScoped.class).isActive()) { return true; } else { return false; } } catch (final ContextNotActiveException e) { return false; } } I think it's a bit heavy to catch a ContextNotActiveException just to know if a scope is active or not. Do you have any