kumuluz / kumuluzee

Lightweight open-source framework for developing microservices using standard Java EE technologies and migrating Java EE to cloud-native architecture.
https://ee.kumuluz.com
MIT License
291 stars 71 forks source link

Exception in thread "main" com.kumuluz.ee.common.exceptions.KumuluzServerException: #135

Closed ArtHoffmann closed 5 years ago

ArtHoffmann commented 5 years ago

Hello KumuluzEE user, I have a new project in mind and would like to deploy it. However, I get the following message every time:

With the sample projects it works perfectly, now I wanted to set one up on my own and hang on to this point

2019-03-08 14:16:05.818 INFO -- com.kumuluz.ee.configuration.sources.FileConfigurationSource -- Loading configuration from YAML file. 2019-03-08 14:16:05.834 INFO -- com.kumuluz.ee.configuration.sources.FileConfigurationSource -- Configuration successfully read. 2019-03-08 14:16:05.836 INFO -- com.kumuluz.ee.EeApplication -- Initialized configuration source: EnvironmentConfigurationSource 2019-03-08 14:16:05.836 INFO -- com.kumuluz.ee.EeApplication -- Initialized configuration source: SystemPropertyConfigurationSource 2019-03-08 14:16:05.837 INFO -- com.kumuluz.ee.EeApplication -- Initialized configuration source: FileConfigurationSource 2019-03-08 14:16:05.837 INFO -- com.kumuluz.ee.EeApplication -- Initializing KumuluzEE 2019-03-08 14:16:05.838 INFO -- com.kumuluz.ee.EeApplication -- Checking for requirements 2019-03-08 14:16:05.839 INFO -- com.kumuluz.ee.EeApplication -- KumuluzEE running inside a JAR runtime. 2019-03-08 14:16:05.839 INFO -- com.kumuluz.ee.EeApplication -- Checks passed 2019-03-08 14:16:05.840 INFO -- com.kumuluz.ee.EeApplication -- Initialized main configuration 2019-03-08 14:16:05.841 INFO -- com.kumuluz.ee.EeApplication -- Loading available EE components and extensions 2019-03-08 14:16:05.842 INFO -- com.kumuluz.ee.loaders.ServerLoader -- Loading the KumuluzEE server... 2019-03-08 14:16:05.859 INFO -- com.kumuluz.ee.loaders.ServerLoader -- Found Jetty 2019-03-08 14:16:05.861 INFO -- com.kumuluz.ee.loaders.ComponentLoader -- Loading available components 2019-03-08 14:16:05.874 INFO -- com.kumuluz.ee.loaders.ComponentLoader -- Loading for components complete 2019-03-08 14:16:05.879 INFO -- com.kumuluz.ee.EeApplication -- Processing EE component dependencies 2019-03-08 14:16:05.880 SEVERE -- com.kumuluz.ee.EeApplication -- EE component dependency unfulfilled. The EE component Bean Validation implemented by Hibernate Validator requires EL, which was not found. Please make sure to include the required component. Exception in thread "main" com.kumuluz.ee.common.exceptions.KumuluzServerException: EE component dependency unfulfilled. The EE component Bean Validation implemented by Hibernate Validator requires EL, which was not found. Please make sure to include the required component. at com.kumuluz.ee.EeApplication.processEeComponents(EeApplication.java:457) at com.kumuluz.ee.EeApplication.initialize(EeApplication.java:158) at com.kumuluz.ee.EeApplication.(EeApplication.java:73) at com.kumuluz.ee.EeApplication.main(EeApplication.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.kumuluz.ee.loader.EeClassLoader.invokeMain(EeClassLoader.java:437) at com.kumuluz.ee.loader.EeBootLoader.launch(EeBootLoader.java:54) at com.kumuluz.ee.loader.EeBootLoader.main(EeBootLoader.java:41)

Thank you very much.

jmezna commented 5 years ago

Hi,

As the exception logs states, you are missing the EL component. Add the following dependency to your project:

        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-el-uel</artifactId>
        </dependency>
ArtHoffmann commented 5 years ago

Thank you it works! So I would have one more question, would you have a standard project linked to Hibernate? I'm relatively new to this framework and don't know much about mici. It would also help if you could show me a config.yaml + persistence.xml which contains the Hibernate configuration.

jmezna commented 5 years ago

If you want to use Hibernate instead of EclipseLink, just replace

        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-jpa-eclipselink</artifactId>
        </dependency>

with

        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-jpa-hibernate</artifactId>
        </dependency>

Other configuration and code stays the unchanged.

ArtHoffmann commented 5 years ago

Okok. Thanks!!

ArtHoffmann commented 5 years ago

After adding Swagger i get this message: 2019-03-08 17:42:27.360 WARNING -- com.kumuluz.ee.swagger.SwaggerExtension -- Provided URL not valid. Check the value of kumuluzee.swagger.base-url or kumuluzee.server.base-url. Exception in thread "main" java.lang.NoSuchMethodError: io.swagger.jaxrs.config.BeanConfig.setScannerId(Ljava/lang/String;)V at com.kumuluz.ee.swagger.SwaggerExtension.init(SwaggerExtension.java:151) at com.kumuluz.ee.EeApplication.initialize(EeApplication.java:367) at com.kumuluz.ee.EeApplication.(EeApplication.java:73) at com.kumuluz.ee.EeApplication.main(EeApplication.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.kumuluz.ee.loader.EeClassLoader.invokeMain(EeClassLoader.java:437) at com.kumuluz.ee.loader.EeBootLoader.launch(EeBootLoader.java:54) at com.kumuluz.ee.loader.EeBootLoader.main(EeBootLoader.java:41)

all dependencies are imported in pom.xml

jmezna commented 5 years ago

You have to set the kumuluzee.swagger.base-url or kumuluzee.server.base-url value in the configuration. See sample: https://github.com/kumuluz/kumuluzee-samples/blob/master/kumuluzee-swagger/src/main/resources/config.yaml

ArtHoffmann commented 5 years ago

Still exists.. i modified everything in yaml, ressource etc..

2019-03-11 15:50:37.887 WARNING -- com.kumuluz.ee.swagger.SwaggerExtension -- kumuluzee.swagger.base-url not set. Trying kumuluzee.server.base-url. 2019-03-11 15:50:37.968 INFO -- org.reflections.Reflections -- Reflections took 61 ms to scan 1 urls, producing 228 keys and 230 values Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator; at org.reflections.Reflections.expandSuperTypes(Reflections.java:380) at org.reflections.Reflections.(Reflections.java:126) at io.swagger.jaxrs.config.BeanConfig.classes(BeanConfig.java:276) at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:240) at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221) at com.kumuluz.ee.swagger.SwaggerExtension.init(SwaggerExtension.java:156) at com.kumuluz.ee.EeApplication.initialize(EeApplication.java:367) at com.kumuluz.ee.EeApplication.(EeApplication.java:73) at com.kumuluz.ee.EeApplication.main(EeApplication.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.kumuluz.ee.loader.EeClassLoader.invokeMain(EeClassLoader.java:437) at com.kumuluz.ee.loader.EeBootLoader.launch(EeBootLoader.java:54) at com.kumuluz.ee.loader.EeBootLoader.main(EeBootLoader.java:41)

jmezna commented 5 years ago

The Swagger-related exception is now resolved. This looks like a problem with different versions of guava library. Can you check if the problem originates in one of your dependencies?

ArtHoffmann commented 5 years ago

Ok it works with the following dependency.

<dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>27.1-jre</version>
</dependency>