[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3612) examples should demonstrate obtaining entity manager factory from JNDI via persistence unit reference
by Dan Allen (JIRA)
examples should demonstrate obtaining entity manager factory from JNDI via persistence unit reference
-----------------------------------------------------------------------------------------------------
Key: JBSEAM-3612
URL: https://jira.jboss.org/jira/browse/JBSEAM-3612
Project: Seam
Issue Type: Feature Request
Components: Examples
Affects Versions: 2.1.0.GA
Reporter: Dan Allen
Priority: Minor
Fix For: 2.1.1.CR1
For any example that is deploying to a standard Java EE 5 environment (for instance the jpa example deploying to GlassFish or JBoss AS 5), the entity manager factory should be obtained through JNDI through a persistence unit reference.
5.3.1 of JPA spec:
"Within a Java EE environment, an entity manager factory may be injected using the Persistence-Unit annotation or obtained through JNDI lookup."
It would first need to be declared in web.xml:
<persistence-unit-ref>
<persistence-unit-ref-name>bookingDatabase/emf</persistence-unit-ref-name>
<persistence-unit-name>bookingDatabase</persistence-unit-name>
</persistence-unit-ref>
Then the components.xml would look like this:
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:comp/env/bookingDatabase/emf" />
The reason we should do this is to advocate the Java EE standard approach.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3643) "Group by" paging failed
by Kenneth Zhang (JIRA)
"Group by" paging failed
------------------------
Key: JBSEAM-3643
URL: https://jira.jboss.org/jira/browse/JBSEAM-3643
Project: Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.1.0.GA
Environment: JBoss 4.2.3GA, Seam 2.1.0GA,JDK 1.5.0_16
Reporter: Kenneth Zhang
GroupBy is a new function at seam 2.1.0GA, but it cannot work with paging.
This is the test code:
@Name("bookStat")
public class BookStat extends EntityQuery<Book> {
private static final String EJBQL = "select name, count(*) from Book book";
(snip)
public BookStat() {
setEjbql(EJBQL);
setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
setMaxResults(3);
setGroupBy("name");
}
(snip)
}
There is the error log:
13:05:09,578 INFO [STDOUT] Hibernate:
select
count(*) as col_0_0_
from
test_seam.dbo.BOOK book0_
group by
book0_.name
Caused by: javax.persistence.NonUniqueResultException: result returns 21 elements
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:85)
at org.jboss.seam.framework.EntityQuery.initResultCount(EntityQuery.java:129)
at org.jboss.seam.framework.EntityQuery.getResultCount(EntityQuery.java:120)
at org.jboss.seam.framework.Query.getPageCount(Query.java:202)
at org.jboss.seam.framework.Query.getLastFirstResult(Query.java:163)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3551) Seam can not convert java.util.Date, it ignores javax.faces.convert.DateTimeConverter
by Francisco Jose Peredo Noguez (JIRA)
Seam can not convert java.util.Date, it ignores javax.faces.convert.DateTimeConverter
-------------------------------------------------------------------------------------
Key: JBSEAM-3551
URL: https://jira.jboss.org/jira/browse/JBSEAM-3551
Project: Seam
Issue Type: Bug
Affects Versions: 2.0.2.SP1
Environment: Jdk 1.5. Tomcat 6.0.18, Jboss Tools 2.1.2
Reporter: Francisco Jose Peredo Noguez
Create a Seam project using Jboss Tools 2.1.2.
Create a new Seam Form with name "SeamDateForm"
Open the file SeamDateForm.java and change the value from Integer to java.util.Date.
Right-click seamDateForm.xhtml and click Run As... -> Run On Server.
Write something in the form (like for example some random string "dfasdf")
You will get the error: Conversion Error setting value 'dfasdf' for 'null Converter'.
Now create a Date Converter, as the one included in the attached test case project (BTW it inherits from javax.faces.convert.DateTimeConverter).
Stop the application (just to be 100% sure everything gets loaded correctly)
Again:
Right-click seamDateForm.xhtml and click Run As... -> Run On Server.
Write something in the form (like for example some random string "dfasdf")
Now you get the right error: value must be a date, eg. 10/13/2008.
Of course it not only fails when you write a random string, even if you write a correct date, like 01/01/2001, you will get an error that says: Conversion Error setting value '01/01/2001' for 'null Converter'. But if you write your own converter (for example inheriting from javax.faces.convert.DateTimeConverter) everything works fine.
I think Seam should use javax.faces.convert.DateTimeConverter by default, I shouldn't need to create my own converter.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3534) Problem sending email in Glassfish v2
by Rodrigo Saito (JIRA)
Problem sending email in Glassfish v2
-------------------------------------
Key: JBSEAM-3534
URL: https://jira.jboss.org/jira/browse/JBSEAM-3534
Project: Seam
Issue Type: Bug
Components: Mail
Affects Versions: 2.1.0.CR1
Environment: Glassfish v2
Reporter: Rodrigo Saito
Assignee: Pete Muir
In jboss the example application works fine, but in glassfish v2 it throws an exception.
Caused by: java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(File.java:363)
at org.jboss.seam.mock.MockServletContext.<init>(MockServletContext.java:44)
at org.jboss.seam.ui.facelet.MockServletContextManager.create(MockServletContextManager.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:126)
at org.jboss.seam.Component.callComponentMethod(Component.java:2154)
at org.jboss.seam.Component.callCreateMethod(Component.java:2077)
at org.jboss.seam.Component.newInstance(Component.java:2037)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 2 months