Resolved Error Connect ROP.

Add <http-method>GET</http-method> and <realm-name>file</realm-name>

Thank You, Andrus and Nikita
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

web.xml:

<security-constraint>
<web-resource-collection>
<web-resource-name>cayenne-saudeplusserver</web-resource-name>
<url-pattern>/saudeplusserver</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>saudeplus</role-name>
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>file</realm-name>
</login-config>

<security-role>
<role-name>saudeplus</role-name>
</security-role>

Em sex., 10 de jul. de 2020 às 10:40, Nikita Timofeev <
ntimof...@objectstyle.com> escreveu:

> I don't really know Jetty and web stuff well, but generally, you could
> configure any webserver to use Cayenne ROP.
> To setup ROP on the server-side, all you need is to enable
> org.apache.cayenne.rop.ROPServlet
> Everything else depends on your use case and preferences.
>
> For instance, here [1] embedded jetty is fully configured in the java code.
>
> [1]
> https://github.com/apache/cayenne/blob/master/tutorials/tutorial-rop-server-http2/src/main/java/org/apache/cayenne/tutorial/Http2Server.java#L58
>
> On Mon, Jul 6, 2020 at 10:17 PM Dayvyd . <dayvydplussys...@gmail.com>
> wrote:
> >
> > Hi, Nikita.
> >
> > Exist a standard server configuration using WebAppContext?
> >
> >
> >
> > On Mon, Jul 6, 2020 at 1:22 PM Dayvyd . <dayvydplussys...@gmail.com>
> wrote:
> >
> > > Hi, Nikita.
> > >
> > > Does not authorization, error:
> > >
> > > 2020-07-06 13:14:42.153:WARN::Request /saudeplusserver failed - no
> realm
> > >
> > > On Mon, Jul 6, 2020 at 8:18 AM Nikita Timofeev <
> ntimof...@objectstyle.com>
> > > wrote:
> > >
> > >> Hi Dayvyd,
> > >>
> > >> If I get it right, your code is a Cayenne tutorial with some
> > >> customization for your own model. So your settings look good to me.
> > >> And I just checked this tutorial in Cayenne 4.2 and it works fine with
> > >> authorization.
> > >>
> > >> The exception itself tells only that the answer from the server
> > >> couldn't be parsed (that could be an HTTP error for example).
> > >> Are there any errors reported by the Jetty on the server-side? Maybe
> > >> you could add (or enable) request logging?
> > >>
> > >> Additionally, you could fast check that the server is ok by opening
> > >> Cayenne servlet directly in the browser.
> > >> It should pass authorization and return something like a 405 HTTP
> error.
> > >>
> > >> On Sun, Jul 5, 2020 at 5:30 PM Dayvyd . <dayvydplussys...@gmail.com>
> > >> wrote:
> > >> >
> > >> > Server:
> > >> >
> > >> > Jetty 6.1.26
> > >> > Project: saudeplusserver
> > >> > WebApp dir: src/main/webapp
> > >> >
> > >> > Em sáb, 4 de jul de 2020 05:21, Andrus Adamchik <
> and...@objectstyle.org
> > >> >
> > >> > escreveu:
> > >> >
> > >> > > Hi Dayvyd,
> > >> > >
> > >> > > Which version of Cayenne is this and how is the server setup?
> > >> > >
> > >> > > Andrus
> > >> > >
> > >> > > > On Jul 2, 2020, at 12:20 AM, Dayvyd . <
> dayvydplussys...@gmail.com>
> > >> > > wrote:
> > >> > > >
> > >> > > > Hi,
> > >> > > >
> > >> > > > Has anyone encountered this error when running Main.java using
> BASIC
> > >> > > > authentication? Without authentication it works normally!
> > >> > > >
> > >> > > > Error: org.apache.cayenne.rop.HttpClientConnection - unknown
> code
> > >> for
> > >> > > > readObject at 0x3c (<); nested exception is:
> > >> > > >
> > >> > > >
> > >> > >
> > >>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >> > > > public class Main {
> > >> > > >
> > >> > > > public static void main(String[] args) {
> > >> > > >
> > >> > > > Map<String, String> properties = new HashMap<>();
> > >> > > > properties.put(ClientConstants.ROP_SERVICE_URL_PROPERTY, "
> > >> > > > http://localhost:8080/saudeplusserver";);
> > >> > > > properties.put(ClientConstants.ROP_SERVICE_USERNAME_PROPERTY,
> > >> > > "saudeplus");
> > >> > > > properties.put(ClientConstants.ROP_SERVICE_PASSWORD_PROPERTY,
> > >> "dna1614");
> > >> > > > properties.put(ClientConstants.ROP_SERVICE_REALM_PROPERTY,
> "Cayenne
> > >> > > Realm");
> > >> > > >
> > >> > > > ClientRuntime runtime = ClientRuntime.builder()
> > >> > > >                .properties(properties)
> > >> > > >                .build();
> > >> > > > ObjectContext context = runtime.newContext();
> > >> > > >
> > >> > > > inserirCardapio(context);
> > >> > > > runtime.shutdown();
> > >> > > > }
> > >> > > >
> > >> > >
> > >>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > >> > > > [main] INFO org.eclipse.jetty.util.log - Logging initialized
> > >> @1527ms to
> > >> > > > org.eclipse.jetty.util.log.Slf4jLog
> > >> > > > [main] INFO org.apache.cayenne.rop.http.JettyHttpROPConnector -
> > >> Adding
> > >> > > > authentication
> > >> > > > User: saudeplus
> > >> > > > Realm: Cayenne Realm
> > >> > > > [main] INFO org.apache.cayenne.rop.http.JettyHttpROPConnector -
> > >> > > Connecting
> > >> > > > to [saudeplus:*******@http://localhost:8080/saudeplusserver] -
> > >> dedicated
> > >> > > > session.
> > >> > > > [main] INFO org.apache.cayenne.rop.HttpClientConnection -
> unknown
> > >> code
> > >> > > for
> > >> > > > readObject at 0x3c (<); nested exception is:
> > >> > > > com.caucho.hessian.io.HessianProtocolException: unknown code
> for
> > >> > > readObject
> > >> > > > at 0x3c (<)
> > >> > > > java.rmi.RemoteException: unknown code for readObject at 0x3c
> (<);
> > >> nested
> > >> > > > exception is:
> > >> > > > com.caucho.hessian.io.HessianProtocolException: unknown code
> for
> > >> > > readObject
> > >> > > > at 0x3c (<)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.ProxyRemoteService.establishSession(ProxyRemoteService.java:46)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HttpClientConnection.connect(HttpClientConnection.java:93)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HttpClientConnection.getServerEventBridge(HttpClientConnection.java:71)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:279)
> > >> > > > at
> > >> org.apache.cayenne.remote.ClientChannel.<init>(ClientChannel.java:77)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.rop.client.ClientChannelProvider.get(ClientChannelProvider.java:45)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.rop.client.ClientChannelProvider.get(ClientChannelProvider.java:30)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.CustomProvidersProvider.get(CustomProvidersProvider.java:39)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.get(FieldInjectingProvider.java:43)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultScopeProvider.get(DefaultScopeProvider.java:50)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:139)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.value(FieldInjectingProvider.java:103)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.injectMember(FieldInjectingProvider.java:68)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.injectMembers(FieldInjectingProvider.java:59)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.get(FieldInjectingProvider.java:44)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultScopeProvider.get(DefaultScopeProvider.java:50)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:134)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.CayenneRuntime.newContext(CayenneRuntime.java:124)
> > >> > > > at br.com.saudeplus.model.client.Main.main(Main.java:25)
> > >> > > > Caused by: com.caucho.hessian.io.HessianProtocolException:
> unknown
> > >> code
> > >> > > for
> > >> > > > readObject at 0x3c (<)
> > >> > > > at com.caucho.hessian.io
> .HessianInput.error(HessianInput.java:1697)
> > >> > > > at com.caucho.hessian.io
> > >> .HessianInput.readObject(HessianInput.java:1177)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HessianROPSerializationService.deserialize(HessianROPSerializationService.java:67)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.ProxyRemoteService.establishSession(ProxyRemoteService.java:44)
> > >> > > > ... 18 more
> > >> > > > Exception in thread "main"
> > >> org.apache.cayenne.CayenneRuntimeException:
> > >> > > > [v.4.2.M1 Apr 15 2020 09:23:45] unknown code for readObject at
> 0x3c
> > >> (<);
> > >> > > > nested exception is:
> > >> > > > com.caucho.hessian.io.HessianProtocolException: unknown code
> for
> > >> > > readObject
> > >> > > > at 0x3c (<)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HttpClientConnection.connect(HttpClientConnection.java:97)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HttpClientConnection.getServerEventBridge(HttpClientConnection.java:71)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.remote.ClientChannel.setupRemoteChannelListener(ClientChannel.java:279)
> > >> > > > at
> > >> org.apache.cayenne.remote.ClientChannel.<init>(ClientChannel.java:77)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.rop.client.ClientChannelProvider.get(ClientChannelProvider.java:45)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.rop.client.ClientChannelProvider.get(ClientChannelProvider.java:30)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.CustomProvidersProvider.get(CustomProvidersProvider.java:39)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.get(FieldInjectingProvider.java:43)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultScopeProvider.get(DefaultScopeProvider.java:50)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:139)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.value(FieldInjectingProvider.java:103)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.injectMember(FieldInjectingProvider.java:68)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.injectMembers(FieldInjectingProvider.java:59)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.FieldInjectingProvider.get(FieldInjectingProvider.java:44)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultScopeProvider.get(DefaultScopeProvider.java:50)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:134)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.configuration.CayenneRuntime.newContext(CayenneRuntime.java:124)
> > >> > > > at br.com.saudeplus.model.client.Main.main(Main.java:25)
> > >> > > > Caused by: java.rmi.RemoteException: unknown code for
> readObject at
> > >> 0x3c
> > >> > > > (<); nested exception is:
> > >> > > > com.caucho.hessian.io.HessianProtocolException: unknown code
> for
> > >> > > readObject
> > >> > > > at 0x3c (<)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.ProxyRemoteService.establishSession(ProxyRemoteService.java:46)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HttpClientConnection.connect(HttpClientConnection.java:93)
> > >> > > > ... 17 more
> > >> > > > Caused by: com.caucho.hessian.io.HessianProtocolException:
> unknown
> > >> code
> > >> > > for
> > >> > > > readObject at 0x3c (<)
> > >> > > > at com.caucho.hessian.io
> .HessianInput.error(HessianInput.java:1697)
> > >> > > > at com.caucho.hessian.io
> > >> .HessianInput.readObject(HessianInput.java:1177)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.HessianROPSerializationService.deserialize(HessianROPSerializationService.java:67)
> > >> > > > at
> > >> > > >
> > >> > >
> > >>
> org.apache.cayenne.rop.ProxyRemoteService.establishSession(ProxyRemoteService.java:44)
> > >> > > > ... 18 more
> > >> > > >
> > >> > > >
> > >> > > > --
> > >> > > > Att, Dayvyd
> > >> > > >
> > >> > > >
> > >> > > > <
> > >> > >
> > >>
> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> > >> > > >
> > >> > > > Livre
> > >> > > > de vírus. www.avg.com
> > >> > > > <
> > >> > >
> > >>
> http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
> > >> > > >.
> > >> > > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> > >> > >
> > >> > >
> > >>
> > >>
> > >>
> > >> --
> > >> Best regards,
> > >> Nikita Timofeev
> > >>
> > >
> > >
> > > --
> > > Att, Dayvyd
> > >
> > >
> >
> > --
> > Att, Dayvyd
>
>
>
> --
> Best regards,
> Nikita Timofeev
>


-- 
Att, Dayvyd

Reply via email to