I just downloaded your project from github and tested it and it worked for me. 
Just did 

  git clone g...@github.com:axiopisty/osgi-enroute-maven-tutorial.git
  cd osgi-enroute-maven-tutorial/
  cd osgi.enroute.examples.eval/
  mvn install
  cd osgi.enroute.examples.eval.application/
  more target/classes/static/osgi.enroute.examples.eval/index.html 
  // this showed the preprocessed index.html file, see later
  cd ../osgi.enroute.examples.eval.bndrun
  java -jar osgi.enroute.examples.eval.jar 


The problem you indicate in your last mail is that the index.html file is not 
preprocessed by bnd. The missing URL you show is the raw URL in the index.html 
file. bnd needs to replace the bundle name and bundle version in this url to 
work. (Using this info, the webserver knows what resources to use from what 
bundle.)

I assume you tried to do a clean build? 

The maven setup assumes that bnd runs later than the resource plugin. Maven 
copies the index.html file but bnd is assumed to overwrite it. The 
preprocessing is handled in the -includeresources instruction. You could move 
the index.html in 
./src/main/resources/static/osgi.enroute.examples.eval/index.html to 
./index.html. You then need to change the bnd instruction in the bnd.bnd file 
to:

  -includeresource: \
   {static/osgi.enroute.examples.eval/index.html=index.html}

Several people have tested the setup and as said I was able to build and test 
the project.

Though theoretically it should not make a difference, the project is also 
available on https://github.com/osgi/osgi.enroute.examples.eval, you could try 
that out.

If this all does not work, what OS are you runnning and what is the version of 
your mvn?

Let me know how it goes.

        Peter Kriens


