Win a copy of Head First Android this week in the Android forum!

Arnie Morein

Greenhorn
+ Follow
since Dec 20, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arnie Morein

I am having a devil of a time getting the first (of several to come) one-to-many associations described and working. In this case, a report program needs to load a client's record and I want to have all the child table records loaded at the same time since I'm exporting the data to XML for processing with XSLT.

I've tried every version of the join I could gleen from the usual sources. Keep getting the "failed to ..." message (see below). This, despite the fact that I can see it read the client table and then the child barriers table right afterwards. What is it doing?

Anyone have any ideas? In this case, the client-barrier table is related to the client table via a FK of the client-id plus two other fields. Its a pretty complex mapping but a simple relationship otherwise.

Name and version of the database you are using: MSSQL 2000

Hibernate version: 3.2.0.ga

Mapping documents:



Code between sessionFactory.openSession() and session.close():

I'm using JBoss as the container, but here is the code where the error shows up:



The serializeToXml method accesses the Set and attempts to ge an iterator on it but finds NULL. Argh!

I've tried lots of different ways to "force" Hibernate to pre-populate the set, to no avail.

Full stack trace of any exception that occurs:
20:13:10,299 INFO [STDOUT] Hibernate: select ic.Client_ID, ic.Alt_Adrs_1, ic.Alt_Adrs_2, ic.Alt_City, ic.Alt_State, ic.Alt_ZIP,
ic.Annual_Income, ic.Below_Poverty, ic.Caseworker_ID,
icc.last_name + ', ' + icc.first_name as CaseWorkerName,
ic.Citizen_Status, cc.description as CitizenStatusString,
ic.Client_Hot_List, ic.Counselor_ID,
icc2.last_name + ', ' + icc2.first_name as CounselorName,
ic.Date_of_Last_Seizure, ic.Developmentally_Disabled, ic.DOB, ic.DOD,
ic.Emer_Contact, ic.Emer_Phone, ic.Ethnicity, ce.description as EthnicityDescription,
ic.Fax_Phone, ic.File_Locator,
ic.First_Name, ic.Gender, cg.description as GenderDescription,
ic.Hispanic_Descent, ic.Home_Is_TTY, ic.Home_Phone,
ic.Household_Size, ic.Income_Set, ic.Is_Closed, ic.Last_Name, ic.Maiden_Name,
ic.Mail_Adrs_1, ic.Mail_Adrs_2, ic.Mail_City, ic.Mail_State, ic.Mail_ZIP,
ic.Medications, ic.Middle_Name, ic.Mobile_Phone, ic.Multiple_Disabilities,
ic.Pager_Phone, ic.Path_Resume, ic.Physician_ID,
iphys.last_name + ', ' + iphys.first_name as PhysicianName,
ic.Preferred_Name, ic.Primary_Barrier, cb.description as PrimaryBarrierName,
ic.PS_AFDC, ic.PS_FS, ic.PS_Other, ic.PS_Sctn8, ic.PS_SS, ic.PS_SSDI, ic.PS_SSI,
ic.Secondary_Barrier, cb2.description as SecondaryBarrierName,
ic.Severely_Disabled, ic.SSN, ic.Status_Code, cs.description as StatusDescription,
ic.Work_Ext, ic.Work_Phone, ic.Who, ic.Last_Update, ic.comments, ic.email_address

from info_clients ic, codes_gender cg, info_company_contacts icc,
info_company_contacts icc2, codes_citizen cc, info_physicians iphys,
codes_barrier cb, codes_barrier cb2, codes_status cs,
codes_ethnicity ce

