Asciidoctor Servlet demo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Asciidoctor Servlet demo

mojavelinux
Administrator
In preparation for my JUG talks this week on AsciiDoc/Asciidoctor and Arquillian, I created a simple demo webapp that accepts AsciiDoc source and renders it using the Asciidoctor Java integration library.

I included Arquillian tests in the project that test the CDI bean, the web UI (using Drone) and the Servlet lifecycle (using Warp). The project is also configured to use the Asciidoctor Maven plugin.

The application only works on GlassFish atm. For some reason, the Asciidoctor Java integration can't resolve RubyGems when deployed to Wildfly (JBoss AS). But, hey! There are Arquillian tests ready to go to explore the problem :)


Happy hacking!

-Dan

--
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

fiorenzo.pizza
Some news about deploy in jboss7?

I tried with latest asciidoctor-java-integration, but the error is always the same:

Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1054) [jruby-complete-1.7.4.jar:]
        at RUBY.require(classpath:/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36) at RUBY.(root)(<script>:2)


bye

Fiorenzo

Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

asotobu
I have not tried yet but you could try what have been explained here https://github.com/asciidoctor/asciidoctor-java-integration/issues/22 with OSGi, but it can also works in JBoss
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

smigielski
I plan to deploy my asciidoc application to openshift so I've also hit the problem with jboss classloading and jruby. I've read the discussion and play with gem_path a bit but I don't yet know what to do. What I understand is that it is the problem with how jruby loads gem libraries putted inside jar files and without changes from their side there won't be any final solution. What we can have now is some workaround with unpacking content of asciidocotor-java-integratation jar and setting gem_path correctly.

Any recommendation how can I tackle that problem?

Btw maybe it will be good to have this information in asciidoctor-java-integration readme file so people planning to use it with jboss server won't be surprised at the moment of deploying it?
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

mojavelinux
Administrator
I'd have to experiment with it myself before I could give advice for how to make it work with JBoss AS. You might want to reach out to the Wildfly or Torquebox list to get advice since both groups should have the necessary expertise.

I can offer another approach. I know that this runs on GlassFish. You could start with the GlassFish OpenShift quickstart and then add the servlet demo to it.

https://github.com/openshift-quickstart/openshift-glassfish3-sample


On Wed, Oct 16, 2013 at 12:48 AM, smigielski [via Asciidoctor :: Discussion] <[hidden email]> wrote:

Btw maybe it will be good to have this information in asciidoctor-java-integration readme file so people planning to use it with jboss server won't be surprised at the moment of deploying it?

I think that's a great suggestion. Let's capture that knowledge. Anything you learn, please post it here or submit a pull request to the asciidoctor-java-integration README.md.

Good luck!

-Dan
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

smigielski
Your application after small modification also works on tomcat so I will go for it.  I wish I can say the same about my app, but at least I know that it can be done somehow.

As of Jboss I have to postpone my investigation as I have really few spare time now.
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

mojavelinux
Administrator
On Wed, Oct 16, 2013 at 3:04 PM, smigielski [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Your application after small modification also works on tomcat so I will go for it.

Excellent!
 
Good luck!

-Dan

--
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

smigielski
I've already solved my problems also. Everything is working on standalone Tomcat and Tomcat on Origin so I am quite satisfied. Now is time to complete business logic and polish the code. After that I would love to contribute also to asciidoctor-java-integration module.





On 17 October 2013 21:19, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
On Wed, Oct 16, 2013 at 3:04 PM, smigielski [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Your application after small modification also works on tomcat so I will go for it.

Excellent!
 
Good luck!

-Dan

--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctor-Servlet-demo-tp187p819.html
To unsubscribe from Asciidoctor Servlet demo, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

mojavelinux
Administrator
On Thu, Oct 17, 2013 at 2:13 PM, smigielski [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I've already solved my problems also. Everything is working on standalone Tomcat and Tomcat on Origin so I am quite satisfied. Now is time to complete business logic and polish the code. After that I would love to contribute also to asciidoctor-java-integration module.

Super! I look forward to working with you!

-Dan

--
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

mgreau
In reply to this post by fiorenzo.pizza
Hi,

I have the same problem on OpenShift with WildFly 8.0.0-beta1[2] but it's not a problem about the application server since it works on my laptop.

My project use the WebSocket protocol to render HTML in live mode [1] and I would like to put a demo online.

Any idea ?
It may be a platform security problem ?

[1] https://github.com/mgreau/when-websocket-met-asciidoctor
[2] Stacktrace on OpenShift DIY (WildFly 8.0.0-beta1)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
        at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:89) [weld-core-impl-2.1.0.CR1.jar:2013-09-26 16:53]
        ... 51 more
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1054) [jruby-complete-1.7.4.jar:]
        at RUBY.require(classpath:/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)   at RUBY.(root)(<scri
mgreau.com/posts => HubPress Blog :)
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor Servlet demo

smigielski
I've just checked it locally with WildFly and it doesn't work. The error is the same. 

Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027) [jruby-complete-1.7.3.jar:]
at RUBY.require(classpath:/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36) at RUBY.(root)(<script>:2)

It may so happen that you have GEM_PATH set locally and thats why it is working. As I dig throughout the problem, it is modular classloader that cause JRuby can't find gem files on the classpath. I try to find a bug in JRuby but nothing exactly the same was reported yet. 

I don't know how but TorqueBox seems to overcome that issue somehow. Maybe we can check with them?


On Wed, Nov 13, 2013 at 12:28 AM, mgreau [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I have the same problem on OpenShift with WildFly 8.0.0-beta1[2] but it's not a problem about the application server since it works on my laptop.

My project use the WebSocket protocol to render HTML in live mode [1] and I would like to put a demo online.

Any idea ?
It may be a platform security problem ?

[1] https://github.com/mgreau/when-websocket-met-asciidoctor
[2] Stacktrace on OpenShift DIY (WildFly 8.0.0-beta1)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]
        at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]
        at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:89) [weld-core-impl-2.1.0.CR1.jar:2013-09-26 16:53]
        ... 51 more
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1054) [jruby-complete-1.7.4.jar:]
        at RUBY.require(classpath:/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)   at RUBY.(root)(<scri
mgreau.com => awestruct + asciidoctor website/blog



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctor-Servlet-demo-tp187p975.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor Servlet demo, click here.
NAML