--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
--Raymond Augé (@rotty3000)Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance)
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----BJ
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
I’ve pushed an example to https://github.com/timothyjward/osgi.enroute/tree/postgres. To keep things as simple as possible I’ve just branched OSGi enRoute R7 into a branch named ‘postgres’ and made the minimum necessary set of changes. This gives you a Maven build that produces an OSGi application using the following at runtime:
Apache Felix 5.7.0-SNAPSHOT (an R6 framework)
Hibernate 5.2.12
Postgres JDBC 9.4.1212
Managed JPA using the Apache Aries JPA Container 2.7.0-SNAPSHOT and Apache Aries Transaction Control 1.0.0-SNAPSHOT
The changes I needed to make are visible in this commit https://github.com/timothyjward/osgi.enroute/commit/30f861ff6ba37dcbdc4a814f5c3c24e7d682ae17
I changed the H2 dependency in the rest-app-jpa pom to a dependency on the Postgres JDBC driver
I changed the H2 requirement in the rest-app-jpa.bndrun to require the Postgres JDBC driver
I updated the rest-app-jpa configuration to connect to a Postgres server
I tweaked the table creation scripts in the dao-impl-jpa project to make them work on Postgres 9.4 (it doesn’t support the SQL “generated” keyword)
If you want to run this example against your own PostgreSQL database then you will need to change this line of configuration to point at your own server. You may also need to add configuration entries for “user” and “password” into that JSON object if your database requires authentication.
You should be able to build this example from the command line using “mvn verify” which will output a runnable jar file in examples/microservice/rest-app-jpa/target/rest-app-jpa.jar - this can simply be launched by running “java -jar rest-app-jpa.jar” and halted by hitting Ctrl+C. When the app is running there will be a REST API returning JSON at http://localhost:8080/person and a simple Polymer based UI at http://localhost:8080/microservice/index.html (note that this can take a few seconds to load the polymer javascript from the web). The UI will let you add people (and multiple addresses if you click ‘+’) to the database, and remove existing entries.
If you import the example into Eclipse (as an existing Maven project), and you have the latest Bndtools 4.0.0 snapshot (installation instructions here) then you will also be able to run the bndrun files directly from in the IDE. The debug.bndrun extends the rest-app-jpa.bndrun and adds Felix Gogo and Felix File install. If you make changes and want to re-resolve the application then this can be done from the IDE, or from the command line using “mvn bnd-resolver:resolve” on the rest-app-jpa project.
The official website documenting the R7 enRoute examples is still being written, however a rough cut of the base materials is visible at https://github.com/timothyjward/osgi.enroute.site/tree/R7 - the raw instructions for putting together the jdbc version of the microservice are visible at https://github.com/timothyjward/osgi.enroute.site/blob/R7/_tutorial/030-tutorial_microservice.md
Now - you’ve stated a desire to use R6 (which the application actually is) but I’m sure that you’ll notice that there are still snapshots being used (including of the bnd tooling). This is because the overall setup is a lot simpler if we’re able to use some of the build-time OSGi R7 annotations - this in turn is supported by bnd/bndtools 4.0.0-SNAPSHOT. The resulting code has no dependency on the OSGi framework API and can therefore be run on existing R5 and R6 implementations.
The sorts of things that the R7 binaries let us do are:
Require the JPA service and set up the bundle’s Meta-Persistence header without needing a bnd file
Serve a JAX-RS resource and static content in a type-safe way
Declare our need for a configuration provider
It is absolutely possible to remove these annotations and to declare the metadata manually (which would also remove the need for bnd 4.0.0-SNAPSHOT), but it adds quite a bit of noise to the bnd.bnd file for each bundle, and it also makes it much easier to make a typo when declaring things. The only parts of R7 that are actually directly required by this example are the JAX-RS whiteboard and the Transaction Control service.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
Import-Package: org.osgi.framework;version=[1.8.0,2.0.0), *For those bundles edit your bnd files to include a statement like:Import-Package: ... org.osgi.framework;version=[1.9.0,2.0.0) ...Look at your output bundles and check to see which ones have:b) make sure if you use them that you manually set the version import range to a version range supported by the runtime framework.a) don't use any org.osgi.framework APIs in your codeYou need to review your code and do one of two things:If you re-read my last post I explain precisely why you are having an issue.Tim's code doesn't directly use the OSGi core framework APIs (i.e. org.osgi.framework) which means the examples never cause the onerous import to come in.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
--Raymond Augé (@rotty3000)Board Member & EEG Co-Chair, OSGi Alliance (@OSGiAlliance)
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.