Does REST work?

G’day:
I’m troubleshooting some code for someone on Twitter
(https://twitter.com/cyndi104/status/600783012775747584).

Running the code on ColdFusion, I get the issue as per what Cyndi was
seeing.

I wanted to see how Lucee handled the same (in an attempt to plug Lucee to
her), but I can’t seem to get REST to work on Lucee (4.5 or 5).

Here’s what I did:

  • The three files in her gist are in this dir:
    D:\Websites\www.scribble.local\shared\junk\cyndi
  • In Lucee server admin, I set up a REST mapping - /cyndi - pointing to
    that dir. I opt for it to NOT be the default app
  • I also check the option to list REST services if I browse to /rest
  • I have modified her code so that the URLs
    are http://#CGI.http_host#/rest/cyndi/, not http://www.yoursite.com/

These are the steps I took on CF, and they work.

On Lucee, when I browse to /rest, I get this:

Available sevice mappings are:

  • /rest/cyndi

So far, so good. If I browse to /rest/cyndi, I get:

no rest service for [/cyndi] found

Perhaps fair enough, as the end points have specific names in that code,
and I’m not actually browsing to them

However if I browse to one of the defined endpoints,
eg: /rest/cyndi/MyHandler1/MyTest/true, then I get this:

Lucee 4.5.0.042 Error (missinginclude)MessagePage …/…/…/…/…/…/null
[C:\null] not foundJava StacktracePage …/…/…/…/…/…/null [C:\null] not
found
at lucee.runtime.PageSourceImpl.loadPage(Unknown Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.rest.Mapping._init(Unknown Source):-1

etc.

Same on Lucee 5.

It looks very much to me like a bug in Lucee, but given what a drama
ColdFusion has managed to maker out of /rest services, it would not
surprise me if Lucee had non-obvious “idiosyncrasies” too.

Is there something else I need to do?

Cheers.–
Adam

does this one work?
/rest/cyndi/MyHandler1/MyTest/true

try putting / before restpathOn 22 May 2015 at 15:47, Adam Cameron <@Adam_Cameron> wrote:

G’day:
I’m troubleshooting some code for someone on Twitter (
https://twitter.com/cyndi104/status/600783012775747584).

Running the code on ColdFusion, I get the issue as per what Cyndi was
seeing.

I wanted to see how Lucee handled the same (in an attempt to plug Lucee to
her), but I can’t seem to get REST to work on Lucee (4.5 or 5).

Here’s what I did:

  • The three files in her gist are in this dir:
    D:\Websites\www.scribble.local\shared\junk\cyndi
  • In Lucee server admin, I set up a REST mapping - /cyndi - pointing to
    that dir. I opt for it to NOT be the default app
  • I also check the option to list REST services if I browse to /rest
  • I have modified her code so that the URLs are http://#CGI.http_host#/rest/cyndi/,
    not http://www.yoursite.com/

These are the steps I took on CF, and they work.

On Lucee, when I browse to /rest, I get this:

Available sevice mappings are:

  • /rest/cyndi

So far, so good. If I browse to /rest/cyndi, I get:

no rest service for [/cyndi] found

Perhaps fair enough, as the end points have specific names in that code,
and I’m not actually browsing to them

However if I browse to one of the defined endpoints,
eg: /rest/cyndi/MyHandler1/MyTest/true, then I get this:

Lucee 4.5.0.042 Error (missinginclude)MessagePage …/…/…/…/…/…/null
[C:\null] not foundJava StacktracePage …/…/…/…/…/…/null [C:\null]
not found
at lucee.runtime.PageSourceImpl.loadPage(Unknown Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.rest.Mapping._init(Unknown Source):-1

etc.

Same on Lucee 5.

It looks very much to me like a bug in Lucee, but given what a drama
ColdFusion has managed to maker out of /rest services, it would not
surprise me if Lucee had non-obvious “idiosyncrasies” too.

Is there something else I need to do?

Cheers.


Adam


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

AJ Mercer
<webonix:net strength=“Industrial” /> http://webonix.net | <webonix:org
community=“Open” /> http://webonix.org
http://twitter.com/webonix

ops
/rest/cyndi/MyHandler2/MyTest/trueOn 22 May 2015 at 15:58, AJ Mercer <@AJ_Mercer> wrote:

does this one work?
/rest/cyndi/MyHandler1/MyTest/true

try putting / before restpath

On 22 May 2015 at 15:47, Adam Cameron <@Adam_Cameron> wrote:

G’day:
I’m troubleshooting some code for someone on Twitter (
https://twitter.com/cyndi104/status/600783012775747584).

Running the code on ColdFusion, I get the issue as per what Cyndi was
seeing.

I wanted to see how Lucee handled the same (in an attempt to plug Lucee
to her), but I can’t seem to get REST to work on Lucee (4.5 or 5).

Here’s what I did:

  • The three files in her gist are in this dir:
    D:\Websites\www.scribble.local\shared\junk\cyndi
  • In Lucee server admin, I set up a REST mapping - /cyndi - pointing to
    that dir. I opt for it to NOT be the default app
  • I also check the option to list REST services if I browse to /rest
  • I have modified her code so that the URLs are http://#CGI.http_host#/rest/cyndi/,
    not http://www.yoursite.com/

These are the steps I took on CF, and they work.

On Lucee, when I browse to /rest, I get this:

Available sevice mappings are:

  • /rest/cyndi

So far, so good. If I browse to /rest/cyndi, I get:

no rest service for [/cyndi] found

Perhaps fair enough, as the end points have specific names in that code,
and I’m not actually browsing to them

However if I browse to one of the defined endpoints,
eg: /rest/cyndi/MyHandler1/MyTest/true, then I get this:

Lucee 4.5.0.042 Error (missinginclude)MessagePage …/…/…/…/…/…/null
[C:\null] not foundJava StacktracePage …/…/…/…/…/…/null [C:\null]
not found
at lucee.runtime.PageSourceImpl.loadPage(Unknown Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.rest.Mapping._init(Unknown Source):-1

etc.

Same on Lucee 5.

It looks very much to me like a bug in Lucee, but given what a drama
ColdFusion has managed to maker out of /rest services, it would not
surprise me if Lucee had non-obvious “idiosyncrasies” too.

Is there something else I need to do?

Cheers.


Adam


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

AJ Mercer
<webonix:net strength=“Industrial” /> http://webonix.net | <webonix:org
community=“Open” /> http://webonix.org
http://twitter.com/webonix

AJ Mercer
<webonix:net strength=“Industrial” /> http://webonix.net | <webonix:org
community=“Open” /> http://webonix.org
http://twitter.com/webonix

looks like it is the data type on the arguments
data on the URL (and POST) scope are stings
http://twitter.com/webonix

It’s not even finding the file mate; it doesn’t matter what’s in it!On Saturday, 23 May 2015 03:32:47 UTC+1, AJ Mercer wrote:


Adam

looks like it is the data type on the arguments
data on the URL (and POST) scope are stings

try this

component rest=“true” name=“myHandler2” restPath=“MyHandler2”
output=“false” {
remote any function GetHandler(required string booleanVal
restargsource=“path”)
restpath=“MyTest/{booleanVal}”
httpmethod=“GET” produces=“application/json” {

return arguments.booleanVal; //booleanVal will be no because yes was
passed in not true
}
}On 22 May 2015 at 15:47, Adam Cameron <@Adam_Cameron> wrote:

G’day:
I’m troubleshooting some code for someone on Twitter (
https://twitter.com/cyndi104/status/600783012775747584).

Running the code on ColdFusion, I get the issue as per what Cyndi was
seeing.

I wanted to see how Lucee handled the same (in an attempt to plug Lucee to
her), but I can’t seem to get REST to work on Lucee (4.5 or 5).

Here’s what I did:

  • The three files in her gist are in this dir:
    D:\Websites\www.scribble.local\shared\junk\cyndi
  • In Lucee server admin, I set up a REST mapping - /cyndi - pointing to
    that dir. I opt for it to NOT be the default app
  • I also check the option to list REST services if I browse to /rest
  • I have modified her code so that the URLs are http://#CGI.http_host#/rest/cyndi/,
    not http://www.yoursite.com/

These are the steps I took on CF, and they work.

On Lucee, when I browse to /rest, I get this:

Available sevice mappings are:

  • /rest/cyndi

So far, so good. If I browse to /rest/cyndi, I get:

no rest service for [/cyndi] found

Perhaps fair enough, as the end points have specific names in that code,
and I’m not actually browsing to them

However if I browse to one of the defined endpoints,
eg: /rest/cyndi/MyHandler1/MyTest/true, then I get this:

Lucee 4.5.0.042 Error (missinginclude)MessagePage …/…/…/…/…/…/null
[C:\null] not foundJava StacktracePage …/…/…/…/…/…/null [C:\null]
not found
at lucee.runtime.PageSourceImpl.loadPage(Unknown Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.rest.Mapping._init(Unknown Source):-1

etc.

Same on Lucee 5.

It looks very much to me like a bug in Lucee, but given what a drama
ColdFusion has managed to maker out of /rest services, it would not
surprise me if Lucee had non-obvious “idiosyncrasies” too.

Is there something else I need to do?

Cheers.


Adam


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7063023d-01f1-41a2-a7f5-195d699ad569%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

AJ Mercer
<webonix:net strength=“Industrial” /> http://webonix.net | <webonix:org
community=“Open” /> http://webonix.org
http://twitter.com/webonix

Lucee 4.5.0.042 Error (missinginclude)MessagePage …/…/…/…/…/…/null
[C:\null] not foundJava StacktracePage …/…/…/…/…/…/null [C:\null]
not found
at lucee.runtime.PageSourceImpl.loadPage(Unknown Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.component.ComponentLoader.loadComponent(Unknown
Source):-1
at lucee.runtime.rest.Mapping._init(Unknown Source):-1

Hmmm… some more information here. For the sake of completeness I decided
to demonstrate AJ’s suggestion isn’t relevant, but am at home now so needed
to set the code / mapping up again on my home machine (I was @ work y/day).
And on this machine it works fine on Lucee 5.

On Lucee 4.5 I get this:

Lucee 4.5.1.015 Error (java.lang.StringIndexOutOfBoundsException)MessageString
index out of range: -15Causejava.lang.StringIndexOutOfBoundsExceptionJava
StacktraceString index out of range: -15
at java.lang.String.substring(String.java:1914):1914
at
lucee.runtime.PageSourceImpl.createComponentName(PageSourceImpl.java:642):642
at
lucee.runtime.PageSourceImpl.getComponentName(PageSourceImpl.java:591):591
at
lucee.runtime.type.util.ComponentUtil.getClassname(ComponentUtil.java:324):324
at
lucee.runtime.type.util.ComponentUtil.getComponentJavaAccess(ComponentUtil.java:104):104
at
lucee.runtime.ComponentImpl.getJavaAccessClass(ComponentImpl.java:1852):1852
at lucee.runtime.ComponentImpl.getMetaData(ComponentImpl.java:1432):1432
at lucee.runtime.ComponentImpl.getMetaData(ComponentImpl.java:1406):1406
at lucee.runtime.ComponentImpl.getMetaData(ComponentImpl.java:1365):1365
at lucee.runtime.rest.Mapping._init(Mapping.java:142):142
at lucee.runtime.rest.Mapping.init(Mapping.java:100):100
at lucee.runtime.rest.Mapping.getResult(Mapping.java:208):208
at
lucee.runtime.rest.RestRequestListener.execute(RestRequestListener.java:57):57
at
lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:121):121
at
lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:35):35
at
lucee.runtime.PageContextImpl.executeRest(PageContextImpl.java:2188):2188
at
lucee.runtime.engine.CFMLEngineImpl.serviceRest(CFMLEngineImpl.java:501):501
at lucee.loader.servlet.RestServlet.service(Unknown Source):-1
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725):725
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219):219
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501):501
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610):610
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537):537
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085):1085
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658):658
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222):222
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556):1556
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513):1513
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
at java.lang.Thread.run(Thread.java:745):745
Timestamp23/05/15 08:54:09 BST

