[ 
https://issues.apache.org/jira/browse/GEODE-7107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16912563#comment-16912563
 ] 

John Blum edited comment on GEODE-7107 at 8/21/19 6:00 PM:
-----------------------------------------------------------

Steps to reproduce this issue:

1. Navigate to http://start-development.cfapps.io/.

2. Create a _Maven_, _Java_ {{8}}, _Spring Boot_ {{2.2.0.M5}} project.

3. Set an appropriate {{Group}} and {{Artifact}}.

4. Add the "_Spring Data for Apache Geode_" Dependency.

5. Click "_Generate the project_".

6. Download the ZIP file, unzip it, and open the Spring Boot, Maven project in 
your IDE.

7. Add exclusions to the {{org.springframework.geode:spring-geode-starter}} 
dependency declared in the project Maven POM file, as follows:

{code:xml}
<dependency>
    <groupId>org.springframework.geode</groupId>
    <artifactId>spring-geode-starter</artifactId>
    <version>1.2.0.BUILD-SNAPSHOT</version>
    <exclusions>
        <exclusion>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-server</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </exclusion>
    </exclusions>
</dependency>
{code}

8. Run the {{SpringGeodeAppApplication}} class.

Witness the following Exception:

{code:java}
java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such method: 
org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
        at 
org.apache.geode.internal.cache.GemFireCacheImpl.close(GemFireCacheImpl.java:2183)
 ~[geode-core-1.9.0.jar:na]
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.disconnect(InternalDistributedSystem.java:1627)
 [geode-core-1.9.0.jar:na]
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.lambda$static$4(InternalDistributedSystem.java:2278)
 [geode-core-1.9.0.jar:na]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_192]
Caused by: java.lang.IllegalAccessError: no such method: 
org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
        at 
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:483)
 ~[na:1.8.0_192]
        ... 4 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
        at java.lang.invoke.MethodHandleNatives.resolve(Native Method) 
~[na:1.8.0_192]
        at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
 ~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
 ~[na:1.8.0_192]
        ... 4 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) 
~[na:1.8.0_192]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_192]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) 
~[na:1.8.0_192]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_192]
        ... 10 common frames omitted
{code}

I expect that Apache Geode, in no way, tries to manipulate the embedded HTTP 
service (implemented with Jetty), especially for a Spring Boot, Apache Geode 
{{ClientCache}} application, which is what this is!


was (Author: jblum):
Steps to reproduce this issue:

1. Navigate to http://start-development.cfapps.io/.

2. Create a _Maven_, _Java_ {{8}}, _Spring Boot_ {{2.2.0.M5}} project.

3. Set an appropriate {{Group}} and {{Artifact}}.

4. Add the "_Spring Data for Apache Geode_" Dependency.

5. Click "_Generate the project_".

6. Download the ZIP file, unzip it, and open the Spring Boot, Maven project in 
your IDE.

7. Add exclusions to the {{org.springframework.geode:spring-geode-starter}} 
dependency declared in the project Maven POM file, as follows:

{code:xml}
                <dependency>
                        <groupId>org.springframework.geode</groupId>
                        <artifactId>spring-geode-starter</artifactId>
                        <version>1.2.0.BUILD-SNAPSHOT</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>org.eclipse.jetty</groupId>
                                        <artifactId>jetty-server</artifactId>
                                </exclusion>
                                <exclusion>
                                        <groupId>org.springframework</groupId>
                                        <artifactId>spring-web</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
{code}

8. Run the {{SpringGeodeAppApplication}} class.

Witness the following Exception:

{code:java}
java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such method: 
org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
        at 
org.apache.geode.internal.cache.GemFireCacheImpl.close(GemFireCacheImpl.java:2183)
 ~[geode-core-1.9.0.jar:na]
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.disconnect(InternalDistributedSystem.java:1627)
 [geode-core-1.9.0.jar:na]
        at 
org.apache.geode.distributed.internal.InternalDistributedSystem.lambda$static$4(InternalDistributedSystem.java:2278)
 [geode-core-1.9.0.jar:na]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_192]
Caused by: java.lang.IllegalAccessError: no such method: 
org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
        at 
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:483)
 ~[na:1.8.0_192]
        ... 4 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
        at java.lang.invoke.MethodHandleNatives.resolve(Native Method) 
~[na:1.8.0_192]
        at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394) 
~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
 ~[na:1.8.0_192]
        at 
java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
 ~[na:1.8.0_192]
        ... 4 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) 
~[na:1.8.0_192]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_192]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) 
~[na:1.8.0_192]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_192]
        ... 10 common frames omitted
{code}

I expect that Apache Geode, in no way, tries to manipulate the embedded HTTP 
service (implemented with Jetty), especially for a Spring Boot, Apache Geode 
{{ClientCache}} application, which is what this is!

