Forum Stats

  • 3,733,039 Users
  • 2,246,686 Discussions
  • 7,856,490 Comments

Discussions

Issue in mutithreading

Chandan Srivastava
Chandan Srivastava Member Posts: 176

Hi

I have created a java program for multi threading.

In which I am using 2 web services in which one is fetching data from db and other is performing update into db.

First service is fetched 1041 records from db.

first time when I executes the code block, I provide 250 records for one thread so that total 5 threads are created and executes smoothly and updates the 1041 records in db using second Web service.

But now again when I am trying to run same program with 100 records for one thread so that total 11 threads are created, It gives some errors.

Exception in thread "Thread-1" java.lang.AssertionError: Kernel needs to be initialized before starting TimerThread.

  at weblogic.timers.internal.TimerThread.<init>(TimerThread.java:48)

  at weblogic.timers.internal.TimerThread.getTimerThread(TimerThread.java:178)

  at weblogic.timers.internal.TimerManagerImpl.getTimerManager(TimerManagerImpl.java:788)

  at weblogic.timers.internal.TimerManagerFactoryImpl.getTimerManager(TimerManagerFactoryImpl.java:79)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

Exception in thread "Thread-5" java.lang.AssertionError: Kernel needs to be initialized before starting TimerThread.

  at weblogic.timers.internal.TimerThread.<init>(TimerThread.java:48)

  at weblogic.timers.internal.TimerThread.getTimerThread(TimerThread.java:178)

  at weblogic.timers.internal.TimerManagerImpl.getTimerManager(TimerManagerImpl.java:788)

  at weblogic.timers.internal.TimerManagerFactoryImpl.getTimerManager(TimerManagerFactoryImpl.java:79)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

Exception in thread "Thread-3" java.lang.AssertionError: Kernel needs to be initialized before starting TimerThread.

  at weblogic.timers.internal.TimerThread.<init>(TimerThread.java:48)

  at weblogic.timers.internal.TimerThread.getTimerThread(TimerThread.java:178)

  at weblogic.timers.internal.TimerManagerImpl.getTimerManager(TimerManagerImpl.java:788)

  at weblogic.timers.internal.TimerManagerFactoryImpl.getTimerManager(TimerManagerFactoryImpl.java:79)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

Exception in thread "Thread-7" java.lang.AssertionError: Kernel needs to be initialized before starting TimerThread.

  at weblogic.timers.internal.TimerThread.<init>(TimerThread.java:48)

  at weblogic.timers.internal.TimerThread.getTimerThread(TimerThread.java:178)

  at weblogic.timers.internal.TimerManagerImpl.getTimerManager(TimerManagerImpl.java:788)

  at weblogic.timers.internal.TimerManagerFactoryImpl.getTimerManager(TimerManagerFactoryImpl.java:79)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

Exception in thread "Thread-9" java.lang.AssertionError: java.lang.reflect.InvocationTargetException

  at weblogic.kernel.KernelInitializer.initializeWebLogicKernel(KernelInitializer.java:45)

  at weblogic.timers.TimerManagerFactory.initialize(TimerManagerFactory.java:41)

  at weblogic.timers.TimerManagerFactory.getTimerManagerFactory(TimerManagerFactory.java:27)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.reflect.InvocationTargetException

  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:597)

  at weblogic.kernel.KernelInitializer.initializeWebLogicKernel(KernelInitializer.java:41)

  ... 13 more

Caused by: java.lang.InternalError: error initializing kernel caused by: java.lang.AssertionError: Duplicate initialization of WorkManager

  at weblogic.work.WorkManagerFactory.set(WorkManagerFactory.java:107)

  at weblogic.work.ExecuteQueueFactory.initialize(ExecuteQueueFactory.java:23)

  at weblogic.kernel.Kernel.initialize(Kernel.java:103)

  at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:64)

  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:597)

  at weblogic.kernel.KernelInitializer.initializeWebLogicKernel(KernelInitializer.java:41)

  at weblogic.timers.TimerManagerFactory.initialize(TimerManagerFactory.java:41)

  at weblogic.timers.TimerManagerFactory.getTimerManagerFactory(TimerManagerFactory.java:27)

  at weblogic.wsee.jaxws.spi.WLSProvider$ReferenceCleaner.<init>(WLSProvider.java:524)

  at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.<init>(WLSProvider.java:587)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:120)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:112)

  at weblogic.wsee.jaxws.spi.WLSProvider.createServiceDelegate(WLSProvider.java:83)

  at javax.xml.ws.Service.<init>(Service.java:56)

  at com.jefferies.clientcentral.ws.ReplicatorService.InternationalService.<init>(InternationalService.java:67)

  at com.jefferies.clientcentral.servicehelpers.ApplicationServiceHelper.replicateRequestInGCO(ApplicationServiceHelper.java:34)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.replicateRequests(ReplicateRequestsInGCO.java:29)

  at com.jefferies.clientcentral.ReplicateRequestsInGCO.run(ReplicateRequestsInGCO.java:22)

  at java.lang.Thread.run(Thread.java:662)

  at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:66)

  ... 18 more

Thanks,

Chandan

Sign In or Register to comment.