where ic.gender = cg.gender_code
and ic.caseworker_id = icc.contact_id
and ic.counselor_id = icc2.contact_id
and ic.citizen_status = cc.citizen_code
and ic.physician_id = iphys.physician_id
and ic.primary_barrier = cb.barrier
and ic.secondary_barrier = cb2.barrier
and ic.status_code = cs.status_code
and ic.ethnicity = ce.ethnicity
and client_id = ?
20:13:10,350 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
20:13:10,350 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Database changed to gwcts_centex
20:13:10,350 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
20:13:10,350 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed database context to 'gwcts_centex'.
20:13:10,350 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
20:13:10,350 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC]Language changed to us_english
20:13:10,350 WARN [JDBCExceptionReporter] SQL Warning: 0, SQLState:
20:13:10,350 WARN [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Changed language setting to us_english.
20:13:10,380 INFO [STDOUT] Hibernate: select cb.client_id, cb.barrier_id, cb.eap_data, cb.who, cb.last_update,
b.Description as description, b.Disability as disability
from info_client_barriers cb, codes_barrier b
where cb.barrier_id = b.barrier
and cb.client_id = ?
20:13:12,726 INFO [STDOUT] Hibernate: select cb.client_id, cb.barrier_id, cb.eap_data, cb.who, cb.last_update,
b.Description as description, b.Disability as disability
from info_client_barriers cb, codes_barrier b
where cb.barrier_id = b.barrier
and cb.client_id = ?
20:13:14,756 ERROR [[faces]] Servlet.service() for servlet faces threw exception
javax.faces.FacesException: Error calling action method of component with id reportForm:cmdRunReport
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
at javax.faces.component.UICommand.broadcast(UICommand.java:109)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
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:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.logipath.gict.cts.reporting.AuthorizationFilter.doFilter(AuthorizationFilter.java:57)
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.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(Thread.java:613)
Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{reportClient.runReport}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
... 32 more
Caused by: java.lang.NullPointerException
at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:146)
at com.logipath.gict.cts.reporting.client.ReportClient.runReport(ReportClient.java:90)
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 org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
... 33 more
Not exactly, as I'm not doing EJBs.

But I did figure it out. Another message lead me down the golden path - unbeknownst me at the time, Eclipse was bundling my ear with a whole bunch of jars in the war's web-inf/lib folder - so the JBoss class loader issue was what was causing my problem.

Bah! Would have been nice if there had been SOME kind of error though...
14 years ago
Hello there!

I just came across your post:

https://coderanch.com/t/89111/JBoss/JNDI-Servlet-inside-JBoss

and am having the same problem. In my case, I'm deploying a har and putting the session factory in: java:/hibernate/dev/dbname (there's also a .../prd/... path as well.

Anyway, they showing in the JNDIView in the JMX console where I'd expect:

java: Namespace

+- SecurityProxyFactory
+- us
| +- tx
| | +- state
| | | +- oag
| | | | +- dev
| | | | | +- Common
| | | | | +- ApplicationSecurity
| | | | | +- Workflows
| | | | | +- EmployeeWarehouse
| | | | +- prd
| | | | | +- Common
| | | | | +- ApplicationSecurity
| | | | | +- DpsLicenses
+- comp
+- jaas
| +- WebAppDomainPrdDpsLicenses
| +- WebAppDomainDevCommon
| +- WebAppDomainDevApplicationSecurity
| +- WebAppDomainPrdCommon
| +- WebAppDomainDevEmployeeWarehouse
| +- WebAppDomainDevWorkflows
| +- WebAppDomainPrdApplicationSecurity
+- timedCacheFactory
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
+- TransactionPropagationContextExporter
+- Mail
+- TransactionPropagationContextImporter
+- TransactionManager
+- hibernate
| +- dev
| | +- ApplicationSecurity
| | +- Common
| | +- Workflows
| | +- EmployeeWarehouse
| +- prd
| | +- ApplicationSecurity
| | +- Common
| | +- DpsLicenses


But JNDI always returns...Hibernate not bound! ARGH!

My .har is outside the .war in an .ear so I wonder if somehow that's screwing with security???
14 years ago
DOH!

I posted the CodeBusinessUnit java code instead of CodeDeptDivision, but you get the idea...
I have an old WAR app that used a ContextListener to initialize Hibernate and stored the SessionFactory in the Session context. Now I'm trying to get JBoss and the HAR deployer to create the SessionFactory and put it in JNDI. I've created the configuration files to get the DataSource mapped to the service correctly. The problem appears when the HAR deployer is scanning the classes and attempting to build the SessionFactory. Its not finding what it calls a Component Class.

