i have created bnd-workspace amdatu-bootstrap jar file. created testing rest project , bnd run descriptor file test it. when run the run descriptor file , navigated http://localhost:8080/test, faced 404 page :(.
http error: 404 problem accessing /test. reason: not found
here in-detail steps took so:
- downloaded , used bootstrap-bin-r9.zip
- in amdatu bootstrap ui, initialize workspace issued "workspace-init" "amdatu" template
- then created project "osgi.test" "project-create" command
- then created test component "tmp.test" "/test" url using "rest-createcomponent" command
- then added rest required dependencies using "rest-install" command
- then created launcher.bndrun org.apache.felix.framework;version='[5.2.0,5.2.0]' , java-1.8 osgi framework.
- then added rest required libraries launcher.bndrun "rest-run" command
- then added gogo , dm shell "shell-run" command
test component:
package tmp; import java.util.list; import javax.ws.rs.path; import javax.ws.rs.core.mediatype; import javax.ws.rs.get; import javax.ws.rs.produces; import java.util.arrays; import org.apache.felix.dm.annotation.api.component; @component(provides = object.class) @path("/test") public class test { @get @produces(mediatype.application_json) public list<string> list() { return arrays.aslist("test"); } }
here list of bundles:
lb start level 1 id|state |level|name 0|active | 0|system bundle (5.2.0) 1|active | 1|apache felix http jetty (3.2.0) 2|active | 1|apache felix http api (3.0.0) 3|active | 1|apache felix servlet api (1.1.2) 4|active | 1|apache felix http whiteboard (3.0.0) 5|active | 1|org.amdatu.web.rest.jaxrs (1.1.1) 6|active | 1|org.amdatu.web.rest.wink (3.0.1) 7|active | 1|org.amdatu.web.rest.doc (1.2.3) 8|active | 1|jackson-annotations (2.6.3) 9|active | 1|jackson-core (2.6.3) 10|active | 1|jackson-databind (2.6.3) 11|active | 1|jackson-jaxrs-base (2.6.3) 12|active | 1|jackson-jaxrs-json (2.6.3) 13|active | 1|apache felix dependency manager (4.3.0) 14|active | 1|apache felix dependency manager runtime (4.0.3) 15|active | 1|apache felix metatype service (1.0.12) 16|active | 1|apache felix eventadmin (1.3.2) 17|active | 1|apache felix configuration admin service (1.8.6) 18|active | 1|ops4j pax logging - api (1.7.0) 19|active | 1|ops4j pax logging - service (1.7.0) 20|active | 1|osgi.test (0.0.0) 21|active | 1|apache felix gogo command (0.12.0) 22|active | 1|apache felix gogo runtime (0.10.0) 23|active | 1|apache felix gogo shell (0.10.0) 24|active | 1|apache felix dependency manager shell (4.0.4)
and here result of "dm" command
dm [6] org.amdatu.web.rest.wink [0] org.amdatu.web.rest.jaxrs.jaxrsspi registered [1] org.slf4j.impl.staticloggerbinder(osgi) registered org.osgi.service.log.logservice service optional available [2] org.amdatu.web.rest.whiteboard.jaxrswhiteboard registered active{bundle.id=6} bundle required available org.osgi.service.log.logservice service optional available javax.ws.rs.core.application (osgi.jaxrs.application.base=*) service optional unavailable java.lang.object (osgi.jaxrs.resource.base=*) service optional unavailable [3] adapter interface org.amdatu.web.rest.jaxrs.applicationservice registered org.amdatu.web.rest.jaxrs.applicationservice service optional unavailable [14] org.apache.felix.dependencymanager.runtime [4] org.apache.felix.dm.runtime.dependencymanagerruntime registered active (dependencymanager-component=*) bundle optional unavailable org.osgi.service.packageadmin.packageadmin service required available org.osgi.service.log.logservice service optional available
when navigate http://localhost:8080/test following errors shown
http error: 404 problem accessing /test. reason: not found
any helps appreciated.
changing version of org.amdatu.web.rest.wink 2.0.3 solve problem.
i don't know wrong version 3+ , why works 2.0.3 ?!!!
Comments
Post a Comment