PerShing2014 / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

For OC4J distributable applications objects bound to a session need to be Serializable #271

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When using jMesa 2.5 in a distributable web application that runs in Oracle 
OC4J 10.1.3, I get the exception below when processing a worksheet:

protected void saveWorksheet(Worksheet worksheet) {
    worksheet.processRows(new WorksheetCallbackHandler() {
        public void process(WorksheetRow worksheetRow) {
            ...

Exception:

java.lang.IllegalArgumentException: Only java.io.Serializable, 
javax.ejb.EJBObject and javax.ejb.EJBHome instances can be bound to a session 
in a distributable web-application, not: 
org.jmesa.worksheet.WorksheetImpl@1fc671[id=allAccountsTable,rows={}] (class 
org.jmesa.worksheet.WorksheetImpl)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:150)
    at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:137)
    at org.jmesa.web.HttpServletRequestWebContext.setSessionAttribute(HttpServletRequestWebContext.java:118)
    at org.jmesa.worksheet.state.SessionWorksheetState.persistWorksheet(SessionWorksheetState.java:39)
    at org.jmesa.facade.TableFacadeImpl.getWorksheet(TableFacadeImpl.java:196)
    at org.jmesa.facade.TableFacadeImpl.setItems(TableFacadeImpl.java:395)
    at org.jmesa.facade.TableFacadeTemplate.setup(TableFacadeTemplate.java:100)
    at org.jmesa.facade.TableFacadeTemplate.render(TableFacadeTemplate.java:47)
...

This problem goes away and everything works fine if I modify the following 
classes to implement java.io.Serializable:

org.jmesa.worksheet.WorksheetImpl
org.jmesa.core.message.ResourceBundleMessages

Could you please implement java.io.Serializable in these classes? (and any 
other classes that may be bound to a session)

Original issue reported on code.google.com by horaciog...@gmail.com on 22 Jun 2010 at 12:33

GoogleCodeExporter commented 8 years ago
I have those changed now. We are also doing another build soon so this will be 
part of that. Sounds like you have a custom build to work with for now...

Original comment by jeff.johnston.mn@gmail.com on 22 Jun 2010 at 2:06

GoogleCodeExporter commented 8 years ago
Many thanks for your quick response!

Yes we have a custom build for now. In a previous application we copied and 
modified the source code. In a new application we are using AspectJ 
introductions to make those classes implement Serializable.

Original comment by horaciog...@gmail.com on 22 Jun 2010 at 2:15

GoogleCodeExporter commented 8 years ago
Sounds good. I made the WorksheetColumn and WorksheetRow Serializable as well.

Also, if you use any of the new Worksheet features that came out in 2.5 you 
should let me know how they worked out for you. We are trying to get feedback 
on the new features. Feel free to write me directly at 
jeff.johnston.mn@gmail.com if you start using them and have any input!

Original comment by jeff.johnston.mn@gmail.com on 22 Jun 2010 at 2:42

GoogleCodeExporter commented 8 years ago
This should be fixed now...closing it out.

Original comment by jeff.johnston.mn@gmail.com on 9 Mar 2011 at 7:53