[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1792) Configure PersistenceContextName in EntityHome/EntityQuery using annotation
by Thom Neumann (JIRA)
Configure PersistenceContextName in EntityHome/EntityQuery using annotation
---------------------------------------------------------------------------
Key: JBSEAM-1792
URL: http://jira.jboss.com/jira/browse/JBSEAM-1792
Project: JBoss Seam
Issue Type: Patch
Components: Core
Affects Versions: 2.0.0.BETA1, 1.2.1.GA
Reporter: Thom Neumann
Priority: Minor
Fix For: 2.0.0.BETA1
Classes extending EntityHome/EntityQuery can configure the used persistenceContext by overriding getPersistenceContextName returning the desired ContextName. This is a patch proposing the use of @PersistenceContext(name="foo") to set the desired context name:
<<snip
diff -Naur jboss-seam-2.0.0.BETA1/src/main/org/jboss/seam/framework/EntityHome.java jboss-seam-2.0.0.BETA1.patched/src/main/org/jboss/seam/framework/EntityHome.java
--- jboss-seam-2.0.0.BETA1/src/main/org/jboss/seam/framework/EntityHome.java 2007-06-27 08:37:14.000000000 +0200
+++ jboss-seam-2.0.0.BETA1.patched/src/main/org/jboss/seam/framework/EntityHome.java 2007-08-13 11:46:41.000000000 +0200
@@ -1,6 +1,7 @@
package org.jboss.seam.framework;
import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.persistence.PersistenceProvider;
@@ -98,7 +99,10 @@
@Override
protected String getPersistenceContextName()
{
- return "entityManager";
+ final PersistenceContext ctx =
+ getClass().getAnnotation(PersistenceContext.class);
+
+ return null == ctx ? "entityManager" : ctx.name();
}
}
diff -Naur jboss-seam-2.0.0.BETA1/src/main/org/jboss/seam/framework/EntityQuery.java jboss-seam-2.0.0.BETA1.patched/src/main/org/jboss/seam/framework/EntityQuery.java
--- jboss-seam-2.0.0.BETA1/src/main/org/jboss/seam/framework/EntityQuery.java 2007-06-27 08:37:14.000000000 +0200
+++ jboss-seam-2.0.0.BETA1.patched/src/main/org/jboss/seam/framework/EntityQuery.java 2007-08-13 11:47:16.000000000 +0200
@@ -4,6 +4,7 @@
import java.util.Map;
import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.persistence.QueryParser;
@@ -128,7 +129,10 @@
@Override
protected String getPersistenceContextName()
{
- return "entityManager";
+ final PersistenceContext ctx =
+ getClass().getAnnotation(PersistenceContext.class);
+
+ return null == ctx ? "entityManager" : ctx.name();
}
protected javax.persistence.Query createQuery()
<<snep
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1789) s:transformImageSize maintainRatio=false and only width or height set causes NPE
by henrik lindberg (JIRA)
s:transformImageSize maintainRatio=false and only width or height set causes NPE
--------------------------------------------------------------------------------
Key: JBSEAM-1789
URL: http://jira.jboss.com/jira/browse/JBSEAM-1789
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Reporter: henrik lindberg
Priority: Minor
When using s:transformImageSize without maintainRatio=true (or explicetly set to false) and only specifying one of width or height a NPE occurs because Image code assumes both to be available.
The excpetion is thrown in UITransformImageSize.java, on line 45
else
{
image.resize(new Integer(getWidth()), new Integer(getHeight())); // this is line 45
}
Asking for an image to be rescaled along just one dimension and at the same time not specifying that ratio should be maintained can't possibly produce a valid result, but code could produce an error message that it is an illegal request
This is a minor usability issue IMO.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1784) LocaleSelector should use "_" instead of "-_" when tokenizing localeStrings
by Devon Hillard (JIRA)
LocaleSelector should use "_" instead of "-_" when tokenizing localeStrings
---------------------------------------------------------------------------
Key: JBSEAM-1784
URL: http://jira.jboss.com/jira/browse/JBSEAM-1784
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1, 1.3.0.ALPHA, 1.2.1.GA, 1.2.0.GA
Environment: jboss 4.2.0, OS X and Debian, JDK 1.5
Reporter: Devon Hillard
The method LocaleSelector.setLocaleString on line 126 parses the localeString parameter using "-_" to split up the language, country, and variant. The standard split is "_".
The getLocaleString method returns the Locale's toString result, which is delmited with the standard "_" character.
When you have a locale selector:
<h:selectOneMenu value="#{localeSelector.localeString}">
if you have a language with a country (or variant), you can make it select by using the "-_" split, however since the get method returns the other string, it won't show the current locale correctly.
The fix should be to just change the string used in the tokenizer.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1757) @DataModel on a getter broken on Statefull beans.
by Sanne Grinovero (JIRA)
@DataModel on a getter broken on Statefull beans.
-------------------------------------------------
Key: JBSEAM-1757
URL: http://jira.jboss.com/jira/browse/JBSEAM-1757
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Reporter: Sanne Grinovero
Priority: Minor
When using "@DataModel" to annotate a getter method of a statefull bean (instead as annotating a field) an exception is thrown.
It used to work as expected in previous releases, as tested on 1.0.1 , 1.1.0, 1.1.6, 1.2.1.
StackTrace quote:
Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: BrokenList.getTestData() with parameters: (java.util.ArrayList) on: org.jboss.seam.example.pdf.BrokenList
at org.jboss.seam.util.Reflections.invoke(Reflections.java:31)
at org.jboss.seam.Component.setPropertyValue(Component.java:1656)
... 108 more
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
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:21)
patch to reproduce, to be applied on the booking example (2.0.0.BETA1):
--- booking/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2007-06-27 08:37:23.
000000000 +0200
+++ booking-broken/src/org/jboss/seam/example/booking/HotelSearchingAction.java 2007-08-03 01:26:12.
000000000 +0200
@@ -30,6 +30,7 @@
private int page;
@DataModel
+ public List<Hotel> getHotels(){ return hotels; }
private List<Hotel> hotels;
public void find()
diff -ur booking/src/org/jboss/seam/example/booking/HotelSearching.java booking-broken/src/org/jboss
/seam/example/booking/HotelSearching.java
--- booking/src/org/jboss/seam/example/booking/HotelSearching.java 2007-06-27 08:37:19.00000000
0 +0200
+++ booking-broken/src/org/jboss/seam/example/booking/HotelSearching.java 2007-08-03 01:28:01.
000000000 +0200
@@ -1,7 +1,8 @@
//$Id: HotelSearching.java,v 1.12 2007/06/27 00:06:49 gavin Exp $
package org.jboss.seam.example.booking;
-import javax.ejb.Local;
+import javax.ejb.Local;
+import java.util.List;
@Local
public interface HotelSearching
@@ -19,5 +20,7 @@
public boolean isNextPageAvailable();
public void destroy();
+
+ public List<Hotel> getHotels();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1731) NullPointerException in Pages.java
by Matt Drees (JIRA)
NullPointerException in Pages.java
----------------------------------
Key: JBSEAM-1731
URL: http://jira.jboss.com/jira/browse/JBSEAM-1731
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.BETA1
Environment: seam-20070727.0009
Reporter: Matt Drees
Priority: Minor
When I open up the facelets debug page, I get this stacktrace:
java.lang.NullPointerException
at org.jboss.seam.navigation.Pages.isDebugPage(Pages.java:1470)
at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:513)
at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:374)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:211)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:184)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
...
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
I'm fairly sure it's being caused by the code on line 1473:
getCurrentViewId().startsWith("/debug.");
>From debugging it, I can see that getCurrentViewId() returns null. I'm not sure why it's null, or why the stacktrace says the nullpointer exception is on line 1470.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 8 months