• getting error after adding runnable jar file in crontab

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #30917  by RSR17
 
i am facing problem in uploading jar file into crontab..if iam uploading simple jar file..than it gives a null pointer exception and some hibernate error... if i am uploading runnable jar file it gives a database exception(Packet for query is too large)i have increased it in mysqlserver..after than i uploaded my runnable jar(it involves databse interaction) file again and than uploaded it into crontab but giving error on execution of this jar file...


this is the stack trace--
Code: Select all
SessionFactory creation failedjava.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
WARN  com.openkm.util.ExecutionUtils -
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.openkm.util.cl.ClassLoaderUtils.invokeMethodFromClass(ClassLoaderUtils.java:112)
        at com.openkm.util.ExecutionUtils.runJar(ExecutionUtils.java:220)
        at com.openkm.core.Cron$RunnerJar.run(Cron.java:176)
        at com.openkm.servlet.admin.CronTabServlet.execute(CronTabServlet.java:231)
        at com.openkm.servlet.admin.CronTabServlet.doGet(CronTabServlet.java:115)
        at com.openkm.servlet.admin.CronTabServlet.service(CronTabServlet.java:71)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
        at com.mypack.SessionFactoryCode.<clinit>(SessionFactoryCode.java:23)
        at com.mypack..MyDao.myMethod(MyDao.java:48)
        at com.mypack.MyMainClass.myTask(MyMainClass.java:19)
        ... 50 more
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
        at org.hibernate.boot.registry.StandardServiceRegistryBuilder.build(StandardServiceRegistryBuilder.java:245)
        at org.hibernate.service.ServiceRegistryBuilder.build(ServiceRegistryBuilder.java:87)
        at org.hibernate.service.ServiceRegistryBuilder.buildServiceRegistry(ServiceRegistryBuilder.java:94)
        at com.mypack.SessionFactoryCode.<clinit>(SessionFactoryCode.java:16)
Last edited by RSR17 on Sat Jan 17, 2015 6:31 am, edited 5 times in total.
 #30933  by jllort
 
First of all, you got strange package com.valuedocs ? our package are com.openkm, why do you get it ?
This is all stack trace ? put all.
Which is your database ?
The error is clear can not insert, the reason is not much clear ( should try to deb on development mode, step by step trying to see exact line what is causing it.
 #30973  by jllort
 
ufff 5.1 is an older version I encourage you to upgrade to 6.3 http://wiki.openkm.com/index.php/Migration_Guide ( remember before doing any operation take in mind DO BACKUP ).

Did you create a complex crontab class or you've done a simply scheleton ? My suggestion is start with an scheleton and then step by step fill with source code. The error message you got is quite strange.
Code: Select all
SessionFactory creation failedjava.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(
Seems you've compiled with one version and you're exeuting with other. This is my first impression when I read it.

Give us more feedback about questions I've done.
 #30980  by RSR17
 
yes i am creating a complex crontab class it involves database interaction using Hibernate 4
(antlr-2.7.7,dom4j-1.6.1,hibernate-commons-annotations-4.0.5.Final,hibernate-core-4.3.6.Final,
hibernate-jpa-2.1-api-1.0.0.Final,jandex-1.1.0.Final,javassist-3.18.1-GA,jboss-logging-3.1.3.GA,
jboss-logging-annotations-1.2.0.Beta1,jboss-transaction-api_1.2_spec-1.0.0.Final these are the
jar files which i am using)........ and i have gone through the steps which u have said...
if i am uploading skeleton jar file than it is working fine in crontab..... and also
if i am using jdbc than also it is working fine but i have to use hibernate....so
if i am uploading my complex jar file with database interaction using hibernate ... and also when i am running my jar file from command prompt in window7
then it is running fine without any error..
 #31022  by jllort
 
Take in mind OpenKM also uses Hibernate, if you're using hibernate libraries older and newer than openkm use, then you can get some conflict. I think when jar is executed into OpenKM is not taking in consideration you hibernate lib and is using it's own /OpenKM/WEB-INF/lib

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.