-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JobOperatorImpl cannot be instantiated #1103
Comments
We will need a lot more information to be able to help on this.
|
Hi Mike,
, However, i still receive a NPE for the JobOperatorImpl object after I executed: This is now the error log:
The actual outcome is that the application is not recognizing the current batch runtime persistence configuration that I made on Payara for the Job Repository (MySQL) and instead is trying to use the default Derby database configuration (see file attached). The expected outcome is to accomplish a connection to my MySQL database configured as the job Repository The version of Payara is "Payara Server 163" |
Can you make sure there are no JBatch jars in your ear file. All the dependencies should be provided scope |
Steve, I removed all dependencies and the issue is still the same. |
Can you try this sample application? https://github.com/payara/Payara-Examples/tree/master/Java-EE/jbatch-schedule |
I tested against MySQL with the example application and had no problem. Here's an asadmin script to configure MySQL generated using the asadmin recorder in the admin console. The script assumes your mysql schema name, the user and the password are all payara. create-jdbc-connection-pool --validateAtmostOncePeriodInSeconds=0 --statementLeakReclaim=false --ping=false --maxWaitTimeInMillis=60000 --wrapJdbcObjects=true --connectionValidationMethod=table --steadyPoolSize=8 --idleTimeoutInSeconds=300 --maxConnectionUsageCount=0 --matchConnections=false --connectionCreationRetryIntervalInSeconds=10 --associateWithThread=false --isConnectionValidationRequired=false --connectionLeakReclaim=false --datasourceClassname=com.mysql.jdbc.jdbc2.optional.MysqlDataSource --connectionCreationRetryAttempts=0 --statementCacheSize=0 --resType=javax.sql.DataSource --statementLeakTimeoutInSeconds=0 --failAllConnections=false --statementTimeoutInSeconds=-1 --lazyConnectionEnlistment=false --pooling=true --poolResizeQuantity=2 --allowNonComponentCallers=false --connectionLeakTimeoutInSeconds=0 --isIsolationLevelGuaranteed=true --maxPoolSize=32 --nonTransactionalConnections=false --lazyConnectionAssociation=false NewBatchPool
set resources.jdbc-connection-pool.NewBatchPool.property.User=payara resources.jdbc-connection-pool.NewBatchPool.property.Password=payara resources.jdbc-connection-pool.NewBatchPool.property.ZeroDateTimeBehavior=convertToNull
create-jdbc-resource --enabled=true --poolName=NewBatchPool --target=domain jdbc/BatchPool
create-resource-ref --enabled=true --target=server jdbc/BatchPool
set-batch-runtime-configuration --tableSuffix= --tablePrefix= --dataSourceLookupName=jdbc/BatchPool --executorServiceLookupName=concurrent/__defaultManagedExecutorService --schemaName=payara --target=server-config |
The issue keeps the same, even now that I'm using the new BatchPool resource. I think there is something with the variables stored in batchContainerProps corresponding to the ServicesManagerImpl object of my JobOperatorImpl. Values are still pointing to a Derby database. Thanks. |
There are only three code paths where that NPE can occur that I can see.
The only other option is that you have jars from JBatch in your WEB-INF/lib in your war file. I can't see how else the NPE could be thrown. |
Steve, I finally could solve it. I activated debug mode on both the server and on Netbeans. First, I noticed that I received the following message:
, and I found that Glassfish was trying to interpret that the schema that we configured days ago as 'payara' was misunderstood as if it were the "database". Then I remember an article I read here, (see section "3.4 Specifying a Blank Schema Name") so I left empty the schema property, however I received this other message in the log:
Finally, I renamed the JDBC resource, from jdbc/batchpool to jdbc/test (as it is also explained on the previous document) and it worked!! Thanks! |
Great we need to make these errors more obvious by suppressing the stack traces to make it easy to spot problems like this. |
Hello, I'm having an issue when trying to run a test on JBatch. I'm receiving the following errors on server.log (debug mode):
Grave: Could not instantiate service: fish.payara.jbatch.persistence.rdbms.LazyBootPersistenceManager due to exception:java.lang.ClassNotFoundException: fish.payara.jbatch.persistence.rdbms.LazyBootPersistenceManager not found by org.glassfish.main.batch.payara-jbatch [241]
Grave: Could not instantiate service: com.ibm.jbatch.container.impl.BatchKernelImpl due to exception:java.lang.reflect.InvocationTargetException
Advertencia: Exception while dispatching an event
java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider com.ibm.jbatch.container.api.impl.JobOperatorImpl could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:51)
at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:46)
at java.security.AccessController.doPrivileged(Native Method)
at javax.batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:46)
at org.glassfish.batch.spi.impl.BatchRuntimeHelper.event(BatchRuntimeHelper.java:221)
at org.glassfish.kernel.event.EventsImpl$1.run(EventsImpl.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Could not instantiate service com.ibm.jbatch.container.impl.BatchKernelImpl
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:424)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:403)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:388)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:304)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getBatchKernelService(ServicesManagerImpl.java:348)
at com.ibm.jbatch.container.api.impl.JobOperatorImpl.(JobOperatorImpl.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadService(ServicesManagerImpl.java:447)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:420)
... 24 more
Caused by: java.lang.RuntimeException: Could not instantiate service fish.payara.jbatch.persistence.rdbms.LazyBootPersistenceManager
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:424)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:403)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:388)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:304)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getPersistenceManagerService(ServicesManagerImpl.java:333)
at com.ibm.jbatch.container.impl.BatchKernelImpl.(BatchKernelImpl.java:87)
... 30 more
Caused by: java.lang.ClassNotFoundException: fish.payara.jbatch.persistence.rdbms.LazyBootPersistenceManager not found by org.glassfish.main.batch.payara-jbatch [241]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadService(ServicesManagerImpl.java:441)
at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:420)
... 35 more
Advertencia: RAR8068: Using default datasource : __ds_jdbc_ra for pool : java:app/fact_electPool
Información: EclipseLink, version: Eclipse Persistence Services - 2.6.2.qualifier
Información: /file:/C:/Users/ivan.gonzalez.saenz/workspace/FactElectronica/FactElectronica-ear/target/gfdeploy/FactElectronica-ear/FactElectronica-web-1.0-SNAPSHOT_war/WEB-INF/lib/FactElectronica-ejb-1.0-SNAPSHOT.jar_FactElectronicaPU login successful
Información: Portable JNDI names for EJB NewSessionBean: [java:global/FactElectronica-ear/FactElectronica-ejb-1.0-SNAPSHOT/NewSessionBean!com.igonzalez.NewSessionBean, java:global/FactElectronica-ear/FactElectronica-ejb-1.0-SNAPSHOT/NewSessionBean]
Información: Portable JNDI names for EJB NewSessionBean: [java:global/FactElectronica-ear/FactElectronica-web-1.0-SNAPSHOT/NewSessionBean, java:global/FactElectronica-ear/FactElectronica-web-1.0-SNAPSHOT/NewSessionBean!com.igonzalez.NewSessionBean]
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: WELD-000411: Observer method [BackedAnnotatedMethod] private org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.processAnnotatedType(@observes ProcessAnnotatedType) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
Información: Inicializando Mojarra 2.2.13 ( 20160203-1910 unable to get svn info) para el contexto '/FactElectronica-web'
Información: Loading application [FactElectronica-ear#FactElectronica-web-1.0-SNAPSHOT.war] at [/FactElectronica-web]
Información: FactElectronica-ear was successfully deployed in 2.141 milliseconds.
Advertencia: Context path from ServletContext: differs from path from bundle: /
Información: Redirecting to /common/index.jsf
Información: Admin Console: Initializing Session Attributes...
Advertencia: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
The text was updated successfully, but these errors were encountered: