java.lang.NullPointerException

Spring JIRA | Buelent Zeyben | 2 years ago
  1. 0

    Based on the OOTB sqoop.xml definition on GitHub we are required to provide the jdbc.url, jdbc.username and jdbc.password as a parameter definition. {code} <bean id="sqoopTasklet" class="org.springframework.xd.sqoop.SqoopTasklet"> <property name="arguments"> <list> <value>${command}</value> <value>${args}</value> <value>jdbc.url=${url}</value> <value>jdbc.username=${username}</value> <value>jdbc.password=${password}</value> <value>fs.defaultFS=${fsUri}</value> ... {code} This is causing a problem if we define the the sqoop connection parameters within the args list. We are using the --password-file option in the args list and need to specify the connection info via the --connect option with the --username within the args list. Our Job definition is: {code} job create bdl_lookup --definition "bdl-load --command=import --args='--connect=jdbc:oracle:thin:@<hostName>:1821/<dbName> --username=<user> --password-file=/user/workspace/secure-files/gdw.password --table=MASTERDATA.W_LOOKUP_D --target-dir=/<targetFolder/lookup_d -m 1' " {code} This results to an deployment: {code} 2015-05-07 11:40:51,586 1.2.0.M1 INFO DeploymentSupervisor-0 zk.ZKJobDeploymentHandler - Deployment status for job 'bdl_lookup': DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'sqoopTasklet' defined in class path resource [config/bdl-load.xml]: Could not resolve placeholder 'url' in string value "jdbc.url=${url}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'url' in string value "jdbc.url=${url}" {code} If we skip the jdbc connection info from the module.xml file, similar to: {code} <bean id="sqoopTasklet" class="org.springframework.xd.sqoop.SqoopTasklet"> <property name="arguments"> <list> <value>${command}</value> <value>${args}</value> <!-- Comment out jdbc info <value>jdbc.url=${url}</value> <value>jdbc.username=${username}</value> <value>jdbc.password=${password}</value> --> <value>fs.defaultFS=${fsUri}</value> ... {code} Custom module deploys fine but get a We get a NullPointerException in the container logs: {code} 2015-05-07 11:46:04,450 1.2.0.M1 ERROR inbound.job:bdl_lookup-redis:queue-inbound-channel-adapter1 step.AbstractStep - Encountered an error executing step sqoopTask in job bdl_lookup java.lang.NullPointerException at org.springframework.xd.sqoop.SqoopTasklet.createCommand(SqoopTasklet.java:91) at org.springframework.batch.step.tasklet.x.AbstractProcessBuilderTasklet.execute(AbstractProcessBuilderTasklet.java:107) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77) {code}

    Spring JIRA | 2 years ago | Buelent Zeyben
    java.lang.NullPointerException
  2. 0

    Based on the OOTB sqoop.xml definition on GitHub we are required to provide the jdbc.url, jdbc.username and jdbc.password as a parameter definition. {code} <bean id="sqoopTasklet" class="org.springframework.xd.sqoop.SqoopTasklet"> <property name="arguments"> <list> <value>${command}</value> <value>${args}</value> <value>jdbc.url=${url}</value> <value>jdbc.username=${username}</value> <value>jdbc.password=${password}</value> <value>fs.defaultFS=${fsUri}</value> ... {code} This is causing a problem if we define the the sqoop connection parameters within the args list. We are using the --password-file option in the args list and need to specify the connection info via the --connect option with the --username within the args list. Our Job definition is: {code} job create bdl_lookup --definition "bdl-load --command=import --args='--connect=jdbc:oracle:thin:@<hostName>:1821/<dbName> --username=<user> --password-file=/user/workspace/secure-files/gdw.password --table=MASTERDATA.W_LOOKUP_D --target-dir=/<targetFolder/lookup_d -m 1' " {code} This results to an deployment: {code} 2015-05-07 11:40:51,586 1.2.0.M1 INFO DeploymentSupervisor-0 zk.ZKJobDeploymentHandler - Deployment status for job 'bdl_lookup': DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'sqoopTasklet' defined in class path resource [config/bdl-load.xml]: Could not resolve placeholder 'url' in string value "jdbc.url=${url}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'url' in string value "jdbc.url=${url}" {code} If we skip the jdbc connection info from the module.xml file, similar to: {code} <bean id="sqoopTasklet" class="org.springframework.xd.sqoop.SqoopTasklet"> <property name="arguments"> <list> <value>${command}</value> <value>${args}</value> <!-- Comment out jdbc info <value>jdbc.url=${url}</value> <value>jdbc.username=${username}</value> <value>jdbc.password=${password}</value> --> <value>fs.defaultFS=${fsUri}</value> ... {code} Custom module deploys fine but get a We get a NullPointerException in the container logs: {code} 2015-05-07 11:46:04,450 1.2.0.M1 ERROR inbound.job:bdl_lookup-redis:queue-inbound-channel-adapter1 step.AbstractStep - Encountered an error executing step sqoopTask in job bdl_lookup java.lang.NullPointerException at org.springframework.xd.sqoop.SqoopTasklet.createCommand(SqoopTasklet.java:91) at org.springframework.batch.step.tasklet.x.AbstractProcessBuilderTasklet.execute(AbstractProcessBuilderTasklet.java:107) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77) {code}

    Spring JIRA | 2 years ago | Buelent Zeyben
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.springframework.xd.sqoop.SqoopTasklet.createCommand()
    2. org.springframework.xd
      SqoopTasklet.createCommand
      1. org.springframework.xd.sqoop.SqoopTasklet.createCommand(SqoopTasklet.java:91)
      1 frame
    3. org.springframework.batch
      AbstractProcessBuilderTasklet.execute
      1. org.springframework.batch.step.tasklet.x.AbstractProcessBuilderTasklet.execute(AbstractProcessBuilderTasklet.java:107)
      1 frame
    4. Spring Batch Core
      TaskletStep$ChunkTransactionCallback.doInTransaction
      1. org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
      2. org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
      2 frames
    5. Spring Tx
      TransactionTemplate.execute
      1. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
      1 frame
    6. Spring Batch Core
      StepContextRepeatCallback.doInIteration
      1. org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)
      2. org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77)
      2 frames