You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/07/14 11:04:44 UTC

[GitHub] [camel-kameleon] erayerdem edited a comment on pull request #5: NullPointer Exception

erayerdem edited a comment on pull request #5:
URL: https://github.com/apache/camel-kameleon/pull/5#issuecomment-879784645


   @zregvart I dont get exception in this project but I have a quarkus application when I was get null pointer exception in this method on openshift 
   
   pom.xml
   
   ```xml  
   <properties>
       <compiler-plugin.version>3.8.1</compiler-plugin.version>
       <maven.compiler.parameters>true</maven.compiler.parameters>
       <maven.compiler.source>11</maven.compiler.source>
       <maven.compiler.target>11</maven.compiler.target>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
       <quarkus-plugin.version>1.13.2.Final</quarkus-plugin.version>
       <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
       <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
       <quarkus.platform.version>1.13.2.Final</quarkus.platform.version>
       <surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
     </properties>
   ```
   
   I have a file at `resources/pinglist/ping.xml`
   
   ```
     void onStart(@Observes StartupEvent ev) throws Exception {
           InputStream resourceAsStream = getClass().getResourceAsStream("pinglist/ping.xml");
     }
   ```
   
   Dockerfile
   
   ```
   FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3 
   
   ARG JAVA_PACKAGE=java-11-openjdk-headless
   ARG RUN_JAVA_VERSION=1.3.8
   ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
   
   RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
       && microdnf update \
       && microdnf clean all \
       && mkdir /deployments \
       && chown 1001 /deployments \
       && chmod "g+rwX" /deployments \
       && chown 1001:root /deployments \
       && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
       && chown 1001 /deployments/run-java.sh \
       && chmod 540 /deployments/run-java.sh \
       && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
   ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
   COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
   COPY --chown=1001 target/quarkus-app/*.jar /deployments/
   COPY --chown=1001 target/quarkus-app/app/ /deployments/app/
   COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/
   
   EXPOSE 8080
   USER 1001
   
   ENTRYPOINT [ "/deployments/run-java.sh" ]
   
   
   
   ```
   
   Exception stack trace on openshift 
   
   ```
   2021-07-14 10:34:38,718 ERROR [io.qua.run.Application] (main) Failed to start application (with profile dev): java.lang.NullPointerException
   	at org.apache.poi.poifs.filesystem.FileMagic.prepareToCheckMagic(FileMagic.java:219)
   	at org.apache.poi.openxml4j.opc.internal.ZipHelper.openZipStream(ZipHelper.java:174)
   	at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:104)
   	at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:307)
   	at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:47)
   	at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:309)
   	at com.health.file.FileReader.readMachinePropertiesFromExcel(FileReader.java:38)
   	at com.health.file.FileReader.onStart(FileReader.java:31)
   	at com.health.file.FileReader_Observer_onStart_fd71b5e0b207b7d1ef838b94eaeff75e52b8f463.notify(FileReader_Observer_onStart_fd71b5e0b207b7d1ef838b94eaeff75e52b8f463.zig:147)
   	at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:283)
   	at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:268)
   	at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:70)
   	at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:128)
   	at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:97)
   	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(LifecycleEventsBuildStep$startupEvent1144526294.zig:87)
   	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(LifecycleEventsBuildStep$startupEvent1144526294.zig:40)
   	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:697)
   	at io.quarkus.runtime.Application.start(Application.java:90)
   	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:100)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
   	at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
   	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:48)
   	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:25)
   ``


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org