> Jetty should be an optional dependency
> --------------------------------------
>
>                 Key: GEODE-7107
>                 URL: https://issues.apache.org/jira/browse/GEODE-7107
>             Project: Geode
>          Issue Type: Improvement
>          Components: management
>            Reporter: John Blum
>            Priority: Major
>
> Currently, *Eclipse Jetty* is a "_compile-time_" dependency of {{geode-core}}:
> {code}
> [INFO] |  |  |  +- org.apache.geode:geode-core:jar:1.9.0:compile
> [INFO] |  |  |  |  +- 
> com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
> [INFO] |  |  |  |  +- org.jgroups:jgroups:jar:3.6.14.Final:compile
> [INFO] |  |  |  |  +- commons-validator:commons-validator:jar:1.6:compile
> [INFO] |  |  |  |  |  +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
> [INFO] |  |  |  |  |  +- commons-logging:commons-logging:jar:1.2:compile
> [INFO] |  |  |  |  |  \- 
> commons-collections:commons-collections:jar:3.2.2:compile
> [INFO] |  |  |  |  +- commons-digester:commons-digester:jar:2.1:compile
> [INFO] |  |  |  |  +- com.sun.activation:javax.activation:jar:1.2.0:compile
> [INFO] |  |  |  |  +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
> [INFO] |  |  |  |  |  \- 
> javax.activation:javax.activation-api:jar:1.2.0:compile
> [INFO] |  |  |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.3.1:compile
> [INFO] |  |  |  |  +- com.sun.istack:istack-commons-runtime:jar:2.2:compile
> [INFO] |  |  |  |  +- org.apache.commons:commons-lang3:jar:3.9:compile
> [INFO] |  |  |  |  +- io.micrometer:micrometer-core:jar:1.2.0:compile
> [INFO] |  |  |  |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.11:compile
> [INFO] |  |  |  |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
> [INFO] |  |  |  |  +- it.unimi.dsi:fastutil:jar:8.2.2:compile
> [INFO] |  |  |  |  +- javax.resource:javax.resource-api:jar:1.7.1:compile
> [INFO] |  |  |  |  |  \- 
> javax.transaction:javax.transaction-api:jar:1.3:compile
> [INFO] |  |  |  |  +- net.java.dev.jna:jna:jar:4.5.2:compile
> [INFO] |  |  |  |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:compile
> [INFO] |  |  |  |  +- 
> org.eclipse.jetty:jetty-server:jar:9.4.19.v20190610:compile
> [INFO] |  |  |  |  |  +- javax.servlet:javax.servlet-api:jar:4.0.1:compile
> [INFO] |  |  |  |  |  +- 
> org.eclipse.jetty:jetty-http:jar:9.4.19.v20190610:compile
> [INFO] |  |  |  |  |  |  \- 
> org.eclipse.jetty:jetty-util:jar:9.4.19.v20190610:compile
> [INFO] |  |  |  |  |  \- 
> org.eclipse.jetty:jetty-io:jar:9.4.19.v20190610:compile
> [INFO] |  |  |  |  +- org.apache.shiro:shiro-core:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- org.apache.shiro:shiro-lang:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- org.apache.shiro:shiro-cache:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- org.apache.shiro:shiro-crypto-hash:jar:1.4.0:compile
> [INFO] |  |  |  |  |  |  \- 
> org.apache.shiro:shiro-crypto-core:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- 
> org.apache.shiro:shiro-crypto-cipher:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- org.apache.shiro:shiro-config-core:jar:1.4.0:compile
> [INFO] |  |  |  |  |  +- org.apache.shiro:shiro-config-ogdl:jar:1.4.0:compile
> [INFO] |  |  |  |  |  \- org.apache.shiro:shiro-event:jar:1.4.0:compile
> [INFO] |  |  |  |  +- io.github.classgraph:classgraph:jar:4.0.6:compile
> [INFO] |  |  |  |  +- com.healthmarketscience.rmiio:rmiio:jar:2.1.2:compile
> [INFO] |  |  |  |  +- org.apache.geode:geode-common:jar:1.9.0:compile
> {code}
> If _Jetty_ is not on the classpath of an Apache Geode (client or peer) cache 
> application, then Geode will throw an Exception on shutdown:
> {code:java}
> 2019-08-21 00:44:32.819  WARN 63204 --- [m shutdown hook] 
> o.a.g.d.i.InternalDistributedSystem      : Exception trying to close cache
> java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such method: 
> org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
>     at 
> org.apache.geode.internal.cache.GemFireCacheImpl.close(GemFireCacheImpl.java:2183)
>  ~[geode-core-1.9.0.jar:na]
>     at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.disconnect(InternalDistributedSystem.java:1627)
>  [geode-core-1.9.0.jar:na]
>     at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.lambda$static$4(InternalDistributedSystem.java:2278)
>  [geode-core-1.9.0.jar:na]
>     at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_192]
> Caused by: java.lang.IllegalAccessError: no such method: 
> org.apache.geode.internal.cache.HttpService.stop()void/invokeVirtual
>     at 
> java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:483)
>  ~[na:1.8.0_192]
>     ... 4 common frames omitted
> Caused by: java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Handler
>     at java.lang.invoke.MethodHandleNatives.resolve(Native Method) 
> ~[na:1.8.0_192]
>     at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) 
> ~[na:1.8.0_192]
>     at 
> java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000) 
> ~[na:1.8.0_192]
>     at 
> java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394) 
> ~[na:1.8.0_192]
>     at 
> java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
>  ~[na:1.8.0_192]
>     at 
> java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
>  ~[na:1.8.0_192]
>     ... 4 common frames omitted
> Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:382) 
> ~[na:1.8.0_192]
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_192]
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) 
> ~[na:1.8.0_192]
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_192]
>     ... 10 common frames omitted
> {code}
> Ironically, _Jetty_ has NO significance on the client, in a {{ClientCache}} 
> application.
> Even when the application embeds a peer {{Cache}}, the server still might not 
> require _Jetty_.
> Jetty is only used to enable the embedded HTTP service in a GemFire 
> server-side node (e.g. Locator/Manager or Server).
> In the Manager, the embedded HTTP service implemented with _Jetty_ is used to 
> host the Management (Admin) REST API and Pulse.
> In a Server, the embedded HTTP service implemented with _Jetty_ is used to 
> host the Developer REST API.
> _Jetty_ should only be required when a server-side node (i.e. Locator/Manager 
> or Server) is hosting the Developer/Management REST API or Pulse.
> Please consider this change!



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to