The database in question is already in production. The PKs are normal, multi-field Keys, not a single integer field. In my case, MyEclipse generated the following files:

Mapping File


[bold]and the following Class Files:[/bold]



As you can see, the PK is listed as a composite-key:



I've got the .class and .hbm.xml files bundled into a HAR file and the deployer sees it, deploys everything and starts mapping classes w/o issue. Then...

16:16:22,734 INFO [EARDeployer] Init J2EE application: file:/C:/Dev/jboss405ga/server/default/deploy/PortalRegistration.ear/
16:16:23,000 INFO [Configuration] Searching for mapping documents in jar: tmp29012appsec.har
16:16:23,000 INFO [Configuration] Found mapping document in jar: CodeAddressType.hbm.xml
16:16:23,296 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeAddressType -> code_address_type
16:16:23,328 INFO [Configuration] Found mapping document in jar: CodeAgency.hbm.xml
16:16:23,359 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeAgency -> code_agency
16:16:23,359 INFO [Configuration] Found mapping document in jar: CodeBusinessUnit.hbm.xml
16:16:23,375 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeBusinessUnit -> code_business_unit
16:16:23,390 INFO [Configuration] Found mapping document in jar: CodeDeptDivision.hbm.xml
16:16:23,406 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivision -> code_dept_division
16:16:23,406 INFO [Configuration] Found mapping document in jar: CodeEdirOu.hbm.xml
16:16:23,437 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeEdirOu -> code_edir_ou
16:16:23,437 INFO [Configuration] Found mapping document in jar: CodeExternalApplication.hbm.xml
16:16:23,453 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeExternalApplication -> code_external_application
16:16:23,453 INFO [Configuration] Found mapping document in jar: CodeLogEventType.hbm.xml
16:16:23,468 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeLogEventType -> code_log_event_type
16:16:23,468 INFO [Configuration] Found mapping document in jar: CodeMotdType.hbm.xml
16:16:23,484 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeMotdType -> code_motd_type
16:16:23,484 INFO [Configuration] Found mapping document in jar: CodeNextId.hbm.xml
16:16:23,515 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeNextId -> code_next_id
16:16:23,515 INFO [Configuration] Found mapping document in jar: CodeOwnerType.hbm.xml
16:16:23,531 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeOwnerType -> code_owner_type
16:16:23,531 INFO [Configuration] Found mapping document in jar: CodePhoneType.hbm.xml
16:16:23,546 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodePhoneType -> code_phone_type
16:16:23,546 INFO [Configuration] Found mapping document in jar: CodeProvisionStatus.hbm.xml
16:16:23,562 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeProvisionStatus -> code_provision_status
16:16:23,562 INFO [Configuration] Found mapping document in jar: CodeRequestResult.hbm.xml
16:16:23,578 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRequestResult -> code_request_result
16:16:23,578 INFO [Configuration] Found mapping document in jar: CodeRequestStatus.hbm.xml
16:16:23,593 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRequestStatus -> code_request_status
16:16:23,593 INFO [Configuration] Found mapping document in jar: CodeRole.hbm.xml
16:16:23,625 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRole -> code_role
16:16:23,625 INFO [Configuration] Found mapping document in jar: CodeRoleDept.hbm.xml
16:16:23,656 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRoleDept -> code_role_dept
16:16:23,656 INFO [Configuration] Found mapping document in jar: CodeRoleType.hbm.xml
16:16:23,687 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeRoleType -> code_role_type
16:16:23,687 INFO [Configuration] Found mapping document in jar: CodeTreeviewNode.hbm.xml
16:16:23,718 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.CodeTreeviewNode -> code_treeview_node
16:16:23,718 INFO [Configuration] Found mapping document in jar: InfoAccessRequest.hbm.xml
16:16:23,718 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequest -> info_access_request
16:16:23,734 INFO [Configuration] Found mapping document in jar: InfoAccessRequest2.hbm.xml
16:16:23,734 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequest2 -> info_access_request
16:16:23,734 INFO [Configuration] Found mapping document in jar: InfoAccessRequestLog.hbm.xml
16:16:23,750 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoAccessRequestLog -> info_access_request_log
16:16:23,750 INFO [Configuration] Found mapping document in jar: InfoCompanyContact.hbm.xml
16:16:23,765 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoCompanyContact -> info_company_contact
16:16:23,765 INFO [Configuration] Found mapping document in jar: InfoDelegateAdministrator.hbm.xml
16:16:23,781 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoDelegateAdministrator -> info_delegate_administrator
16:16:23,796 INFO [Configuration] Found mapping document in jar: InfoExternalProvisionStatus.hbm.xml
16:16:23,796 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoExternalProvisionStatus -> info_external_provision_status
16:16:23,796 INFO [Configuration] Found mapping document in jar: InfoLogUser.hbm.xml
16:16:23,812 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoLogUser -> info_log_user
16:16:23,812 INFO [Configuration] Found mapping document in jar: InfoPhone.hbm.xml
16:16:23,828 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPhone -> info_phone
16:16:23,828 INFO [Configuration] Found mapping document in jar: InfoPortalMotd.hbm.xml
16:16:23,843 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPortalMotd -> info_portal_motd
16:16:23,843 INFO [Configuration] Found mapping document in jar: InfoPublicAddress.hbm.xml
16:16:23,875 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPublicAddress -> info_public_address
16:16:23,875 INFO [Configuration] Found mapping document in jar: InfoPublicCompany.hbm.xml
16:16:23,875 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoPublicCompany -> info_public_company
16:16:23,890 INFO [Configuration] Found mapping document in jar: InfoRoleAdministrator.hbm.xml
16:16:23,890 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleAdministrator -> info_role_administrator
16:16:23,890 INFO [Configuration] Found mapping document in jar: InfoRoleAppResource.hbm.xml
16:16:23,906 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleAppResource -> info_role_app_resource
16:16:23,906 INFO [Configuration] Found mapping document in jar: InfoRoleMember.hbm.xml
16:16:23,921 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleMember -> info_role_member
16:16:23,921 INFO [Configuration] Found mapping document in jar: InfoRoleReport.hbm.xml
16:16:23,937 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoRoleReport -> info_role_report
16:16:23,937 INFO [Configuration] Found mapping document in jar: InfoUser.hbm.xml
16:16:23,953 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoUser -> info_user
16:16:23,953 INFO [Configuration] Found mapping document in jar: InfoUserLog.hbm.xml
16:16:23,968 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.InfoUserLog -> info_user_log
16:16:23,968 INFO [Configuration] Found mapping document in jar: Messages.hbm.xml
16:16:23,984 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.Messages -> messages
16:16:23,984 INFO [Configuration] Found mapping document in jar: SysParameter.hbm.xml
16:16:23,984 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysParameter -> sys_parameter
16:16:24,000 INFO [Configuration] Found mapping document in jar: SysPrevValues.hbm.xml
16:16:24,015 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysPrevValues -> sys_prev_values
16:16:24,015 INFO [Configuration] Found mapping document in jar: SysSearchCriteria.hbm.xml
16:16:24,015 INFO [HbmBinder] Mapping class: us.tx.state.oag.ApplicationSecurity.db.SysSearchCriteria -> sys_search_criteria
16:16:24,250 WARN [ServiceController] Problem starting service jboss.jca:service=HbmSessFacDevApplicationSecurity
org.hibernate.MappingException: component class not found: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivisionId
at org.hibernate.mapping.Component.getComponentClass(Component.java:104)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:130)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:43)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:38)
at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:52)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:50)
at org.hibernate.mapping.Component.buildType(Component.java:152)
at org.hibernate.mapping.Component.getType(Component.java:145)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.RootClass.validate(RootClass.java:193)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.jboss.hibernate.jmx.Hibernate.buildSessionFactory(Hibernate.java:231)
at org.jboss.hibernate.jmx.Hibernate.startService(Hibernate.java:155)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:490)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: us.tx.state.oag.ApplicationSecurity.db.CodeDeptDivisionId
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:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.mapping.Component.getComponentClass(Component.java:101)
... 106 more


