Re: Tapestry cometd with HTTPS

Lance Java <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAN7Z0vS6XqE2=d5X8TaKy2BHDX1TWNpad1mgs70-wBB0W8XEug@mail.gmail.com>
tapestry-cometd uses tapestry-offline under the hood to fool tapestry into
believing it was invoked via a request / response when it was actually
invoked via websockets.

I'm guessing you are rendering a link in your websocket flow. You'll need
to provide a few extra symbols to render links including the server name &
port. See the tapestry-offline readme for more information

https://github.com/uklance/tapestry-offline

On 30 Apr 2017 19:53, "Miguel Figueiredo" <[email protected]> wrote:

> Hi,
>
> I am testing a Tapestry application with HTTPS configuration.
> I did the dev configuration according to the documentation (
> https://tapestry.apache.org/https.html)
>
>     public void contributeMetaDataLocator(MappedConfiguration<String,
> String> configuration) {
>         configuration.add(MetaDataConstants.SECURE_PAGE, "true");
>     }
>
>     public static void contributeServiceOverride(
> MappedConfiguration<Class,
> Object> configuration) {
>         BaseURLSource source = new BaseURLSource() {
>             public String getBaseURL(boolean secure) {
>                 String protocol = secure ? "https" : "http";
>
>                 int port = secure ? 8443 : 8080;
>
>                 return String.format("%s://localhost:%d", protocol, port);
>             }
>         };
>
>         configuration.add(BaseURLSource.class, source);
>     }
>
> Additionaly I have added the jetty configuration for SSL.
>
> All the normal requests work fine, but when I do a broadcast with a push
> manager, I get the following error:
>
> Caused by: java.lang.RuntimeException: Symbol 'tapestry-offline.serverName'
> is not defined.
>     at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$
> SymbolExpansion.expandSymbol(SymbolSourceImpl.java:136)
>     at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$
> SymbolExpansion.valueForSymbol(SymbolSourceImpl.java:99)
>     at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl.
> valueForSymbol(SymbolSourceImpl.java:214)
>     at $SymbolSource_2086fa2c220a.valueForSymbol(Unknown Source)
>     at
> org.apache.tapestry5.ioc.internal.services.SymbolObjectProvider.provide(
> SymbolObjectProvider.java:49)
>     at
> org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.
> invoke(MasterObjectProviderImpl.java:52)
>     at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> invoke(OperationTrackerImpl.java:74)
>     ... 67 more
>
> Note that this works file with HTTP.
>
> Can someone give me some help?
>
> Best regards,
> Miguel
>
>
> --
> Miguel Figueiredo
> Software Developer
>
> "I'm a pretty lazy person and am prepared to work quite hard in order to
> avoid work."
> -- Martin Fowler
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.