So that’s interesting.

On Railo 4.2.2.004 final it works fine too.

I have another machine here… I’ll try on that too and report back.

Is there any sensible troubleshooting steps I can take with this on the
machine that’s erroring, or more info that’s worth providing?

Can someone else try running that code on their rig and see what they get?

Cheers.On Friday, 22 May 2015 08:47:12 UTC+1, Adam Cameron wrote:


Adam

I have another machine here… I’ll try on that too and report back.

Same result on the other machine: Lucee 5 A-OK; Lucee 4.5:
StringIndexoutOfBoundsException

One thing that occurs to me about my work machine… I might have done
the mapping wrong. My Lucee installs are on my C: drive, and the websites
are on the D: drive. I’ve a symlink in my Lucee webroot pointing /shared
to D:\websites\shared (so C:\apps\lucee\5\express\webapps\ROOT\shared is
actually a resource on D: drive). Now I think I perhaps added the REST
mapping via the D: drive directory, not the C: drive one. That might
explain why Lucee is getting confused. Can’t check this now, but will check
on Mon.

AND… whilst my home machines are all C:-based, I still symlink in the
shared dir into the Lucee webroot from another location. And indeed I was
giving it the “wrong” path in the REST mapping: I was using the “real” path
to the directory, not the linked one. Once I used the linked one on Lucee
4.5, it worked fine.