Which I just don't get. What could be wrong? The HAR file contains both .class files and the mapping file. Now, the .war/WEB-INF/classes/.../db folder has the same .class files. Don't they have to be there so the application classes can use them? Or can they find the ones deployed via the HAR?
I build a data table and scroller in code at run time for an ad-hoc inquiry app. I need to know which button (first)(previous)(next)(last) the user pressed. I had done this:

htmlDataScroller.setActionListener(
application.createMethodBinding("#{transactionSearchBean.scrollerAction}",
new Class[] {ActionEvent.class}));

but I cannot figure out how to discern which button was pressed.

I was thinking maybe if I used a value binding to the control, there might be a property that could tell me, but thus far, looking through the API docs has be fruitless.

I understand that the entire purpose of the datascroller is automate the paging but I had to write a descendant of datamodel that allows me to page through a resultset based on a stored procedure. The SP requires parameters that tell it which page to display (based on the number of recs per page).

As I understand it, shouldn't the data scroller call methods on the data model to point to a new rowIndex?
14 years ago
JSF
Wasn't doing that, as it happened. DUH - reading the fine print of the DataModel class indicates that it isn't Serializable intentionally and any descendants have to handle serialization on their own or mark certain members transient. Which I did and that went away. In the process of tracking it down, I discovered that a sub-class I has created for the main record I was storing wasn't serializable and that cleared everything up. But of course, I'm still getting JavaHeap issues.

