You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2023/01/19 12:41:59 UTC

[GitHub] [incubator-eventmesh] seriouszyx opened a new issue, #2935: [Bug] Failed to address the resource file from within Jar as a File

seriouszyx opened a new issue, #2935:
URL: https://github.com/apache/incubator-eventmesh/issues/2935

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Environment
   
   Windows
   
   ### EventMesh version
   
   master
   
   ### What happened
   
   When I run the latest master code, the program cannot read the Prometheus configuration file. 
   
   I found [L137-L140](https://github.com/apache/incubator-eventmesh/blob/0a13020172e2d608754c3041ef761b207ccbaf1c/eventmesh-common/src/main/java/org/apache/eventmesh/common/config/ConfigService.java#L137-L140) Failed to address the resource file from within Jar as a File, instead, [getResourceAsStream](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29) should be used. 
   
   ref: https://stackoverflow.com/questions/20389255/reading-a-resource-file-from-within-jar
   
   ### How to reproduce
   
   Just run the master code. 
   
   ### Debug logs
   
   ```
   2023-01-19 20:33:52,804 INFO  [main] EventMeshTcpRetryer(EventMeshTcpRetryer.java:102) - EventMeshTcpRetryer inited......
   2023-01-19 20:33:52,807 INFO  [main] MetaInfExtensionClassLoader(MetaInfExtensionClassLoader.java:77) - load extension class success, extensionType: interface org.apache.eventmesh.metrics.api.MetricsRegistry, extensionClass: class org.apache.eventmesh.metrics.prometheus.PrometheusMetricsRegistry
   2023-01-19 20:33:52,812 pool-1-thread-1 DEBUG Stopping LoggerContext[name=73d16e93, org.apache.logging.log4j.core.LoggerContext@342c38f8]
   2023-01-19 20:33:52,812 pool-1-thread-1 DEBUG Stopping LoggerContext[name=73d16e93, org.apache.logging.log4j.core.LoggerContext@342c38f8]...
   2023-01-19 20:33:52,808 ERROR [main] EventMeshStartup(EventMeshStartup.java:56) - EventMesh start fail.
   java.lang.RuntimeException: file is not exists
   	at org.apache.eventmesh.common.config.ConfigService.getConfig(ConfigService.java:139) ~[eventmesh-common-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.common.config.ConfigService.populateConfig(ConfigService.java:168) ~[eventmesh-common-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.common.config.ConfigService.populateConfigForObject(ConfigService.java:113) ~[eventmesh-common-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.spi.EventMeshExtensionFactory.lambda$getSingletonExtension$0(EventMeshExtensionFactory.java:91) ~[eventmesh-spi-1.7.0-release.jar:1.7.0-release]
   	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_291]
   	at org.apache.eventmesh.spi.EventMeshExtensionFactory.getSingletonExtension(EventMeshExtensionFactory.java:84) ~[eventmesh-spi-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.spi.EventMeshExtensionFactory.getExtension(EventMeshExtensionFactory.java:77) ~[eventmesh-spi-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.metrics.api.MetricsPluginFactory.getMetricsRegistry(MetricsPluginFactory.java:38) ~[eventmesh-metrics-api-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.runtime.boot.EventMeshTCPServer.lambda$null$1(EventMeshTCPServer.java:224) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_291]
   	at org.apache.eventmesh.runtime.boot.EventMeshTCPServer.lambda$init$2(EventMeshTCPServer.java:223) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_291]
   	at org.apache.eventmesh.runtime.boot.EventMeshTCPServer.init(EventMeshTCPServer.java:222) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.runtime.boot.EventMeshTcpBootstrap.init(EventMeshTcpBootstrap.java:50) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.runtime.boot.EventMeshServer.init(EventMeshServer.java:108) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.runtime.boot.EventMeshServer.<init>(EventMeshServer.java:83) ~[eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.runtime.boot.EventMeshStartup.main(EventMeshStartup.java:38) [eventmesh-runtime-1.7.0-release.jar:1.7.0-release]
   	at org.apache.eventmesh.starter.StartUp.main(StartUp.java:24) [main/:?]
   ```
   
   ![image](https://user-images.githubusercontent.com/33992371/213444514-3b874850-afa4-4bfd-badb-fe992df6dda9.png)
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
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: dev-unsubscribe@eventmesh.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] sbmvirdi commented on issue #2935: [Bug] Failed to address the resource file from within Jar as a File

Posted by "sbmvirdi (via GitHub)" <gi...@apache.org>.
sbmvirdi commented on issue #2935:
URL: https://github.com/apache/incubator-eventmesh/issues/2935#issuecomment-1399317878

   i want to know how to run this project? i am exploring the project and issue.


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] Alonexc commented on issue #2935: [Bug] Failed to address the resource file from within Jar as a File

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on issue #2935:
URL: https://github.com/apache/incubator-eventmesh/issues/2935#issuecomment-1407321640

   > i want to know how to run this project? i am exploring the project and issue.
   
   @sbmvirdi You can refer to this document: https://github.com/apache/incubator-eventmesh/blob/master/docs/zh/instruction/02-runtime.md


-- 
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: devnull-unsubscribe@infra.apache.org

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


[GitHub] [incubator-eventmesh] sbmvirdi commented on issue #2935: [Bug] Failed to address the resource file from within Jar as a File

Posted by GitBox <gi...@apache.org>.
sbmvirdi commented on issue #2935:
URL: https://github.com/apache/incubator-eventmesh/issues/2935#issuecomment-1398504839

   Hi I would like to pickup this task. I am new to open source and have started contributing to the project by making small fixes and gradually i'll get more clarity about the system will try to pickup more complex task to showcase my skills in java.


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xwm1992 closed issue #2935: [Bug] Failed to address the resource file from within Jar as a File

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 closed issue #2935: [Bug] Failed to address the resource file from within Jar as a File 
URL: https://github.com/apache/incubator-eventmesh/issues/2935


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] seriouszyx commented on issue #2935: [Bug] Failed to address the resource file from within Jar as a File

Posted by "seriouszyx (via GitHub)" <gi...@apache.org>.
seriouszyx commented on issue #2935:
URL: https://github.com/apache/incubator-eventmesh/issues/2935#issuecomment-1399191569

   > Hi I would like to pickup this task. I am new to open source and have started contributing to the project by making small fixes and gradually i'll get more clarity about the system will try to pickup more complex task to showcase my skills in java.
   
   Welcome to pick up this task.  Feel free to communicate with me if you have any progress or questions! 


-- 
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: dev-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org