Skip to content

Commit

Permalink
Adapt for karaf 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cschneider committed Feb 2, 2017
1 parent 544af0e commit 07201eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Expand Up @@ -12,7 +12,7 @@
import net.lr.tasklist.model.TaskService;

@Singleton
@OsgiServiceProvider
@OsgiServiceProvider(classes=TaskAddCommand.class)
@Properties(//
{
@Property(name = "osgi.command.scope", value = "task"),
Expand Down
Expand Up @@ -12,7 +12,7 @@
import net.lr.tasklist.model.TaskService;

@Singleton
@OsgiServiceProvider
@OsgiServiceProvider(classes=TaskGetCommand.class)
@Properties(//
{
@Property(name = "osgi.command.scope", value = "task"),
Expand Down
Expand Up @@ -13,7 +13,7 @@
import net.lr.tasklist.model.TaskService;

@Singleton
@OsgiServiceProvider
@OsgiServiceProvider(classes=TaskListCommand.class)
@Properties(//
{
@Property(name = "osgi.command.scope", value = "task"),
Expand Down
Expand Up @@ -21,9 +21,14 @@
import net.lr.tasklist.model.Task;
import net.lr.tasklist.model.TaskService;

/**
* The is an issue in Apache Karaf 4.1.0 when both properties below are set. The servlet will then not be registered.
* For this case remove the alias property.
*/
@OsgiServiceProvider(classes = Servlet.class)
@Properties({@Property(name = "alias", value = "/tasklist"), // For pax web
@Property(name = "osgi.http.whiteboard.servlet.pattern", value = "/tasklist") // For felix http
@Properties({//
//@Property(name = "alias", value = "/tasklist"), // For pax web < 6 like in Apache Karaf < 4.1
@Property(name = "osgi.http.whiteboard.servlet.pattern", value = "/tasklist") // For felix http
})
@Singleton
public class TaskListServlet extends HttpServlet {
Expand Down

0 comments on commit 07201eb

Please sign in to comment.