Does anyone know if, of the many XML libraries out there for Java, if there is one that WON'T parse the entire document into memory and abstracts the XML file into a "file of records"? Instead of accessing record N, we access records by child element name?

Thanks for the guidance everyone!
14 years ago
JSF
?!?! The datamodel is being populated via a ResultSet - an object I didn't write! Or is JSF complaining that the ResultSetDataModel class itSELF isn't serializable?
14 years ago
JSF
I am trying to conserve memory in an application that does ad-hoc querying on a table where the user can specify the result set columns. Initially taking the ResultSet and turning it into a List of objects (ala Hibernate) worked, but large result sets (max set at 10k records) will cause heap issues. I am hoping using a data model will reduce the memory usage. But now I'm getting something that at first glance is out of my control.



The error I'm getting...

12:46:50,796 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.faces.FacesException: java.io.NotSerializableException: javax.faces.model.ResultSetDataModel
at org.apache.myfaces.shared_impl.util.StateUtils.getAsByteArray(StateUtils.java:194)
at org.apache.myfaces.shared_impl.util.StateUtils.construct(StateUtils.java:154)
at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.writeState(HtmlResponseStateManager.java:88)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.writeState(JspStateManagerImpl.java:398)
at org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:150)
at org.apache.jsp.pages.searchResults_jsp._jspx_meth_f_view_0(searchResults_jsp.java:212)
at org.apache.jsp.pages.searchResults_jsp._jspService(searchResults_jsp.java:100)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
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:100)
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:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at us.tx.state.oag.FinancialCrimesInquiry.AuthorizationFilter.doFilter(AuthorizationFilter.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.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.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)
Caused by: java.io.NotSerializableException: javax.faces.model.ResultSetDataModel
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeArray(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.apache.myfaces.shared_impl.util.StateUtils.getAsByteArray(StateUtils.java:184)
... 51 more
12:46:50,812 ERROR [[faces]] Servlet.service() for servlet faces threw exception
javax.faces.FacesException: java.io.NotSerializableException: javax.faces.model.ResultSetDataModel
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:425)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
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:100)
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:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at us.tx.state.oag.FinancialCrimesInquiry.AuthorizationFilter.doFilter(AuthorizationFilter.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.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.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)
Caused by: org.apache.jasper.JasperException: java.io.NotSerializableException: javax.faces.model.ResultSetDataModel
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
... 32 more
14 years ago
JSF
I am writing an search application that allows users to query a rather large table via a fill-in-the-blank type form. The hardest part was dealing with the fact that they can also configure and use different select statements which alters the number of fields returned. I am using the MyFaces implementation and it works. Sort of. The weird thing is that after boot, the first search doesn't display any records, though tracing through the code shows records returned and converted to a List. Subequent searches work immediately. At least I hope they are and not showing old data. Here's the quandry.