Odd how Railo 4.2 and Lucee 5 still manages to work it all out just fine.
But not an issue, just “interesting”.

So… nothing to see here… move along…On Saturday, 23 May 2015 09:01:11 UTC+1, Adam Cameron wrote:


Adam

The same problem, why did it not resolved so far?
Also frequently down, and less trust in the lucce.

I will came back to railo.

2015년 5월 23일 토요일 오후 3시 30분 28초 UTC+7, Adam Cameron 님의 말:>

On Saturday, 23 May 2015 09:01:11 UTC+1, Adam Cameron wrote:

I have another machine here… I’ll try on that too and report back.

Same result on the other machine: Lucee 5 A-OK; Lucee 4.5:
StringIndexoutOfBoundsException

One thing that occurs to me about my work machine… I might have done
the mapping wrong. My Lucee installs are on my C: drive, and the websites
are on the D: drive. I’ve a symlink in my Lucee webroot pointing /shared
to D:\websites\shared (so C:\apps\lucee\5\express\webapps\ROOT\shared is
actually a resource on D: drive). Now I think I perhaps added the REST
mapping via the D: drive directory, not the C: drive one. That might
explain why Lucee is getting confused. Can’t check this now, but will check
on Mon.

AND… whilst my home machines are all C:-based, I still symlink in the
shared dir into the Lucee webroot from another location. And indeed I was
giving it the “wrong” path in the REST mapping: I was using the “real” path
to the directory, not the linked one. Once I used the linked one on Lucee
4.5, it worked fine.