> On 4 nov. 2016, at 08:05, Elliot Huntington <elliot.hunting...@gmail.com> 
> wrote:
> 
> Actually using Tamper Data I was able to see which resources were not found:
> 
> GET 
> http://localhost:8080/osgi.enroute.webresource/$%7Bbsn%7D/$%7BBundle-Version%7D/*.css
>  
> GET 
> http://localhost:8080/osgi.enroute.webresource/$%7Bbsn%7D/$%7BBundle-Version%7D/*.js
> 
> 
> 
> 
> 
> 
> On Thu, Nov 3, 2016 at 11:40 PM, Elliot Huntington 
> <elliot.hunting...@gmail.com> wrote:
> Hi,
> 
> I just wanted to follow up on this to see if anyone else has been able to 
> confirm/reproduce the problem I described in my previous email on this 
> thread. My implementation of the tutorial is published on github at 
> https://github.com/axiopisty/osgi-enroute-maven-tutorial.
> 
> The exception is reproduced by running the bundle produced in the bndrun 
> module and then going to 
> http://localhost:8080/osgi.enroute.examples.eval/index.html in your browser.
> 
> Kind regards,
> Elliot
> 
> 
> On Wed, Nov 2, 2016 at 10:57 AM, Elliot Huntington 
> <elliot.hunting...@gmail.com> wrote:
> Certainly, I thought I did that in the original email. The link is: 
> https://github.com/axiopisty/osgi-enroute-maven-tutorial.
> 
> Is it not accessible?
> 
> On Wed, Nov 2, 2016 at 1:31 AM, Peter Kriens <peter.kri...@aqute.biz> wrote:
> Can you share your workspace on Github?
> 
> Kind regards,
> 
>       Peter Kriens
> 
>> On 2 nov. 2016, at 06:07, Elliot Huntington <elliot.hunting...@gmail.com> 
>> wrote:
>> 
>> I've been working through this tutorial tonight and everything works as 
>> explained until I get to step 8: A Web Application. When I try to open the 
>> web application in the browser 
>> (http://localhost:8080/osgi.enroute.examples.eval) an exception is thrown:
>> 
>> osgi.enroute.web.server.exceptions.NotFound404Exception
>>     at 
>> osgi.enroute.web.server.provider.WebresourceServlet.doGet(WebresourceServlet.java:221)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
>>     at 
>> org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)
>>     at 
>> org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)
>>     at 
>> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124)
>>     at 
>> org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61)
>>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
>>     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
>>     at 
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>     at 
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
>>     at 
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
>>     at 
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>>     at 
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>>     at 
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
>>     at 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>     at 
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>>     at 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>>     at org.eclipse.jetty.server.Server.handle(Server.java:518)
>>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
>>     at 
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
>>     at 
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
>>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>     at 
>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
>>     at 
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
>>     at 
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
>>     at 
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>>     at 
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>>     at java.lang.Thread.run(Thread.java:745)
>> 
>> I think this might have something to do with this part of the tutorial:
>> 
>> --------------
>> The Javascript Code
>> 
>> The Javascript code must be placed in a directory in the 
>> src/resources/main/web.
>> Any content in this directory is treated as a web resource and automatically
>> included in the index.html page. The name of the files is irrelevant but the 
>> extension
>> is since the selection in the index.html file takes place on extension.
>> 
>> application $ mkdir -p src/main/resources/web
>> 
>> main.js
>> 
>> application $ vi src/main/resources/web/main.js
>> // add the content
>> ----------------
>> 
>> I tried placing the main.js file in each location highlighted in bold but I 
>> got the same error regardless of where I put the file. The error isn't 
>> explicit regarding which resource is not found, so I don't know how to 
>> proceed.
>> 
>> I posted the project on my github account for an exact reference to see if I 
>> made any mistakes. Any help resolving this issue will be greatly appreciated.
>> 
>> https://github.com/axiopisty/osgi-enroute-maven-tutorial
>> 
>> Thank you,
>> Elliot
>> 
>> On Thu, Oct 13, 2016 at 3:17 PM, Daghan ACAY <daghana...@hotmail.com> wrote:
>> Hi Christian,
>> 
>> I was quite happy with the auto deploy until now. I give you that sometimes 
>> it breaks when i do something fancy, e.g change code and save while stopped 
>> at debug point. But other than that it was quite solid.
>> 
>> On the other hand i had fair amount of problem when i refresh repositories. 
>> Sometimes for no reason projects in workspace gives compilation error and it 
>> takes multiple repository refreshes from bndtools menu in eclipse to get it 
>> recognizing distro and other repositories. But that is another bug report.
>> 
>> Thanks for the answers i am looking forward to get my hands on the code.
>> 
>> Cheers
>> Daghan
>> 
>> Sent by MailWise – See your emails as clean, short chats.
>> 
>> 
>> 
>> -------- Original Message --------
>> From: Christian Schneider <ch...@die-schneider.net>
>> Sent: Thursday, October 13, 2016 07:38 PM
>> To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
>> Subject: Re: [osgi-dev] OSGi enRoute Maven Testers wanted ...
>> 
>> Hi Daghan,
>> 
>> I think I can answer part of your questions.
>> 
>> Christian
>> 
>> On 12.10.2016 23:27, Daghan ACAY wrote:
>> >
>> > 2- how is bndtool resolution and hot deploy from eclipse affected? 
>> > Should we still resolve bndrun in eclipse?
>> >
>> You can still resolve using the UI. But you can also do a pure maven build.
>> Hot deploy does not work reliably. You have to at least do mvn install 
>> on the module you changed and restart your OSGi runtime.
>> >
>> > 3- as a suggestion breaking a build and copy pasting will not work in 
>> > ci/cd. I think a more automated solution can be beneficial.
>> >
>> You can use this configuration to make the resolve completely automated
>> <configuration>
>>    <resolve>true</resolve>
>>    <failOnChanges>false</failOnChanges>
>> </configuration>
>> 
>> -- 
>> Christian Schneider
>> http://www.liquid-reality.de
>> 
>> Open Source Architect
>> http://www.talend.com
>> 
>> _______________________________________________
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>> 
>> _______________________________________________
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
>> 
>> _______________________________________________
>> OSGi Developer Mail List
>> osgi-dev@mail.osgi.org
>> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
> 
> 
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to