The SearchVerifyBean takes the values from the form and if valid, creates a WHERE clause (and optional ORDER BY clause), loads the selected SELECT clause and writes them all to a work table. It then loads the TransactionSearchBean and sets a "do search" flag to true, and returns success so that JSF then navigates to the searchResults.jsp page. That page references the TransactionSearchBean - which hasn't done the search yet.

Since the field list is dynamic, the searchResults.jsp page is fairly empty and I create the <DataScroller> and <DataTable> objects in code, built on the fly based on the fields from the result set. The thing I can't grasp is how to make the bean do the actual search when the page is loaded, NOT when it needs to get a page worth of data to display.

I have a UIPanel object in my class BINDed to the page construct where the data scroller and table reside. I altered my code thusly:



the doSearch() method calls the stored procedure to load the three clauses and runs dynamic SQL to return what the user wants. It then extracts the meta data to construct the <DataTable> object and everything is then displayed.

Only it isn't quite right. As I said, the first search always returns "no results" despite the fact that there is data ready to be displayed.

I know this is a timing issue and am still a bit fuzzy about the JSF phases.

Has anyone done anything remotely similar to this?

Is there a way to setup an event listener that will be called when the page is initially loaded/navigated to? That way the searching/ loading/ construction is done before the JSF phase to actually display the data is called?

Any advice is much appreciated.
Thanks.
14 years ago
JSF
I am working on an inquiry program that allows the user to set the select clause of the sql statement. Which means the backing bean has to adapt and creates the t:dataTable object at run time. The thing I don't get - is that the first time a search is done (and therein the page is created), it is displayed w/o any data - tracing shows that this is because the backing bean property that points to the h:panelGroup object is null - so I have nothing to add children to. Subsequent pages get populated and the grid displays. But there is another problem. Clicking the page-forward/end buttons doesn't display the next/last page. I know the event code is firing (traced into it) and the variables are being updated, but the grid's contents never change. I think it has something to do with building the page during the wrong phase, but I'm not sure. I hope someone here can help.

This is using the latest MyFaces and Tomahawk dataTable (org.apache.myfaces.component.html.ext.HtmlDataTable).

This is a snippet of the JSF file where the dynamic part is built.



There is the method that builds the t:dataTable object

14 years ago
JSF
More testing is yielding odder results.



linked to:



Keeps complaining about duplicate fields. However, taking the <composite-id> or <id> entries out of the children is a violation of the XML Schema. This is insane! How can I link via many-to-one properly listing the fields to index on, if listing them in the class in question is a duplication, especially when one of them is identity?

I have three tables I'm trying to map but am getting odd messages from Hibernate (3.x). Table saved_searches has a key field of search_id and tables search_fields and sort_fields has the same field (this is the foreign key back to the parent) They then each have search_field_id and sort_field_id fields which are identity in the each of the child tables to keep the records unique. The hbm.xml files are below. I want to map the search_fields and sort_fields tables as lists of a given search. My two problems is how to tell Hibernate that when it adds records to the child tables that the second field needs to be "identity" and that the two tables are joined on the parent's key field. I keep getting:


org.hibernate.MappingException: Repeated column in mapping for entity: us.tx.state.oag.FinancialCrimesInquiry.db.HbmUserSavedSearchSortFields column: search_id (should be mapped with insert="false" update="false")


I've figured this out - I think. I had to put <redirect/> on my navigation cases and the URL of the target page showed up correctly the first time the page appears, therein the paths to graphics and JS files were correct.

Is this an intentional JSF behavior?
14 years ago
JSF
The folder structure is:

\web\pages\includes\header.jsp
\web\pages\licenseQuery.jsp (the only secure page)
\web\resources\<css and js files>
\web\WEB-INF\classes
\web\WEB-INF\config
\web\WEB-INF\lib
\web\WEB-INF\src
\web\WEB-INF\tld
\web\userLogin.jsp (default page)
\web\requestAccess.jsp
\web\verifyAccessRequest.jsp
\web\index.jsp (forwards to userLogin.jsp)
[ December 27, 2006: Message edited by: Arnie Morein ]
14 years ago
JSF