Odd how Railo 4.2 and Lucee 5 still manages to work it all out just fine.
But not an issue, just “interesting”.

So… nothing to see here… move along…


Adam

Where your chances of having issues resolved right now are
“…/…/…/…/…/…/null [C:\null] not found”.On Sunday, July 12, 2015 at 11:51:12 PM UTC-4, 김태식 wrote:

The same problem, why did it not resolved so far?
Also frequently down, and less trust in the lucce.

I will came back to railo.

I installed to my windows server. (tomcat 8 and lucee war)
Then I will setup the rest mapping in lucee web admin, And the other is not
a problem.
But rest, nothing happened. Tomcat does not recognize and display the 404
error.

2015년 7월 13일 월요일 오후 8시 39분 33초 UTC+7, Juan Aguilar 님의 말:>

On Sunday, July 12, 2015 at 11:51:12 PM UTC-4, 김태식 wrote:

The same problem, why did it not resolved so far?
Also frequently down, and less trust in the lucce.

I will came back to railo.

Where your chances of having issues resolved right now are
“…/…/…/…/…/…/null [C:\null] not found”.

Check your web.xml in the expanded war. The rest servlet might be
commented out.

김태식 wrote:>

I installed to my windows server. (tomcat 8 and lucee war)
Then I will setup the rest mapping in lucee web admin, And the other
is not a problem.
But rest, nothing happened. Tomcat does not recognize and display the
404 error.

2015년 7월 13일 월요일 오후 8시 39분 33초 UTC+7, Juan Aguilar 님의 말:

On Sunday, July 12, 2015 at 11:51:12 PM UTC-4, 김태식 wrote:

The same problem, why did it not resolved so far?
Also frequently down, and less trust in the lucce.

I will came back to railo.

Where your chances of having issues resolved right now are
“…/…/…/…/…/…/null [C:\null] not found”.


You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/54b1b667-ac5c-49b1-bd68-94eefb9e6925%40googlegroups.com

https://groups.google.com/d/msgid/lucee/54b1b667-ac5c-49b1-bd68-94eefb9e6925%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.