java-ee

Hello World! with Remote Stateless Session Bean

梦想与她 提交于 2019-12-12 08:13:15
问题 Good day! I'm newcomer in the JavaEE 6. I tried to create a started project with use of the following tutorial: Creating and Running an Application Client on the GlassFish Server. I created four projects step by step: JavaSE lib to store an EJB Remote Interface, an EJB Module and otherwise as ther're described in the tutorial. My platform: Distributor ID: Ubuntu Description: Ubuntu 10.10 Release: 10.10 Codename: maverick jdk1.6.0_26 Netbean7.2(Build 201207171143) GlassFish Server 3+ My remote

javax.ejb.NoSuchEJBException after redeploying EJBs

蹲街弑〆低调 提交于 2019-12-12 08:10:35
问题 Using Glassfish 3.0.1 ... If I have a web application accessing EJBs in another application remotely, and the remote application containing the EJBs is redeployed, I get a javax.ejb.NoSuchEJBException (see stacktrace below). Shouldn't this work? I can see that the EJB in question was successfully deployed, using the exact same JNDI name. Is there any other way to fix this than to restart the web application? It should be noted that in this particular example that the stacktrace is from, I'm

HibernateDaoSupport in hibernate 4.0

六眼飞鱼酱① 提交于 2019-12-12 08:08:41
问题 i am new in integration of jsf 2.0 spring 3.1 and hibernate 4.1. how can i change following code, because hibernate 4.0 does not include HibernateDaoSupport. import org.springframework.orm.hibernate3.support.HibernateDaoSupport; public class CustomerDaoImpl extends HibernateDaoSupport implements CustomerDao{ public void addCustomer(Customer customer){ customer.setCreatedDate(new Date()); getHibernateTemplate().save(customer); } public List<Customer> findAllCustomer(){ return

Auto-reload changed files in Java

一曲冷凌霜 提交于 2019-12-12 08:07:17
问题 I have a lot of configuration files that modify how my application behaves. I want to be able to make a change and it gets reflected in the application right away when saving the file. Is there a Java library to help with this? I could simply keep a list of files with their timestamps and continuously check in a background thread when a timestamp changes. Doesn't seem too difficult, but maybe there's a more efficient way to do this? Custom triggers when certain properties have changed would

glassfish in eclipse doesn't seem to see my JDK

坚强是说给别人听的谎言 提交于 2019-12-12 08:00:42
问题 I am trying to get glassfish working in eclipse, and running into the JRE vs JDK error: GlassFish v3 requires a JDK 1.6 and not a JRE. Please add/select the correct JDK in the Server properties 'Runtime Environment' section. I googled around and it seems a bunch of people had this issue. Sure enough in preferences->Server-> Runtime Environment when I clicked edit on the glassfish server runtime environment the JRE was "default JRE". I clicked the dropdown menu and switched it to my JDK: java

Custom JSP tag - How do I get the body of the tag?

徘徊边缘 提交于 2019-12-12 07:50:01
问题 I have a custom jsp tag like this: <a:customtag> The body of the custom tag... More lines of the body... </a:customtag> In the custom tag, how can I get the text of what the body is? 回答1: It's complicated because there are two mechanisms. If you're extending SimpleTagSupport, you get getJspBody() method. It returns a JspFragment that you can invoke(Writer writer) to have the body content written to the writer. You should use SimpleTagSupport unless you have a specific reason to use

“package javax.inject does not exist” error while compiling with javac in commandline

女生的网名这么多〃 提交于 2019-12-12 07:49:35
问题 I'm making my first steps toward learning JSF. I found this interesting book called "Core JavaServer Faces Third Edition". Trying to compile the first example, you can download the source code from: http://horstmann.com/corejsf/. When I type the following on the command-line javac UserBean.java I get errors: package javax.inject does not exist package javax.enterprise.context doe not exist I have downloaded Java EE, Ant and GlassFish. Here is a snap of my command-line: C:\JSF-Tutorial

Multi tenancy support in Java EE 6

假装没事ソ 提交于 2019-12-12 07:46:35
问题 I have an existing Java EE 6 application (deployed in Glassfish v 3.1) and want to support multiple tenants. Technologies/APIs I'm currently using in my app are EJB (including the EJB timer service) JPA 2.0 (EclipseLink) JSF 2.0 JMS JAX-RS I plan to use CDI as well As far as I know, adding multi-tenancy support affects only the persistence layer. My question: Has anybody done this before? What are the steps to convert the application? Will this affect other layers other than persistence?

What is an EJB, and what does it do?

南笙酒味 提交于 2019-12-12 07:29:22
问题 Been trying to learn what EJB beans are, what does it mean their instances are managed in a pool, blah blah. Really can't get a good grip of them. Can you explain me what they really are (practically for a Java Programmer)? What do they do? Which are their purposes? Why really use them? (Why not just stick to POJO ?) Perhaps an example application? Please refer only to updated information, that is EJB 3.1 . Dated information about EJB can be misleading. For EJB learning beginners please note:

Mojarra 2.1.0 - FCS doesn't work with tomcat 7

馋奶兔 提交于 2019-12-12 07:24:00
问题 i am using JSF 2.1 ( Mojarra 2.1.0 - FCS ) with tomcat 7 as follows: <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.1.0-b11</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.0-b11</version> <scope>compile</scope> </dependency> when i tried to run it on tomcat 7 i got the following exception: java.lang.InstantiationException: com.sun.faces.application