Announcement Announcement Module
Collapse
No announcement yet.
problem with chache starting batch application with tomcat Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with chache starting batch application with tomcat

    Hi everybody.
    I have this stacktrace while starting my simple application, did somebody knows how to solve it?


    My simple application is nothing more the spring batch admin webapp with some of my own spring batch job added..

    It seems it happend while registering the first jmx execution jobs.

    INFO: Initializing Spring root WebApplicationContext
    INFO support.JobRepositoryFactoryBean (JobRepositoryFactoryBean.java:146) - No database type set, using meta data indicating: ORACLE
    DEBUG interceptor.NameMatchTransactionAttributeSource (NameMatchTransactionAttributeSource.java:95) - Adding transactional method[*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
    DEBUG interceptor.NameMatchTransactionAttributeSource (NameMatchTransactionAttributeSource.java:95) - Adding transactional method [create*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
    DEBUG interceptor.NameMatchTransactionAttributeSource (NameMatchTransactionAttributeSource.java:95) - Adding transactional method [getLastJobExecution*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
    INFO service.SimpleJobServiceFactoryBean (SimpleJobServiceFactoryBean.java:180) - No database type set, using meta data indicating: ORACLE
    INFO jmx.BatchMBeanExporter (MBeanExporter.java:412) - Registering beans for JMX exposure on startup
    INFO jmx.BatchMBeanExporter (BatchMBeanExporter.java:189) - Registering job execution cleanupJob
    ERROR disk.DiskStorageFactory (DiskStorageFactory.java:495) - Disk Write of listJobs[0, 2147483647] failed:
    java.io.NotSerializableException: java.util.RandomAccessSubList
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteFields(Unkn own Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unkn own Source)
    at net.sf.ehcache.Element.writeObject(Element.java:83 5)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeWriteObject(Unknow n Source)
    at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
    at java.io.ObjectOutputStream.writeOrdinaryObject(Unk nown Source)
    at java.io.ObjectOutputStream.writeObject0(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at net.sf.ehcache.util.MemoryEfficientByteArrayOutput Stream.serialize(MemoryEfficientByteArrayOutputStr eam.java:97)
    at net.sf.ehcache.store.disk.DiskStorageFactory.seria lizeElement(DiskStorageFactory.java:405)
    at net.sf.ehcache.store.disk.DiskStorageFactory.write (DiskStorageFactory.java:384)
    at net.sf.ehcache.store.disk.DiskStorageFactory$DiskW riteTask.call(DiskStorageFactory.java:485)
    at net.sf.ehcache.store.disk.DiskStorageFactory$Persi stentDiskWriteTask.call(DiskStorageFactory.java:10 88)
    at net.sf.ehcache.store.disk.DiskStorageFactory$Persi stentDiskWriteTask.call(DiskStorageFactory.java:10 72)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unkn own Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    INFO jmx.BatchMBeanExporter (MBeanExporter.java:651) - Located managed bean 'spring.application.ENTW:type=JobExecution,name=cl eanupJob': registering with JMX server as MBean [spring.application.ENTW:type=JobExecution,name=cle anupJob]
    INFO jmx.BatchMBeanExporter (BatchMBeanExporter.java:189) - Registering job execution firstTestJob
    INFO jmx.BatchMBeanExporter (MBeanExporter.java:651) - Located managed bean 'spring.application.ENTW:type=JobExecution,name=fi rstTestJob': registering with JMX server as MBean [spring.application.ENTW:type=JobExecution,name=fir stTestJob]
    INFO jmx.BatchMBeanExporter (BatchMBeanExporter.java:189) - Registering job execution secondTestJob
    .....

    it also seems this error is not blocking because the startup of the server continue after this error and that job (i.e. the so called cleanupJob) will run without problem.

    did anybody know how to solve this problem?

    Thank you for any suggestion
    Franco

  • #2
    Do you have info on versions (batch and admin)?

    Comment


    • #3
      thank you for reply Mr. mminella,

      My spring-batch-admin-manager jar file reports version 1.2.2.RELEASE
      Spring-batch-core reports version 2.1.9.RELEASE
      Spring Framework reports version 3.2.2.RELEASE
      Spring integration reports version 2.2.2.RELEASE
      Spring security reports version 3.1.1.RELEASE

      Comment


      • #4
        Sorry, I just realized that this was a java.io.NotSerializableException. Where is that RandomAccessSubList coming from (it's not used in any of the Spring Batch projects to my knowledge) and what is it being used for?

        Comment


        • #5
          Originally posted by mminella View Post
          Sorry, I just realized that this was a java.io.NotSerializableException. Where is that RandomAccessSubList coming from (it's not used in any of the Spring Batch projects to my knowledge) and what is it being used for?
          Mhmm....this is not on my own code...

          Let's say: the only other thing I added to the basic Spring batch admin project is a
          scheduler for job added with Quartz ( using Spring' SchedulerFactorybean ) may it be in there?

          Comment


          • #6
            bug found!

            Hello mr. Minella,
            After deep debugging I found that the problem is located in the org.springframework.batch.admin.jmx.BAtchMBeanExpo rter

            more precisely here:
            private void registerJobs() {
            for (String jobName : jobService.listJobs(0, Integer.MAX_VALUE)) {
            if (!jobKeys.contains(jobName)) {
            jobKeys.add(jobName);
            logger.info("Registering job execution " + jobName);
            registerBeanNameOrInstance(jobExecutionMetricsFact ory.createMetricsForJob(jobName),
            getBeanKeyForJobExecution(jobName));
            }
            }
            }

            the listJobs(0,integer.MAX_VALUE) is the object not serializable that appears in the stacktrace:

            ERROR disk.DiskStorageFactory (DiskStorageFactory.java:495) - Disk Write of listJobs[0, 2147483647] failed:
            java.io.NotSerializableException: java.util.RandomAccessSubList
            at java.io.ObjectOutputStream.writeObject0(Unknown Source)
            ....

            it could be that is enough setting as "serializable" the Collection<String> listJobs defined in org.springframework.batch.admin.service.Jobservice , but I don't know about side effects...

            Do you think it is possible to fix it?

            many thanks

            Comment


            • #7
              Please tell me how to proceed. thanks

              Hello everybody,

              I think I found this as a bug in batch-admin-mx jar file:
              I think I found the solution, but I don't know what to do now.

              Could anybody tell me how to proceed?

              thank you
              Franco


              Originally posted by francoatwork View Post
              Hello mr. Minella,
              After deep debugging I found that the problem is located in the org.springframework.batch.admin.jmx.BAtchMBeanExpo rter

              more precisely here:
              private void registerJobs() {
              for (String jobName : jobService.listJobs(0, Integer.MAX_VALUE)) {
              if (!jobKeys.contains(jobName)) {
              jobKeys.add(jobName);
              logger.info("Registering job execution " + jobName);
              registerBeanNameOrInstance(jobExecutionMetricsFact ory.createMetricsForJob(jobName),
              getBeanKeyForJobExecution(jobName));
              }
              }
              }

              the listJobs(0,integer.MAX_VALUE) is the object not serializable that appears in the stacktrace:

              ERROR disk.DiskStorageFactory (DiskStorageFactory.java:495) - Disk Write of listJobs[0, 2147483647] failed:
              java.io.NotSerializableException: java.util.RandomAccessSubList
              at java.io.ObjectOutputStream.writeObject0(Unknown Source)
              ....

              it could be that is enough setting as "serializable" the Collection<String> listJobs defined in org.springframework.batch.admin.service.Jobservice , but I don't know about side effects...

              Do you think it is possible to fix it?

              many thanks

              Comment


              • #8
                Had the same issue with ehcache 2.7.3 and 2.5.1. Solved it by downgrade ehcache,jar to 2.30 version. Looks like there is no backward compatibility in ehcache.

                Comment


                • francoatwork
                  francoatwork commented
                  Editing a comment
                  I had given up any hope that somebody would answer me..
                  Thank you Hungry wolf for you post!
                  that downgrade solved my problem.
                  In effect I see there is a small differences between the two version .
                  The real solution indeed should be to fix up the class org.springframework.batch.admin.jmx.BatchMBeanExpo rter
                  but I don't know who should be in charge do do that.

                  Many thanks again
                  Franco
              Working...
              X