java-ee-6

Number format exception when returning values from database(JPA)

廉价感情. 提交于 2019-12-25 03:51:18
问题 I want to fill a simple h:datatable tag with some values from a database. But i get an exception and i cant find what is the reason: java.lang.NumberFormatException: For input string: "url" This is how i create the datatable: <h:form> <h:dataTable value="#{managementBB.retrieveRecords()}" var="record"> <h:column> <f:facet name="header">URL</f:facet> #{record.url} </h:column> <h:column> <f:facet name="header">Submition date</f:facet> #{record.submitionDate} </h:column> <h:column> <f:facet name

Jsr303 Bean Validation error message without prefix of form and field name

两盒软妹~` 提交于 2019-12-25 01:48:49
问题 I'm using bean validation and extval validation. I've created a properties file called ValidationMessages.properties inside my class path. inside this file i customized the defult messages , for example: javax.validation.constraints.Size.message=this is a test messgae when the fieild is being validated I can see the message I worte, but the problem is that I also see the field and form name before the message ' like this: formName:fieldName this is a test . I want to remove this prefix. when

Using Hibernate Ejb3Configuration with Container Management

穿精又带淫゛_ 提交于 2019-12-25 01:43:00
问题 Is there a way to use programmatic configuration provided by Ejb3Configuration with container managed entity management? I would like to dynamically add (additional) annotated classes that were discovered via ServiceLoader after the persistence.xml is processed. I attempted to extend HibernatePersistence override the createContainerEntityManagerFactory method where I added the functionality to add the classes but I found two problems: 1) When I attempt to call the EjbConfiguration instances

finalize method in MessageDrivenBean

安稳与你 提交于 2019-12-24 14:12:32
问题 Message-Driven Bean Class the requirements of a message-driven bean class: It must not define the finalize method. What is the reason for above requirement ? 回答1: If you look in the EJB spec, you will see that it is a requirement for all types of EJB. http://download.oracle.com/otndocs/jcp/ejb-3.1-pfd-oth-JSpec/ I can't find a definitive answer but looking on various Java forums over the last 13 years, you can see answers consistently saying that, because the container will decide the life

CDI inject into existing object

旧街凉风 提交于 2019-12-24 10:26:36
问题 Let's say I have the following class: public class MyRequestPayload implements RequestPayload { protected MyRequestPayload() {} @Override public ResponsePayload process() { String result = someService.doSomething(foo, bar); return new MyResponsePayload(result); } public final String foo; public final Integer bar; @Inject private SomeService someService; } Is there some CDI service I can invoke that will process all the @Inject annotations on an instance of this class, injecting all the

Do I need frameworks to complement a Java EE 6, JSF-2 Web-App? Which ones?

ぐ巨炮叔叔 提交于 2019-12-24 08:31:59
问题 In the previous J2EE versions, it was common practice to complement the default libraries with frameworks like Spring, Hibernate, Struts, etc. Java EE 6 seemed to close the gap (with CDI, JPA, JSF2.0, etc.) - should I still use additional frameworks (Seam? A faces library? Spring?) I am currently using the default Oracle stack - GlassFish v3, JSF (Mojarra) 2.0 回答1: The common practice in J2EE 1.3 and J2EE 1.4 was indeed to supplement the J2EE stack with quite a lot of additional frameworks.

Does Java EE 6 framework only for Web Application Or can I use it for Client Application as well

二次信任 提交于 2019-12-24 04:47:06
问题 I always use Jave EE 6 framework for web application. So I am not sure what I about to do is correct. I need to create an native client command-line application that has database access. So simple java Project with JDBC would do that job. But the requirements for db access include connection pool, concurrency handle, and transaction ..., Now the requirement of the projects does eventually build a web interface, but first it will build a command line application first. And this is when i am

Why can't I inject 2 EJB's into 2 different managed beans that inject each other?

蹲街弑〆低调 提交于 2019-12-24 04:34:05
问题 ContactsBean @Named(value = "contactsBean") @SessionScoped public class ContactsBean implements Serializable { @EJB ContactsFacade contactsEJB; private List<Contacts> contacts = new ArrayList<Contacts>(); @Inject DetailsBean detailsBean; Details Bean @Named(value = "detailsBean") @RequestScoped public class DetailsBean { @EJB ContactsFacade contactsEJB; private Contacts detailsContact = new Contacts(); I can't do this. Whenever I called the EJB in details bean it throws EJB exception and this

Server page redirected to Filer before Login

大兔子大兔子 提交于 2019-12-24 02:56:25
问题 I have just deployed an Application which has a login page. Upon logging in with the "right" password and "username" however, the index.xhtml gets an error and gets ALWAYS redirected to the filter( a sessions time out) that has been configured. What are the reasons for the redirection? I made a check to see if the session was invalid, but no that was not the case. Here is the web.xml(part) where the filter has been set. Error: javax.faces.application.ViewExpiredException: viewId:/index.xhtml

EclipseLink does not work on Netbeans, is this normal?

时光怂恿深爱的人放手 提交于 2019-12-24 02:15:06
问题 It'll be weeks that I'm stuck with EclipseLink. I can not persist an object in my database. I use netbeans 7.3. I encountered this problem when I started designing a web application. What follows is the approach I have adopted. It may be that I do without me realize a mistake. After that netbeans has finished generating the project files I configured the jndi. Then I converted automatically with netbeans, the database tables in entity object. here is the link then, from these classes, I