java-ee

GWT app - deploying on Tomcat or any other servlet container

∥☆過路亽.° 提交于 2019-12-18 03:49:05
问题 Is there a plugin for Eclipse GWT or any other method to automatically deploy and run GWT app on Tomcat (or any other Serlvet container)? For the moment the only method I know is copying the compiled classes into WEB-INF directory but this is an arduous work. Additionally you have to configure Apache Tomcat manually. I'd like to have something like in Eclipse Dynamic Web Project where you can run your servlets directly by spawning tomcat process. Thanks 回答1: You could write an Ant task to

How to cleanly end a CDI @ConversationScoped

与世无争的帅哥 提交于 2019-12-18 03:48:24
问题 My Project is using JSF2.0 and CDI. For one page, I want my backing bean to match the lifespan of the page. @ViewScoped seems a perfect fit but it's not part of CDI and then make our solution not consistent. Then my next option would be the CDI @ConversationScoped. Seems to me the only way to mark the boundary of a conversation is the program way via conversation.begin and conversation.end (I have used Seam 2.x, there you can use annotations to mark conversation boundary). My page is sitting

Custom Glassfish Security Realm does not work (unable to find LoginModule)

本秂侑毒 提交于 2019-12-18 03:38:25
问题 I'm trying to get a Custom Security Realm in Glassfish working (i tried 3.0.1 final and 3.1 B33). I read nearly all tutorials about this, but it doesn't not work on my System. I'm getting the error Login failed: javax.security.auth.login.LoginException: unable to find LoginModule class: com.company.security.realm.CustomLoginModule when trying to login. Here is what i did: I created a little Maven project, which contains the needed Realm class, CustomRealm, and the corresponding LoginModule,

Wildfly 9.x startet with errors: Address already in use

≯℡__Kan透↙ 提交于 2019-12-18 03:37:41
问题 I'm new in Eclipse, JSF, Wildfly and so on. I get this stacktrace: 22:03:42,430 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: WFLYSRV0083: Failed to start the http-interface service at org.jboss.as.server.mgmt.UndertowHttpManagementService.start(UndertowHttpManagementService.java:269) at org.jboss

Why use Facade pattern for EJB session bean

左心房为你撑大大i 提交于 2019-12-18 03:29:55
问题 I want to ask what is the reason to use Facade Pattern when access EJB Session Bean. In my Netbeans 6.9.1, if I do New > Sessions Bean for Entity Classes , and let say that I select User entity, then Netbeans would generate this code AbstractFacade.java public abstract class AbstractFacade<T> { private Class<T> entityClass; public AbstractFacade(Class<T> entityClass) { this.entityClass = entityClass; } protected abstract EntityManager getEntityManager(); public void create(T entity) {

What are the conventional locations for for JSPs, JavaScript, CSS, Images in Maven web projects?

删除回忆录丶 提交于 2019-12-18 03:29:25
问题 I need to convert a traditional J2EE web application into a new Maven web project. In traditional project JSPs are under WebApp/jsps folder, JavaScript & CSS files under WebApp/scripts folder, image under WebApp/images folder, .properties files under WebApp/resources folder. In the Maven project where would each of those file types go? Should I create folders under src/main/webapp such as: src/main/webapp/jsps , src/main/webapp/images , src/main/webapp/resources … etc and copy the files from

Inserting links into RESTEasy XML results via JAXB

天涯浪子 提交于 2019-12-18 02:53:12
问题 I want to insert links into XML via RESTeasy / JAXB . I tried to use the documentation for my code, but that did not work, so I just coded the given examples in the documentation: it still does not work and I have no idea why. Background: To implement the HATEOAS principles into my JBoss RESTEasy API I have to insert links into my JAXB XML results, so clients can navigate through the API. I am now trying to understand how to do that, but I am not sure if the documentation is full of errors or

Replace a context-param element with a Servlet 3.0 annotation

心不动则不痛 提交于 2019-12-18 02:50:58
问题 Given: a Java EE 5 web app that has a web.xml that has a snippet like <context-param> <description>c</description> <param-name>a</param-name> <param-value>b</param-value> </context-param> What would I need to do to move that context-param specification into an annotation based strategy. 回答1: You can find all javax.servlet annotations in the javax.servlet.annotation package summary: @HandlesTypes This annotation is used to declare the class types that a ServletContainerInitializer can handle.

JPA Entity - Specify Persistence Unit?

北城以北 提交于 2019-12-18 02:49:07
问题 I have a JavaEE project that makes use of multiple persistence units. Is there any way to specify which persistence unit a particular JPA Entity belongs to? Some entities are in one data source, while others are in my second data source. Is there a way to differentiate between the two using annotations? 回答1: To specify which persistent unit an Entity belongs to, use the persistence.xml file: <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org

How to include dependencies in WAR file?

柔情痞子 提交于 2019-12-18 01:12:14
问题 I have a Dynamic Web Project in Eclipse which has a dependency to another Java project in my workspace. When running the web project in the build-in Tomcat server, I've added the project dependency to the class path in the run configuration . I would like to create a WAR for deploying the web project on an external server. The dependency Java project is added to the Java Build path in Eclipse, but when I export an WAR-file the library is not included. The Java project is also selected in the