[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1633) Mock Log
by Bieth Bruno (JIRA)
Mock Log
--------
Key: JBSEAM-1633
URL: http://jira.jboss.com/jira/browse/JBSEAM-1633
Project: JBoss Seam
Issue Type: Feature Request
Reporter: Bieth Bruno
Priority: Minor
I would like to unit test a Seam SFSB which uses an injected logger.
I didn't find any MockLog so I use the logging factory like that :
Code:
setField( editor, "log", Logging.getLog( "test" ) );
It solves the NullPointerException and the test are working fine but when logging, the Interpolator try to access the context which doesnt exist and throws an IllegalStateException ...
It may be useful to have a mockLog method in the SeamTest class which look for a @Logger annotation and inject a MockLog. The MockLog will basically print any log on the console.
--
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
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2418) Cannot use non-POJO Hibernate entities with Seam-managed Session
by Dave Sunerton-Burl (JIRA)
Cannot use non-POJO Hibernate entities with Seam-managed Session
----------------------------------------------------------------
Key: JBSEAM-2418
URL: http://jira.jboss.com/jira/browse/JBSEAM-2418
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.0.GA
Environment: WinXP, JBoss4.2
Reporter: Dave Sunerton-Burl
When trying to use the Map-based mode of a Hibernate session, I get the error below. First, here's the code that causes the error...
final Session session = (Session) Component.getInstance("dynamicSession");
final Session mapSession = session.getSession(EntityMode.MAP);
final Map record = (Map) mapSession.get("TestEntity", 10001l);
...the last line causes...
java.lang.AssertionError: java.lang.IllegalArgumentException: Not an entity class: java.util.HashMap
at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:475)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:526)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:514)
at com.fugro.traxx.entities.DynamicEntityTest.changeMappingsAtRuntime(DynamicEntityTest.java:88)
Caused by: java.lang.IllegalArgumentException: Not an entity class: java.util.HashMap
at org.jboss.seam.Entity.forClass(Entity.java:208)
at org.jboss.seam.persistence.PersistenceProvider.getPostLoadMethod(PersistenceProvider.java:154)
at org.jboss.seam.security.Identity.checkEntityPermission(Identity.java:678)
at org.jboss.seam.security.HibernateSecurityInterceptor.onLoad(HibernateSecurityInterceptor.java:35)
at org.hibernate.event.def.DefaultPreLoadEventListener.onPreLoad(DefaultPreLoadEventListener.java:18)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:125)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1851)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2992)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at com.fugro.traxx.entities.DynamicEntityTest$3.invokeApplication(DynamicEntityTest.java:104)
at org.jboss.seam.mock.BaseSeamTest$Request.invokeApplicationPhase(BaseSeamTest.java:652)
at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:598)
at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:185)
at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:519)
... 40 more
... Removed 22 stack frames
"dynamicSession" is declared in components.xml as...
<persistence:managed-hibernate-session auto-create="true" name="dynamicSession"/>
The error seems to be connected to the HibernateSecurityInterceptor, which tries to get hold of a real class from the mapping (which doesn't exist - this is a non-POJO mapping). My workaround involved replacing the "org.jboss.seam.persistence.HibernateSessionFactory" with my own implementation which didn't add the interceptor (I will have to do without declarative security on the dynamic entities).
--
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
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2552) Restructure UIFileUpload.processUpdates code
by Kenneth Christensen (JIRA)
Restructure UIFileUpload.processUpdates code
--------------------------------------------
Key: JBSEAM-2552
URL: http://jira.jboss.com/jira/browse/JBSEAM-2552
Project: JBoss Seam
Issue Type: Feature Request
Components: JSF Controls
Affects Versions: 2.0.1.CR2
Environment: Seam 2.0.1.CR2
Reporter: Kenneth Christensen
Will it be possible to restructure code in the UIFileUpload.processUpdates (s:fileUpload)?
>From - Original:
{code}
public void processUpdates(FacesContext context)
{
ValueExpression dataBinding = getValueExpression("data");
if (dataBinding != null)
{
Class clazz = dataBinding.getType(context.getELContext());
if (clazz.isAssignableFrom(InputStream.class))
{
dataBinding.setValue(context.getELContext(), getLocalInputStream());
}
else if (clazz.isAssignableFrom(byte[].class))
{
byte[] bytes = null;
if (getLocalInputStream() != null)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try
{
byte[] buffer = new byte[512];
int read = getLocalInputStream().read(buffer);
while (read != -1)
{
bos.write(buffer, 0, read);
read = getLocalInputStream().read(buffer);
}
bytes = bos.toByteArray();
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
dataBinding.setValue(context.getELContext(), bytes);
}
if (getLocalContentType() != null)
{
ValueExpression valueExpression = getValueExpression("contentType");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalContentType());
}
}
if (getLocalFileName() != null)
{
ValueExpression valueExpression = getValueExpression("fileName");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalFileName());
}
}
if (getLocalFileSize() != null)
{
ValueExpression valueExpression = getValueExpression("fileSize");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalFileSize());
}
}
}
}
{code}
To - Restructured:
{code}
public void processUpdates(FacesContext context)
{
ValueExpression dataBinding = getValueExpression("data");
if (dataBinding != null)
{
if (getLocalContentType() != null)
{
ValueExpression valueExpression = getValueExpression("contentType");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalContentType());
}
}
if (getLocalFileName() != null)
{
ValueExpression valueExpression = getValueExpression("fileName");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalFileName());
}
}
if (getLocalFileSize() != null)
{
ValueExpression valueExpression = getValueExpression("fileSize");
if (valueExpression != null)
{
valueExpression.setValue(context.getELContext(), getLocalFileSize());
}
}
Class clazz = dataBinding.getType(context.getELContext());
if (clazz.isAssignableFrom(InputStream.class))
{
dataBinding.setValue(context.getELContext(), getLocalInputStream());
}
else if (clazz.isAssignableFrom(byte[].class))
{
byte[] bytes = null;
if (getLocalInputStream() != null)
{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try
{
byte[] buffer = new byte[512];
int read = getLocalInputStream().read(buffer);
while (read != -1)
{
bos.write(buffer, 0, read);
read = getLocalInputStream().read(buffer);
}
bytes = bos.toByteArray();
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
dataBinding.setValue(context.getELContext(), bytes);
}
}
}
{code}
and/or what about a fileupload event, when upload is finish?
I really need setFileName(), setFileSize() and setContentType() to be called first - before setData() !
--
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
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2532) org.jboss.seam.pdf.DocumentData needs to be serializable
by Samuel Mendenhall (JIRA)
org.jboss.seam.pdf.DocumentData needs to be serializable
--------------------------------------------------------
Key: JBSEAM-2532
URL: http://jira.jboss.com/jira/browse/JBSEAM-2532
Project: JBoss Seam
Issue Type: Bug
Components: PDF
Reporter: Samuel Mendenhall
In a cluster accessing a pdf, the following exception is generated:
java.io.NotSerializableException: org.jboss.seam.pdf.DocumentData
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.HashMap.writeObject(HashMap.java:1000)
at sun.reflect.GeneratedMethodAccessor810.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.concurrent.ConcurrentHashMap.writeObject(ConcurrentHashMap.java:1244)
at sun.reflect.GeneratedMethodAccessor812.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at org.jboss.web.tomcat.service.session.SessionBasedClusteredSession.writeExternal(SessionBasedClusteredSession.java:175)
at org.jboss.web.tomcat.service.session.JBossCacheService.externalizeSession(JBossCacheService.java:1027)
at org.jboss.web.tomcat.service.session.JBossCacheService.putSession(JBossCacheService.java:316)
at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.processSessionRepl(JBossCacheClusteredSession.java:121)
at org.jboss.web.tomcat.service.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:1097)
at org.jboss.web.tomcat.service.session.JBossCacheManager.storeSession(JBossCacheManager.java:652)
at org.jboss.web.tomcat.service.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:49)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:98)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
--
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
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2497) s:fileUpload should only store uploaded file name, not the full path
by Alex Savitsky (JIRA)
s:fileUpload should only store uploaded file name, not the full path
--------------------------------------------------------------------
Key: JBSEAM-2497
URL: http://jira.jboss.com/jira/browse/JBSEAM-2497
Project: JBoss Seam
Issue Type: Feature Request
Reporter: Alex Savitsky
Priority: Optional
i know, it's not Seam issue per se, more like stupid programming of Internet Explorer - when uploading files, IE sends the full path of the uploaded file ("C:\\Path\\FileName.txt") rather than just the file name. So far, I haven't seen an upload use case that would require full path to be stored - usually, only the file name is required. Thus, I'd suggest that s:fileUpload either a) chops the path out or b) at least gives us such option (e.g., a parameter to s:fileUpload)
--
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
16 years, 11 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1322) MutlipartRequest parser occasionally throws ArrayIndexOutOfBoundsException
by ROB b (JIRA)
MutlipartRequest parser occasionally throws ArrayIndexOutOfBoundsException
--------------------------------------------------------------------------
Key: JBSEAM-1322
URL: http://jira.jboss.com/jira/browse/JBSEAM-1322
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.2.1.GA, 1.2.0.GA
Environment: Windows Vista, Java 1.6u1, JBoss Seam 1.2.1, JBoss AS 4.0.5.GA
Reporter: ROB b
During an upload, the MultipartRequest checkSequence function does not to proper boundary checking on function parameters. It will occasionally (rarely actually) throw an ArrayIndexOutOfBoundsException at the high end due to the +1 offset when accessing the data array.
I'm not actually sure why this +1 is there and was wondering if somehow it was a mistake. This class is a little hard to follow, so I'm not sure how everything works, but the function description seems to indicate that it is checking for the end of a byte array at a specific location which is 0-indexed, but the +1 would seem to indicate otherwise.
The following exception gets thrown:
java.lang.ArrayIndexOutOfBoundsException: 2048
at org.jboss.seam.web.MultipartRequest.checkSequence(MultipartRequest.java:466)
at org.jboss.seam.web.MultipartRequest.parseRequest(MultipartRequest.java:333)
at org.jboss.seam.web.MultipartRequest.getParam(MultipartRequest.java:507)
at org.jboss.seam.web.MultipartRequest.getParameter(MultipartRequest.java:558)
at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:39)
at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:87)
at com.sun.facelets.tag.ui.UIDebug.debugRequest(UIDebug.java:119)
at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:305)
at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:147)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
--
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
16 years, 11 months