I'm trying to run a scheduler using quartz. I use HSQLDB (version 2.2.7 ). But I get following exception;
Caused by: org.quartz.JobPersistenceException: Couldn't store job: data exception: string data, right truncation [See nested exception: java.sql.SQLDataException: data exception: string data, right truncation]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1132)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport$3.execute(JobStoreSupport.java:1071)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport$40.execute(JobStoreSupport.java:3716)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3788)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreTX.executeInLock(JobStoreTX.java:90)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3712)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1059)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:822)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at com.aepona.ase.services.terminalstatus.utils.SimpleTriggerExample.afterPropertiesSet(SimpleTriggerExample.java:32)[320:com.aepona.ase.services.terminalstatus:3.0.7.VFB-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)[439:org.springframework.beans:3.1.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)[439:org.springframework.beans:3.1.4.RELEASE]
... 14 more
Caused by: java.sql.SQLDataException: data exception: string data, right truncation
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)[315:org.hsqldb.hsqldb:2.2.7]
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)[315:org.hsqldb.hsqldb:2.2.7]
at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source)[315:org.hsqldb.hsqldb:2.2.7]
at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source)[315:org.hsqldb.hsqldb:2.2.7]
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)[301:org.apache.servicemix.bundles.commons-dbcp:1.2.2.7]
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertJobDetail(StdJDBCDelegate.java:530)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1126)[475:org.apache.servicemix.bundles.quartz:1.8.6.1]
anyone familiar with this issue?
I am using quartz-scheduler 1.8.6. The DB script comes with it for HSQLDB uses BINARY data type in qrtz_job_details, qrtz_triggers, qrtz_calendars and qrtz_blob_triggers tables. I just change BINARY to BLOB and problem solved.
Related
I am new to spring data jpa.
i have a legacy database , which i am trying to connect to via spring data jpa.
i have a certain extension created in postgres which is used for some of the columns in my tables
for e.g
CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;
this extension is created mostly for (case-insensitive text)
now when i try to map the tables using standard entity annotations, it gives me error, as its unable to understand this extension
The error i get is
g.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [domain_obj_nm] in table [attr_grp_defn]; found [citext (Types#OTHER)], but expecting [varchar(255) (Types#VARCHAR)]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1634)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1080)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.sas.mkt.example.app.Application.main(Application.java:43)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [domain_obj_nm] in table [attr_grp_defn]; found [citext (Types#OTHER)], but expecting [varchar(255) (Types#VARCHAR)]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:396)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:371)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1692)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
... 16 common frames omitted
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [domain_obj_nm] in table [attr_grp_defn]; found [citext (Types#OTHER)], but expecting [varchar(255) (Types#VARCHAR)]
i want a way via annotations to solve this issue, its ok if it is treated just as text column.
Hibernate is validating the schema on start-up as the ddl.auto property is set to validate.
You can either disable validation entirely or specify a column definition for the relevant #Columnproperty which should allow the validation to pass:
https://docs.oracle.com/javaee/5/api/javax/persistence/Column.html#columnDefinition()
#Column(columnDefinition = "citext") //or "other"?
private String myField;
Note that the column definition only affects DDL operations i.e. schema creation or validation.
Disabling validation entirely depends on your set-up. In a spring-boot app for example you set spring.jpa.hibernate.ddl-auto = false
Performing weaving (static or dynamic) results in the following error:
Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.1.v20171221-bd47e8f): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [MyUnit] failed.
Internal Exception: java.lang.NullPointerException
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231)
... 20 more
Caused by: java.lang.NullPointerException
at org.eclipse.persistence.sessions.Project.hasSQLResultSetMapping(Project.java:1040)
at org.eclipse.persistence.internal.jpa.metadata.queries.NamedNativeQueryMetadata.hasResultSetMapping(NamedNativeQueryMetadata.java:141)
at org.eclipse.persistence.internal.jpa.metadata.queries.NamedNativeQueryMetadata.process(NamedNativeQueryMetadata.java:172)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processQueries(MetadataProject.java:1713)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addNamedQueries(MetadataProcessor.java:153)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2024)
I didn't get this error with EclipseLink 2.6.5 and if I turn Weaving off everything works fine.
Is there a way to work around it? What triggers the error?
The NPE is a bug, as it isn't performing a null check and throwing a more specific error: This error could only occur if you've specified a named native (SQL) query on your entities that references a SqlResultSetMapping, but you haven't defined any result sets mappings. See https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Native#SQL_Result_Set_Mapping for documentation and an example.
I am using JasperStudio and Jasper server 6.2 windows version. In the local environment firstly I have tested data source, postgreSQL JDBC connection, connection which is successfull and I have created a domain and linked the datasource. I took the working jrxml file which needs an input string. I have created the report in view>repository>create>jasperReport and while configuring the report I have given the jrxml file which is working in production server and set an input field as mandatory. till now everything is fine but when I click on the report it is asking for input value, when an input value is given and clickon apply, it is showing the following error message:
Error Message
Error filling report
Error Trace
com.jaspersoft.jasperserver.api.JSException: Error filling report Arguments: at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$FillResultListener.reportFillError(EngineServiceImpl.java:1294) at net.sf.jasperreports.engine.fill.BaseFillHandle.notifyError(BaseFillHandle.java:210) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:134) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$SynchronousExecutor.execute(EngineServiceImpl.java:922) at net.sf.jasperreports.engine.fill.BaseFillHandle.startFill(BaseFillHandle.java:164) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$AsynchronousReportFiller.fillReport(EngineServiceImpl.java:878) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:1774) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runWithDataSource(EngineServiceImpl.java:1118) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportFill.runReport(EngineServiceImpl.java:1047) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl$ReportRunnable.run(EngineServiceImpl.java:944) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.DiagnosticLoggingContextCompatibleExecutorService$1.run(DiagnosticLoggingContextCompatibleExecutorService.java:61) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: net.sf.jasperreports.engine.JRException: java.lang.RuntimeException: exception initting subfilters at com.jaspersoft.ji.adhoc.strategy.StrategyAwareDomainQueryExecuter.createDatasource(StrategyAwareDomainQueryExecuter.java:165) at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1129) at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:696) at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(BaseReportFiller.java:437) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:526) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:119) ... 11 more Caused by: java.lang.RuntimeException: exception initting subfilters at com.jaspersoft.ji.adhoc.strategy.DomainDataStrategy.getInitialSubFilterList(DomainDataStrategy.java:629) at com.jaspersoft.ji.adhoc.strategy.BaseDataStrategy.initSubFilterList(BaseDataStrategy.java:424) at com.jaspersoft.ji.adhoc.strategy.DomainDataStrategy.getBaseQueryDataSet(DomainDataStrategy.java:145) at com.jaspersoft.ji.adhoc.strategy.DomainQueryDataStrategy.getBaseQueryDataSet(DomainQueryDataStrategy.java:38) at com.jaspersoft.ji.adhoc.strategy.CommonDomainDataStrategy.createQuery(CommonDomainDataStrategy.java:736) at com.jaspersoft.ji.adhoc.strategy.CommonDomainDataStrategy.getQuery(CommonDomainDataStrategy.java:681) at com.jaspersoft.ji.adhoc.strategy.CommonDomainDataStrategy.getWorkingDataSet(CommonDomainDataStrategy.java:1232) at com.jaspersoft.ji.adhoc.strategy.CommonDomainDataStrategy.getWorkingDataSet(CommonDomainDataStrategy.java:1220) at com.jaspersoft.ji.adhoc.strategy.StrategyAwareDomainQueryExecuter.createDatasource(StrategyAwareDomainQueryExecuter.java:156) ... 16 more Caused by: java.lang.NullPointerException at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.varRef(DataSetExpressionParser.java:1703) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.term(DataSetExpressionParser.java:1349) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.multDivExpr(DataSetExpressionParser.java:1003) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.addSubExpr(DataSetExpressionParser.java:888) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.comparisonExpr(DataSetExpressionParser.java:601) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.notExpr(DataSetExpressionParser.java:499) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.andExpr(DataSetExpressionParser.java:423) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.orExpr(DataSetExpressionParser.java:353) at com.jaspersoft.commons.dataset.expr.DataSetExpressionParser.booleanExpr(DataSetExpressionParser.java:298) at
when I try to compile the same jrxml in JasperStudio then it is giving me an empty report with design but no data when empty data adapter is selected and it is giving complete empty document when a datasource is selected.
I am getting below Exception while I try to Update or Delete any item from database using openJPA:
Caused by: java.lang.NullPointerException
at org.apache.openjpa.kernel.StateManagerImpl.replaceObjectField(StateManagerImpl.java:2076)
at org.apache.openjpa.enhance.com$freightliner$viva$dao$VivaSubgroupItems$pcsubclass.pcReplaceField(Unknown Source)
at org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:3041)
at org.apache.openjpa.kernel.StateManagerImpl.storeObjectField(StateManagerImpl.java:2473)
at org.apache.openjpa.kernel.StateManagerImpl.storeObject(StateManagerImpl.java:2463)
at org.apache.openjpa.jdbc.meta.strats.StoreCollectionFieldStrategy.load(StoreCollectionFieldStrategy.java:573)
at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:819)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:692)
at com.ibm.ws.persistence.jdbc.kernel.WsJpaJDBCStoreManager.load(WsJpaJDBCStoreManager.java:125)
at org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
at org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2937)
at org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:3015)
at org.apache.openjpa.kernel.StateManagerImpl.fetchObjectField(StateManagerImpl.java:2258)
at org.apache.openjpa.kernel.StateManagerImpl.fetchField(StateManagerImpl.java:778)
at org.apache.openjpa.kernel.StateManagerImpl.fetch(StateManagerImpl.java:740)
at org.apache.openjpa.enhance.RedefinitionHelper$1.invoke(RedefinitionHelper.java:230)
at com.sun.proxy.$Proxy17.isEmpty(Unknown Source)
at org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:213)
at org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:153)
at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:241)
at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:101)
at org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3244)
... 6 more
You need to use a different enhancement strategy. You must have set openjpa.RuntimeUnenhancedClasses=supported which is leading you astray. That feature is buggy at best.
You will need to either setup build time enhancement, or configured the -javaagent enhancer.
When I looked at Spring Boot, I liked the idea that it:
Gets out of the way quickly if you want to change defaults. - Dave Syer, Spring One 2GX 2013
It wasn't long before practicality hit me. While trying to make Boot work with a 100% Groovy/no-XML pet project, I found 2 issues in 2 days. Here's one of them.
Groovy config file:
beans {
xmlns([ctx:'http://www.springframework.org/schema/context'])
ctx.'component-scan'('base-package':'name.abhijitsarkar.moviedatabase')
}
Exception:
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read XML document; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for [Groovy]: cannot open InputStream. Did you attempt to load directly from a SAX InputSource without specifying the validationMode on your XmlBeanDefinitionReader instance?; nested exception is java.io.FileNotFoundException: Groovy cannot be opened because it does not point to a readable resource
at org.springframework.beans.factory.xml.XmlReaderContext.readDocumentFromString(XmlReaderContext.java:98)
at org.springframework.beans.factory.xml.XmlReaderContext$readDocumentFromString.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.springframework.beans.factory.groovy.GroovyDynamicElementReader.invokeMethod(GroovyDynamicElementReader.groovy:96)
Also posted on Spring forum.