[JBoss Seam] - Re: Implementing a multi-select table
by texan
That's a novel approach that I wouldn't have thought of.
I also think that it wouldn't be too bad to wrap the bean in a decorator class, as Jazir suggested, except for the small overhead of creating a wrapper for each instance in your collection.
For myself, I went low-budget and just added a "selected" attribute to the domain object. While this in an old anti-pattern (failing to decouple your business logic from your UI logic), I've begun to have more tolerance for that in recent years, probably due to the easy refactoring capabilities of Eclipse. That is, most patterns like that exist for a couple of reasons: (1) avoid having to change too much code when the UI changes, and (2) allowing you to reuse your business objects in multiple UI implementations. We all got excited at the prospect of #2 several years ago, but after about 10 years of Java development, I have actually never had more than one UI for an application. I guess I've led a sheltered life.
Anyway, now I don't worry too much about that sort of thing, and Seam certainly makes it easy to violate a few (hopefully outdated) patterns like this.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979666#3979666
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979666
19 years, 8 months
[JBoss Seam] - Classloader error with seam jboss-seam-1.1-CVS20061016.jar
by pvtruong
I'm using the newest version of seam from CVS and I'm getting a weird class loader error that I wasn't getting from Seam 1.0.1. I have a edit page which edits an application.
On load, it invokes the method ApplicationEditManager.edit() to prepare some beans and display the edit page. This works fine.
On the edit page, I have a command button which should invoke ApplicationEditManager.save(). However, when I click on this button, the exception is thrown below.
Any ideas why this would happen with the newer version of seam? Below is the exception and my code. Thanks for the help.
EXCEPTION:
09:33:51,856 INFO [RequestDumper] doFilter( )
09:33:51,856 INFO [RequestDumper] request.getRequestURI=/access/application_edit.seam
09:33:51,856 INFO [RequestDumper] request.getRequestURL=http://deibkst-j7yvlb1.noam.msds.wachovia.net:8080/access/appli
cation_edit.seam
09:33:51,856 INFO [RequestDumper] request.getRemoteUser=X488359
09:33:51,856 INFO [RequestDumper] request.getAuthType=EVERGREEN_SSO
09:33:51,856 INFO [RequestDumper] request.getUserPrincipal=UserPrincipal{userid=X488359,firstName=Phuc,lastName=Truong,
email=PTruong(a)EvergreenInvestments.com (Evergreen Funds),phoneNumber=,personName=Phuc Truong,roles={StaticRoles[Admin],}
}
09:33:51,856 INFO [RequestDumper] Headers:
09:33:51,856 INFO [RequestDumper] host = deibkst-j7yvlb1.noam.msds.wachovia.net:8080
09:33:51,856 INFO [RequestDumper] user-agent = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.7) Gecko/200609
09 Firefox/1.5.0.7
09:33:51,871 INFO [RequestDumper] accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,*/*;q=0.5
09:33:51,871 INFO [RequestDumper] accept-language = en-us,en;q=0.5
09:33:51,871 INFO [RequestDumper] --------------- = ------------
09:33:51,871 INFO [RequestDumper] accept-charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7
09:33:51,871 INFO [RequestDumper] keep-alive = 300
09:33:51,871 INFO [RequestDumper] connection = keep-alive
09:33:51,871 INFO [RequestDumper] referer = http://deibkst-j7yvlb1.noam.msds.wachovia.net:8080/access/application_detai
ls.seam
09:33:51,871 INFO [RequestDumper] cookie = ExchangeDropDownMenus=on; JSESSIONID=235AABA9B25346C1A9DFBC5C095CAF57
09:33:51,871 INFO [RequestDumper] content-type = application/x-www-form-urlencoded
09:33:51,871 INFO [RequestDumper] content-length = 23364
09:33:51,871 INFO [RequestDumper]
Request Parameters:
09:33:51,871 INFO [RequestDumper] editApplication:_link_hidden_ =
09:33:51,871 INFO [RequestDumper] editApplication:_id49 = Save Application Changes
09:33:51,871 INFO [RequestDumper] editApplication:_id47 = true
09:33:51,871 INFO [RequestDumper] editApplication:picctId = 11111
09:33:51,871 INFO [RequestDumper] jsf_viewid = /application_edit.xhtml
09:33:51,871 INFO [RequestDumper] editApplication:businessOwnerUserid = a428302
09:33:51,871 INFO [RequestDumper] editApplication:description = My description is really great.
09:33:51,871 INFO [RequestDumper] editApplication:_id43 = Vendor
09:33:51,871 INFO [RequestDumper] editApplication:distributedSecurityAdminUserid = x488359
09:33:51,871 INFO [RequestDumper] editApplication:_id39 = 3
09:33:51,871 INFO [RequestDumper] conversationId = 2
09:33:51,871 INFO [RequestDumper] editApplication_SUBMIT = 1
09:33:51,871 INFO [RequestDumper] editApplication:name = aaaaa
09:33:51,871 INFO [RequestDumper] jsf_state_64 = rO0AB...(truncated)...
09:33:51,871 INFO [RequestDumper] jsf_tree_64 = rO0AB...(truncated)...
09:33:51,871 INFO [RequestDumper] -------------------------------------------------------------------------------------
-----------------------------------
09:33:51,918 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW(1) afterPhase
java.lang.NullPointerException
at org.jboss.seam.contexts.PageContext.getAttributeMap(PageContext.java:128)
at org.jboss.seam.contexts.PageContext.(PageContext.java:41)
at org.jboss.seam.contexts.Lifecycle.resumePage(Lifecycle.java:382)
at org.jboss.seam.jsf.AbstractSeamPhaseListener.restoreAnyConversationContext(AbstractSeamPhaseListener.java:41)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:69)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
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.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:33)
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 com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
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.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(Thread.java:595)
09:33:51,918 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW(1) afterPhase
java.lang.NullPointerException
at org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
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.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:33)
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 com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
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.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(Thread.java:595)
09:33:51,918 INFO [SeamExceptionFilter] killing transaction
09:33:51,918 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
javax.servlet.ServletException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.evergreen.accesscontrol
.ApplicationEditManager
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:33)
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 com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
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.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(Thread.java:595)
09:33:51,918 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: java.lang.ClassNotFoundException: No ClassLoaders found for: com.evergreen.accesscontrol.App
licationEditManager
at org.apache.myfaces.shared_impl.util.StateUtils.getAsObject(StateUtils.java:314)
at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:241)
at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getComponentStateToRestore(HtmlResponseStateManage
r.java:221)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState(JspStateManagerImpl.java:186)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:287)
at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:43)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255)
at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:64)
at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:317)
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.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.evergreen.filter.RequestDumper.doFilter(RequestDumper.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:33)
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 com.evergreen.fastpass.catalina.CASSSOAuthenticatorValve.invoke(CASSSOAuthenticatorValve.java:371)
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.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(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.evergreen.accesscontrol.ApplicationEditManag
er
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:657)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.util.HashMap.readObject(HashMap.java:1067)
at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.util.HashMap.readObject(HashMap.java:1067)
at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at org.apache.myfaces.shared_impl.util.StateUtils.getAsObject(StateUtils.java:305)
... 45 more
XHTML PAGE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:s="http://jboss.com/products/seam/taglib">
<ui:remove>
<!--
This is a Facelets XHTML document
Created by: A428302
Created on: Aug 24, 2006 11:18:34 AM
$Id: application_edit.xhtml,v 1.3 2006/10/19 19:48:51 x488359 Exp $
-->
</ui:remove>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
Evergreen Access Control System
<ui:include src="/header.xhtml"/>
<ui:include src="/loggedin_component.xhtml"/>
<h5>Edit Application Profile</h5>
<h:form id="editApplication">
<ui:include src="/applicationeditform.xhtml"/>
<h:commandButton value="Save Application Changes" type="submit" action="#{applicationEditManager.update}" styleClass="largeButton" onmouseover="this.className='largeButton2'" onmouseout="this.className='largeButton'" />
<h:commandButton value="Cancel" action="#{applicationManager.select}" styleClass="mediumButton" onmouseover="this.className='mediumButton2'" onmouseout="this.className='mediumButton'" />
</h:form>
<ui:debug hotkey="G"/>
JAVA CODE:
package com.evergreen.accesscontrol.impl;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.faces.model.SelectItem;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import static javax.persistence.PersistenceContextType.EXTENDED;
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Conversational;
import org.jboss.seam.annotations.Destroy;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.Factory;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.RequestParameter;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.annotations.datamodel.DataModelSelection;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.log.Log;
import com.evergreen.accesscontrol.ApplicationManager;
import com.evergreen.accesscontrol.ApplicationEditManager;
import com.evergreen.accesscontrol.EvergreenUser;
import com.evergreen.accesscontrol.entity.Application;
import com.evergreen.accesscontrol.entity.Permission;
import com.evergreen.accesscontrol.entity.Role;
import com.evergreen.accesscontrol.entity.User;
/**
* This is an EJB3 stateful session bean (SFSB).
*
* Seam Concepts here:
*
* - By default, SFSB's are bound to the conversation context. They may never
* be bound to the page or stateless contexts.
*
* - Conversational annotation - Specifies that a conversation scope component is
* conversational, meaning that no method of the component can be called unless a
* long-running conversation started by this component is active (unless the method
* would begin a new long-running conversation).
*
* - ifNotBegunOutcome ? specifies a JSF outcome for the action when the component
* is invoked and no long-running conversation is active.
* -- if you look in faces-config.xml, you'll find that "home" maps to
* index.xhtml (index.seam) for this application.
*
* @author Bradley Smith <BSmith(a)EvergreenInvestments.com>
* Date: Aug 18, 2006
* Time: 9:20:57 AM
* $Id: ApplicationEditManagerBean.java,v 1.1 2006/10/19 19:48:52 x488359 Exp $
*/
@Stateful
@Name("applicationEditManager")
@Conversational(ifNotBegunOutcome = "home")
@Scope(ScopeType.CONVERSATION)
public class ApplicationEditManagerBean implements ApplicationEditManager {
@Logger
private Log log;
@PersistenceContext(unitName = "accessControlDatabase")
private EntityManager em;
@In(create = true)
private FacesMessages facesMessages;
@In(create = true)
@Out
private Application application;
/**
* Method invoked when user clicks on edit application from the details page
* It load a fresh copy of the application based on the selected application for data entry on the edit page
*/
public String edit() {
log.info("Edit Application: " + application);
//TODO: There is a bug where if the users are the same for the ABO and DSA, then
// the edit screen will not work properly and changing the DSA will also a change the ABO
// since they are referencing the same user object.
log.info("Application ID: " + application.getId());
log.info("ABO: " + application.getBusinessOwner().getId());
log.info("DSO: " + application.getDistributedSecurityAdmin().getId());
log.info("ABO: " + application.getBusinessOwner().hashCode());
log.info("DSO: " + application.getDistributedSecurityAdmin().hashCode());
return "application_edit";
}
public String create() {
log.info("Creating application -> " + application);
// Valid the ABO and DSA user ids
if (!validateApplicationABO(application) || !validateApplicationDSA(application)) {
return "";
}
em.joinTransaction();
try {
User dsa = (User) em.createQuery("from User u where u.userid = :userid")
.setParameter("userid", this.application.getDistributedSecurityAdmin().getUserid())
.getSingleResult();
this.application.setDistributedSecurityAdmin(dsa);
} catch (NoResultException e) {
// save the requested DSA user as a new user
em.persist(this.application.getDistributedSecurityAdmin());
em.flush();
}
try {
User abo = (User) em.createQuery("from User u where u.userid = :userid")
.setParameter("userid", this.application.getBusinessOwner().getUserid())
.getSingleResult();
this.application.setBusinessOwner(abo);
} catch (NoResultException e) {
// save the requested ABO user as a new user
em.persist(this.application.getBusinessOwner());
em.flush();
}
em.persist(this.application);
((ApplicationManager) Component.getInstance("applicationManager")).refreshApplications();
return "applicationeditconfirm";
}
/**
* Validate the ABO (Application Business Owner) user id against the EPeople database.
*
* @return "True" for valid application information and "False" for invalid ids.
* Messages are automatically added the the faces messages
*/
private boolean validateApplicationABO(Application application) {
log.info("Validating ABO: " + application.getBusinessOwner());
// business owner
if (application.getBusinessOwner() == null) {
facesMessages.add("businessOwnerUserid", "Application business owner not specified.");
return false;
} else {
// validate the business owner
QueryEPeopleUtil util = new QueryEPeopleUtil(this.application.getBusinessOwner().getUserid());
boolean valid = util.isQueryValidUid() & util.getQuery().length() == 7;
if (valid) {
List users = util.findUsersForUid(false);
if (util.getMessage() == null) {
if (users != null && users.size() > 0) {
application.setBusinessOwnerProfile(users.get(0));
} else {
this.facesMessages.add("No employees found for supplied id.");
return false;
}
} else {
this.facesMessages.add("businessOwnerUserid", util.getMessage());
return false;
}
} else {
this.facesMessages.add(
"businessOwnerUserid",
this.application.getBusinessOwner().getUserid() + " is not a valid user id."
);
return false;
}
}
return true;
}
/**
* Validate the DSA (Distributed Security Admin) user id against the EPeople database.
*
* @return "True" for valid application information and "False" for invalid ids.
* Messages are automatically added the the faces messages
*/
private boolean validateApplicationDSA(Application application) {
log.info("Validating DSA: " + application.getDistributedSecurityAdmin());
// Distributed Security Admin
if (application.getDistributedSecurityAdmin() == null) {
facesMessages.add("distributedSecurityAdminUserid", "Application Distributed Security Admin (DSA) not specified.");
return false;
} else {
// validate the business owner
QueryEPeopleUtil util = new QueryEPeopleUtil(this.application.getDistributedSecurityAdmin().getUserid());
boolean valid = util.isQueryValidUid() & util.getQuery().length() == 7;
if (valid) {
List users = util.findUsersForUid(false);
if (util.getMessage() == null) {
if (users != null && users.size() > 0) {
application.setDistributedSecurityAdminProfile(users.get(0));
} else {
this.facesMessages.add("distributedSecurityAdminUserid", "No employees found for supplied id.");
return false;
}
} else {
this.facesMessages.add("distributedSecurityAdminUserid", util.getMessage());
return false;
}
} else {
this.facesMessages.add(
"distributedSecurityAdminUserid",
this.application.getDistributedSecurityAdmin().getUserid() + " is not a valid user id."
);
return false;
}
}
return true;
}
public String update() {
log.info("application (incoming) -> " + application);
if (application != null) {
boolean isValidApplication = true;
if (!application.getBusinessOwner().getUserid()
.equals(application.getBusinessOwner().getUserid())) {
// the user has changed the User Id of the ABO - validate it...
log.info("User changed ABO...");
if (!validateApplicationABO(application)) {
isValidApplication = false;
}
}
if (!application.getDistributedSecurityAdmin().getUserid()
.equals(application.getDistributedSecurityAdmin().getUserid())) {
// the user has changed the User Id of the DSA - validate it...
log.info("User changed DSA...");
if (!validateApplicationDSA(application)) {
isValidApplication = false;
}
}
if (!isValidApplication) {
return "";
}
if (application.getId() == 0) {
em.persist(application);
} else {
em.merge(application);
}
em.flush();
((ApplicationManager) Component.getInstance("applicationManager")).refreshApplications();
return "success";
}
return "";
}
public String delete(Application application) {
return null; // TODO : implement me
}
/**
* If the destroy method is not declared in the interface, Seam will throw an exception
* when the bean is destroyed.
*/
@Destroy
@Remove
public void destroy() {
// NO OP
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979662#3979662
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979662
19 years, 8 months
[JBoss Seam] - Adding/Persisting A Record Problem...
by johnurban
I have taken the Seam generated code and created a new jsp page that is similar to the original generated JSF's for the editPerson.jsp. It is called uQuickPersonAdd.jsp. It populates a dropdown with room data and needs to add/persist this record to the person table. My problem is, the PersonEditorBean.create() method never gets called. No exceptions, no validation errors. What is the trick to get the jsp to call the create method?
jsf code:
| <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
| <f:view>
| <f:loadBundle basename="messages" var="msg"/>
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
| <title>
| <h:outputText value="#{msg.Create} #{msg.Person}" rendered="#{personEditor.new}"/>
| <h:outputText value="#{msg.Update}/#{msg.Delete} #{msg.Person}" rendered="#{!personEditor.new}"/>
| </title>
| <style type="text/css" media="all">
| @import "style/default/screen.css";
| </style>
| </head>
| <body>
|
| <%@ include file="header.htm" %>
|
| <h:form>
|
| <div class="rvgFind">
| <fieldset class="rvgFieldSet">
| <legend><h:outputText value="#{msg.Person} #{msg.Attributes}"/></legend>
|
| <span class="rvgInputs">
| <span class="rvgMeassage"><h:messages globalOnly="true"/></span>
|
| <h:selectOneMenu value="#{roomFinder.example}" converter="org.jboss.seam.EntityConverter">
| <f:selectItems value="#{roomListByOrganization}" />
| </h:selectOneMenu>
|
| <h:outputLabel value="#{msg.Person_firstName}" for="firstName">
| <h:inputText value="#{personEditor.instance}" id="firstName"/>
| <span class="rvgMessage"><h:message for="firstName"/></span>
| </h:outputLabel>
| <h:outputLabel value="#{msg.Person_lastName}" for="lastName">
| <h:inputText value="#{personEditor.instance}" id="lastName"/>
| <span class="rvgMessage"><h:message for="lastName"/></span>
| </h:outputLabel>
| <h:outputLabel value="#{msg.Person_birthday}" for="birthday">
| <h:inputText value="#{personEditor.instance}" id="birthday">
| <f:convertDateTime type="date" dateStyle="short"/>
| </h:inputText>
| <span class="rvgMessage"><h:message for="birthday"/></span>
| </h:outputLabel>
|
| <span class="rvgActions">
| <h:commandButton type="submit" value="#{msg.Create}" action="#{personEditor.create}"/>
| </span>
|
| </fieldset>
| </div>
|
| </h:form>
|
| </body>
| </f:view>
| </html>
|
EJB:
| package testSeam;
|
| // Generated Sep 23, 2006 1:30:01 PM by Hibernate Tools 3.2.0.beta7
|
| import java.util.Map;
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.ejb.TransactionAttribute;
| import static javax.ejb.TransactionAttributeType.NOT_SUPPORTED;
| import javax.faces.application.FacesMessage;
| import javax.faces.context.FacesContext;
| import javax.interceptor.Interceptors;
| import javax.persistence.EntityManager;
| import org.hibernate.validator.Valid;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.End;
| import org.jboss.seam.annotations.IfInvalid;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Outcome;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.ejb.SeamInterceptor;
|
| @Name("personEditor")
| @Stateful
| @Scope(ScopeType.SESSION)
| @Interceptors(SeamInterceptor.class)
| public class PersonEditorBean implements PersonEditor {
|
| @In(create = true)
| private EntityManager entityManager;
|
| @Valid
| private Person instance = new Person();
|
| private boolean isNew = true;
|
| private String doneOutcome = "find";
|
| @TransactionAttribute(NOT_SUPPORTED)
| public Person getInstance() {
| return instance;
| }
|
| public void setInstance(Person instance) {
| this.instance = instance;
| }
|
| @TransactionAttribute(NOT_SUPPORTED)
| public boolean isNew() {
| return isNew;
| }
|
| public void setNew(boolean isNew) {
| this.isNew = isNew;
| }
|
| public void setDoneOutcome(String outcome) {
| doneOutcome = outcome;
| }
|
| @In(required = false)
| private transient PersonFinder personFinder;
|
| @In(create = true)
| private transient Map messages;
|
| @Begin(join = true)
| @LoggedIn
| @IfInvalid(outcome = Outcome.REDISPLAY)
| public String create() {
| if (entityManager.find(Person.class, instance.getId()) != null) {
| FacesContext.getCurrentInstance().addMessage(
| null,
| new FacesMessage(messages.get("Person_id") + " "
| + messages.get("AlreadyExists")));
| return null;
| }
| entityManager.persist(instance);
| isNew = false;
| refreshFinder();
| return "editPerson";
| }
|
| @IfInvalid(outcome = Outcome.REDISPLAY)
| public String update() {
| refreshFinder();
| return null;
| }
|
| @End(ifOutcome = "find")
| public String delete() {
| entityManager.remove(instance);
| refreshFinder();
| return doneOutcome;
| }
|
| @End(ifOutcome = "find")
| public String done() {
| if (!isNew)
| entityManager.refresh(instance);
| return doneOutcome;
| }
|
| private void refreshFinder() {
| if (personFinder != null)
| personFinder.refresh();
| }
|
| @Destroy
| @Remove
| public void destroy() {
| }
|
| }
|
|
Person.java
| package testSeam;
|
| // Generated Sep 23, 2006 1:30:00 PM by Hibernate Tools 3.2.0.beta7
|
| import java.util.Date;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.Id;
| import javax.persistence.Table;
| import javax.persistence.OneToOne;
|
| /**
| * Person generated by hbm2java
| */
| @Entity
| @Table(name = "person", catalog = "checkin", uniqueConstraints = {})
| public class Person implements java.io.Serializable {
|
| // Fields
|
| private int id;
|
| private int roomId;
|
| private int organizationId;
|
| private String firstName;
|
| private String middleName;
|
| private String lastName;
|
| private String address1;
|
| private String city;
|
| private String state;
|
| private String zip;
|
| private String email;
|
| private Date birthday;
|
| private Long sex;
|
| private String homePhone;
|
| private String workPhone;
|
| private String beeperPhone;
|
| private String cellPhone;
|
| private String extraPhone;
|
| private String extraPhoneMemo;
|
| private String school;
|
| private String schoolGrade;
|
| private String contact;
|
| private String parentName;
|
| private String comments;
|
| private String minsitry;
|
| private Character drama;
|
| private Character music;
|
| private Long status;
|
| private Character visitor;
|
| private Character mailList;
|
| private Character leader;
|
| private Date lastAttended;
|
| private Date created;
|
| private Date updated;
|
| private Character vcall;
|
| private Character vhouseCall;
|
| private String team;
|
| private String photoFile;
|
| private String uniqueId;
|
| // Constructors
|
| /** default constructor */
| public Person() {
| }
|
| /** minimal constructor */
| public Person(int id, int roomId, int organizationId, String firstName) {
| this.id = id;
| this.roomId = roomId;
| this.organizationId = organizationId;
| this.firstName = firstName;
| }
|
| /** full constructor */
| public Person(int id, int roomId, int organizationId, String firstName,
| String middleName, String lastName, String address1, String city,
| String state, String zip, String email, Date birthday, Long sex,
| String homePhone, String workPhone, String beeperPhone,
| String cellPhone, String extraPhone, String extraPhoneMemo,
| String school, String schoolGrade, String contact,
| String parentName, String comments, String minsitry,
| Character drama, Character music, Long status, Character visitor,
| Character mailList, Character leader, Date lastAttended,
| Date created, Date updated, Character vcall, Character vhouseCall,
| String team, String photoFile, String uniqueId) {
| this.id = id;
| this.roomId = roomId;
| this.organizationId = organizationId;
| this.firstName = firstName;
| this.middleName = middleName;
| this.lastName = lastName;
| this.address1 = address1;
| this.city = city;
| this.state = state;
| this.zip = zip;
| this.email = email;
| this.birthday = birthday;
| this.sex = sex;
| this.homePhone = homePhone;
| this.workPhone = workPhone;
| this.beeperPhone = beeperPhone;
| this.cellPhone = cellPhone;
| this.extraPhone = extraPhone;
| this.extraPhoneMemo = extraPhoneMemo;
| this.school = school;
| this.schoolGrade = schoolGrade;
| this.contact = contact;
| this.parentName = parentName;
| this.comments = comments;
| this.minsitry = minsitry;
| this.drama = drama;
| this.music = music;
| this.status = status;
| this.visitor = visitor;
| this.mailList = mailList;
| this.leader = leader;
| this.lastAttended = lastAttended;
| this.created = created;
| this.updated = updated;
| this.vcall = vcall;
| this.vhouseCall = vhouseCall;
| this.team = team;
| this.photoFile = photoFile;
| this.uniqueId = uniqueId;
| }
|
| // Property accessors
| @Id
| @Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true)
| public int getId() {
| return this.id;
| }
|
| public void setId(int id) {
| this.id = id;
| }
|
| @Column(name = "RoomID", unique = false, nullable = false, insertable = true, updatable = true)
| public int getRoomId() {
| return this.roomId;
| }
|
| public void setRoomId(int roomId) {
| this.roomId = roomId;
| }
|
| @Column(name = "OrganizationID", unique = false, nullable = false, insertable = true, updatable = true)
| public int getOrganizationId() {
| return this.organizationId;
| }
|
| public void setOrganizationId(int organizationId) {
| this.organizationId = organizationId;
| }
|
| @Column(name = "FirstName", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
| public String getFirstName() {
| return this.firstName;
| }
|
| public void setFirstName(String firstName) {
| this.firstName = firstName;
| }
|
| @Column(name = "MiddleName", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
| public String getMiddleName() {
| return this.middleName;
| }
|
| public void setMiddleName(String middleName) {
| this.middleName = middleName;
| }
|
| @Column(name = "LastName", unique = false, nullable = true, insertable = true, updatable = true, length = 25)
| public String getLastName() {
| return this.lastName;
| }
|
| public void setLastName(String lastName) {
| this.lastName = lastName;
| }
|
| @Column(name = "Address1", unique = false, nullable = true, insertable = true, updatable = true, length = 90)
| public String getAddress1() {
| return this.address1;
| }
|
| public void setAddress1(String address1) {
| this.address1 = address1;
| }
|
| @Column(name = "City", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getCity() {
| return this.city;
| }
|
| public void setCity(String city) {
| this.city = city;
| }
|
| @Column(name = "State", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
| public String getState() {
| return this.state;
| }
|
| public void setState(String state) {
| this.state = state;
| }
|
| @Column(name = "Zip", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
| public String getZip() {
| return this.zip;
| }
|
| public void setZip(String zip) {
| this.zip = zip;
| }
|
| @Column(name = "EMail", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
| public String getEmail() {
| return this.email;
| }
|
| public void setEmail(String email) {
| this.email = email;
| }
|
| @Column(name = "Birthday", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
| public Date getBirthday() {
| return this.birthday;
| }
|
| public void setBirthday(Date birthday) {
| this.birthday = birthday;
| }
|
| @Column(name = "Sex", unique = false, nullable = true, insertable = true, updatable = true, precision = 10, scale = 0)
| public Long getSex() {
| return this.sex;
| }
|
| public void setSex(Long sex) {
| this.sex = sex;
| }
|
| @Column(name = "HomePhone", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getHomePhone() {
| return this.homePhone;
| }
|
| public void setHomePhone(String homePhone) {
| this.homePhone = homePhone;
| }
|
| @Column(name = "WorkPhone", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getWorkPhone() {
| return this.workPhone;
| }
|
| public void setWorkPhone(String workPhone) {
| this.workPhone = workPhone;
| }
|
| @Column(name = "BeeperPhone", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getBeeperPhone() {
| return this.beeperPhone;
| }
|
| public void setBeeperPhone(String beeperPhone) {
| this.beeperPhone = beeperPhone;
| }
|
| @Column(name = "CellPhone", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getCellPhone() {
| return this.cellPhone;
| }
|
| public void setCellPhone(String cellPhone) {
| this.cellPhone = cellPhone;
| }
|
| @Column(name = "ExtraPhone", unique = false, nullable = true, insertable = true, updatable = true, length = 15)
| public String getExtraPhone() {
| return this.extraPhone;
| }
|
| public void setExtraPhone(String extraPhone) {
| this.extraPhone = extraPhone;
| }
|
| @Column(name = "ExtraPhoneMemo", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
| public String getExtraPhoneMemo() {
| return this.extraPhoneMemo;
| }
|
| public void setExtraPhoneMemo(String extraPhoneMemo) {
| this.extraPhoneMemo = extraPhoneMemo;
| }
|
| @Column(name = "School", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
| public String getSchool() {
| return this.school;
| }
|
| public void setSchool(String school) {
| this.school = school;
| }
|
| @Column(name = "SchoolGrade", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
| public String getSchoolGrade() {
| return this.schoolGrade;
| }
|
| public void setSchoolGrade(String schoolGrade) {
| this.schoolGrade = schoolGrade;
| }
|
| @Column(name = "Contact", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
| public String getContact() {
| return this.contact;
| }
|
| public void setContact(String contact) {
| this.contact = contact;
| }
|
| @Column(name = "ParentName", unique = false, nullable = true, insertable = true, updatable = true, length = 75)
| public String getParentName() {
| return this.parentName;
| }
|
| public void setParentName(String parentName) {
| this.parentName = parentName;
| }
|
| @Column(name = "Comments", unique = false, nullable = true, insertable = true, updatable = true, length = 100)
| public String getComments() {
| return this.comments;
| }
|
| public void setComments(String comments) {
| this.comments = comments;
| }
|
| @Column(name = "Minsitry", unique = false, nullable = true, insertable = true, updatable = true, length = 60)
| public String getMinsitry() {
| return this.minsitry;
| }
|
| public void setMinsitry(String minsitry) {
| this.minsitry = minsitry;
| }
|
| @Column(name = "Drama", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getDrama() {
| return this.drama;
| }
|
| public void setDrama(Character drama) {
| this.drama = drama;
| }
|
| @Column(name = "Music", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getMusic() {
| return this.music;
| }
|
| public void setMusic(Character music) {
| this.music = music;
| }
|
| @Column(name = "Status", unique = false, nullable = true, insertable = true, updatable = true, precision = 10, scale = 0)
| public Long getStatus() {
| return this.status;
| }
|
| public void setStatus(Long status) {
| this.status = status;
| }
|
| @Column(name = "Visitor", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getVisitor() {
| return this.visitor;
| }
|
| public void setVisitor(Character visitor) {
| this.visitor = visitor;
| }
|
| @Column(name = "Mail_List", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getMailList() {
| return this.mailList;
| }
|
| public void setMailList(Character mailList) {
| this.mailList = mailList;
| }
|
| @Column(name = "Leader", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getLeader() {
| return this.leader;
| }
|
| public void setLeader(Character leader) {
| this.leader = leader;
| }
|
| @Column(name = "Last_Attended", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
| public Date getLastAttended() {
| return this.lastAttended;
| }
|
| public void setLastAttended(Date lastAttended) {
| this.lastAttended = lastAttended;
| }
|
| @Column(name = "Created", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
| public Date getCreated() {
| return this.created;
| }
|
| public void setCreated(Date created) {
| this.created = created;
| }
|
| @Column(name = "Updated", unique = false, nullable = true, insertable = true, updatable = true, length = 19)
| public Date getUpdated() {
| return this.updated;
| }
|
| public void setUpdated(Date updated) {
| this.updated = updated;
| }
|
| @Column(name = "VCall", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getVcall() {
| return this.vcall;
| }
|
| public void setVcall(Character vcall) {
| this.vcall = vcall;
| }
|
| @Column(name = "VHouseCall", unique = false, nullable = true, insertable = true, updatable = true, length = 1)
| public Character getVhouseCall() {
| return this.vhouseCall;
| }
|
| public void setVhouseCall(Character vhouseCall) {
| this.vhouseCall = vhouseCall;
| }
|
| @Column(name = "Team", unique = false, nullable = true, insertable = true, updatable = true, length = 17)
| public String getTeam() {
| return this.team;
| }
|
| public void setTeam(String team) {
| this.team = team;
| }
|
| @Column(name = "PhotoFile", unique = false, nullable = true, insertable = true, updatable = true, length = 75)
| public String getPhotoFile() {
| return this.photoFile;
| }
|
| public void setPhotoFile(String photoFile) {
| this.photoFile = photoFile;
| }
|
| @Column(name = "UniqueID", unique = false, nullable = true, insertable = true, updatable = true, length = 45)
| public String getUniqueId() {
| return this.uniqueId;
| }
|
| public void setUniqueId(String uniqueId) {
| this.uniqueId = uniqueId;
| }
|
| }
|
Must I put an entery in either pages.xml or faces-config.xml? I didn't see that for the generated code.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979661#3979661
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979661
19 years, 8 months
[EJB 3.0] - Embeddable EJB3 - ZipException
by SteveO
I'm trying to set up a JUnit test in IDEA, to test an EJB3 instance, using EJB3_Embeddable_ALPHA_9, but am getting the following error:
java.lang.RuntimeException: java.util.zip.ZipException: The system cannot find the file specified
at org.jboss.util.file.JarArchiveBrowser.(JarArchiveBrowser.java:55)
at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:52)
at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:370)
at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:350)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:305)
at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:440)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:273)
at test.java.com.sms.sentinel.DataCaptureServiceTest.startupEmbeddedJboss(DataCaptureServiceTest.java:49)
at test.java.com.sms.sentinel.DataCaptureServiceTest.setUp(DataCaptureServiceTest.java:36)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
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:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.util.zip.ZipException: The system cannot find the file specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:203)
at java.util.zip.ZipFile.(ZipFile.java:234)
at org.jboss.util.file.JarArchiveBrowser.(JarArchiveBrowser.java:50)
... 28 more
java.lang.RuntimeException: java.lang.RuntimeException: java.util.zip.ZipException: The system cannot find the file specified
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:279)
at test.java.com.sms.sentinel.DataCaptureServiceTest.startupEmbeddedJboss(DataCaptureServiceTest.java:49)
at test.java.com.sms.sentinel.DataCaptureServiceTest.setUp(DataCaptureServiceTest.java:36)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: The system cannot find the file specified
at org.jboss.util.file.JarArchiveBrowser.(JarArchiveBrowser.java:55)
at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:52)
at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:370)
at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:350)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:305)
at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:440)
at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:273)
... 22 more
Caused by: java.util.zip.ZipException: The system cannot find the file specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:203)
at java.util.zip.ZipFile.(ZipFile.java:234)
at org.jboss.util.file.JarArchiveBrowser.(JarArchiveBrowser.java:50)
... 28 more
Process finished with exit code -1
The IDEA command, including classpath, is:
C:\_jdk\1.5.0_8\bin\java -Didea.launcher.port=7544 "-Didea.launcher.bin.path=C:\Software\IntelliJ IDEA 6.0\bin" -Dfile.encoding=windows-1252 -classpath "C:\_jdk\1.5.0_8\jre\lib\charsets.jar;C:\_jdk\1.5.0_8\jre\lib\deploy.jar;C:\_jdk\1.5.0_8\jre\lib\javaws.jar;C:\_jdk\1.5.0_8\jre\lib\jce.jar;C:\_jdk\1.5.0_8\jre\lib\jsse.jar;C:\_jdk\1.5.0_8\jre\lib\plugin.jar;C:\_jdk\1.5.0_8\jre\lib\rt.jar;C:\_jdk\1.5.0_8\jre\lib\ext\dnsns.jar;C:\_jdk\1.5.0_8\jre\lib\ext\localedata.jar;C:\_jdk\1.5.0_8\jre\lib\ext\sunjce_provider.jar;C:\_jdk\1.5.0_8\jre\lib\ext\sunpkcs11.jar;C:\_workspace\svn_root\Sentinel\SentinelApplication\classes;C:\Software\Repository\struts\struts\1.2.8\struts-1.2.8.jar;C:\_workspace\svn_root\Sentinel\SentinelService\classes;C:\Software\Repository\jboss\scheduler-plugin\4.03\scheduler-plugin-4.03.jar;C:\Software\Repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;C:\Software\Repository\commons-validator\commons-validator\1.1.4\commons-validator-1.1.4.jar;C:\Software\Repository\javax\servlet\jstl\1.1.2\jstl-1.1.2.jar;C:\Software\Repository\taglibs\standard\1.1.2\standard-1.1.2.jar;C:\Software\Repository\jboss\jboss-annotations-ejb3\4.03\jboss-annotations-ejb3-4.03.jar;C:\Software\Repository\jboss\jboss-ejb3x\4.03\jboss-ejb3x-4.03.jar;C:\Software\Repository\commons-httpclient\commons-httpclient\3.0.1\commons-httpclient-3.0.1.jar;C:\Software\Repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar;C:\Software\Repository\jdom\jdom\1.0\jdom-1.0.jar;C:\Software\Repository\javax\mail\mail\1.4\mail-1.4.jar;C:\Software\Repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Software\Repository\javax\servlet\servlet-api\2.4\servlet-api-2.4.jar;C:\Software\Repository\javax\servlet\jsp-api\2.0\jsp-api-2.0.jar;C:\Software\Repository\junit\junit\3.8.1\junit-3.8.1.jar;C:\Software\Repository\jaf\activation\1.1\activation-1.1.jar;C:\Software\Repository\novell\jldap\early-2006\jldap-early-2006.jar;C:\Software\Repository\jboss\jboss-EJB-3.0_Embeddable\jboss-ejb3-all\ALPHA_9\jboss-ejb3-all.jar;C:\Software\Repository\jboss\jboss-EJB-3.0_Embeddable\thirdparty-all\ALPHA_9\thirdparty-all.jar;C:\_workspace\svn_root\Sentinel\SentinelService\src\test\resources\conf;C:\Software\Repository\jboss\jboss-EJB-3.0_Embeddable\hibernate-all\ALPHA_9\hibernate-all.jar;C:\temp\jboss em alpha 9\jboss-EJB-3.0_Embeddable_ALPHA_9\lib\jcainflow.jar;C:\temp\jboss em alpha 9\jboss-EJB-3.0_Embeddable_ALPHA_9\lib\jms-ra.jar;C:\temp\jboss em alpha 9\jboss-EJB-3.0_Embeddable_ALPHA_9\optional-lib\junit.jar;C:\temp\jboss em alpha 9\jboss-EJB-3.0_Embeddable_ALPHA_9\optional-lib\ehcache-1.2.jar;C:\_workspace\svn_root\Sentinel\SentinelService_sar\classes;C:\Software\IntelliJ IDEA 6.0\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 @C:\DOCUME~1\STEVEO~1\LOCALS~1\Temp\idea_junit8575.tmp
Can anybody assist?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979655#3979655
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979655
19 years, 8 months