Rohit Jain
Rohit Jain

Reputation: 213243

Unable to start a fragment bundle while using JSP with OSGi

So, I am trying to use JSP and JSTL to build the UI to work with OSGi environment. I've added the required bundle for the JSTL to work: -

I have also added all the required bundle in the environment. At the end, solving the following dependencies, I end up adding too many bundles, but I am stuck at one point.

One of my bundle (I think that is a fragment), is not getting started, and it's dependency is not getting resolved. The exception which I get is: -

org.osgi.framework.BundleException: A fragment bundle cannot be started: com.springsource.org.apache.jasper_7.0.26 [107]

And following this exception, I've got one more exception: -

org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.jsp.jasper_1.0.0.v20070607 [117]" could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.jasper.servlet; version="0.0.0"

I've following list of bundles installed, some of them are not Active: -

id  State       Bundle
0   ACTIVE      org.eclipse.osgi_3.7.1.R37x_v20110808-1106
6   ACTIVE      org.eclipse.persistence.core_2.3.2.v20111125-r10461
10  ACTIVE      javax.persistence_2.0.3.v201010191057
12  ACTIVE      org.eclipse.persistence.antlr_2.3.2.v20111125-r10461
15  ACTIVE      org.eclipse.persistence.jpa.jpql_2.0.1.v20121003-ad44345
16  ACTIVE      org.eclipse.persistence.asm_2.3.2.v20111125-r10461
21  ACTIVE      org.eclipse.persistence.jpa_2.3.2.v20111125-r10461
25  ACTIVE      StockControlSystem_0.0.1
28  ACTIVE      javax.annotation_1.1.0.v201105051105
32  ACTIVE      org.springframework.core_3.0.5.RELEASE
33  ACTIVE      org.springframework.aop_3.0.5.RELEASE
34  ACTIVE      com.scs.request_1.0.0.qualifier
35  ACTIVE      org.eclipse.virgo.util.common_3.0.1.RELEASE
37  ACTIVE      com.scs.order_1.0.0.qualifier
38  ACTIVE      org.springframework.osgi.io_1.2.1
41  ACTIVE      mysql.jdbc_1.0.0
45  ACTIVE      com.springsource.org.apache.tomcat.api_7.0.26
47  ACTIVE      org.springframework.osgi.core_1.2.1
48  ACTIVE      com.springsource.org.apache.commons.logging_1.1.1
49  ACTIVE      com.springsource.org.eclipse.jdt.core.compiler.batch_3.6.1
53  ACTIVE      com.scs.persistence_1.0.0.qualifier
55  ACTIVE      com.scs.stockdetails_1.0.0.qualifier
58  ACTIVE      com.scs.delivery_1.0.0.qualifier
59  ACTIVE      org.springframework.beans_3.0.5.RELEASE
60  ACTIVE      org.springframework.context_3.0.5.RELEASE
66  ACTIVE      joda.time_1.0.0
67  ACTIVE      com.springsource.org.aopalliance_1.0.0
71  ACTIVE      javax.servlet_3.0.0.v201103241009
72  ACTIVE      com.springsource.org.apache.xmlcommons_1.3.4
73  ACTIVE      javax.el_2.2.0.v201105051105
74  ACTIVE      javax.servlet.jsp_2.2.0.v201103241009
75  ACTIVE      com.springsource.javax.servlet.jsp.jstl_1.2.0.v20110728
76  ACTIVE      org.eclipse.osgi.services_3.3.0.v20110513
78  ACTIVE      com.springsource.javax.xml.soap_1.3.0
80  RESOLVED    com.springsource.org.apache.coyote_7.0.26
                Master=83
81  ACTIVE      com.springsource.javax.activation_1.1.1
82  ACTIVE      com.springsource.javax.mail_1.4.0
83  ACTIVE      com.springsource.org.apache.catalina_7.0.26
                Fragments=80, 88, 95, 97
84  ACTIVE      com.springsource.javax.persistence_1.0.0
88  RESOLVED    com.springsource.org.apache.catalina.ha_7.0.26
                Master=83
92  ACTIVE      org.eclipse.virgo.util.parser.manifest_3.0.1.RELEASE
93  ACTIVE      com.springsource.org.apache.juli.extras_7.0.26
95  RESOLVED    com.springsource.org.apache.catalina.tribes_7.0.26
                Master=83
97  RESOLVED    com.springsource.org.apache.tomcat.util_7.0.26
                Master=83
100 ACTIVE      com.springsource.javax.ejb_3.0.0
101 ACTIVE      com.springsource.javax.xml.rpc_1.1.0.v20110517
102 ACTIVE      org.eclipse.equinox.util_1.0.300.v20110502
103 ACTIVE      org.eclipse.equinox.ds_1.3.0.v20110502
104 ACTIVE      com.springsource.slf4j.api_1.6.1
                Fragments=113
105 ACTIVE      org.eclipse.virgo.util.math_3.0.1.RELEASE
106 ACTIVE      org.eclipse.virgo.util.io_3.0.1.RELEASE
107 INSTALLED   com.springsource.org.apache.jasper_7.0.26
108 ACTIVE      com.springsource.javax.transaction_1.1.0
109 ACTIVE      org.eclipse.virgo.util.osgi_3.0.1.RELEASE
110 ACTIVE      org.eclipse.gemini.web.tomcat_2.0.2.RELEASE
111 ACTIVE      org.eclipse.gemini.web.core_2.0.2.RELEASE
112 ACTIVE      com.springsource.javax.xml.bind_2.1.7
113 RESOLVED    com.springsource.slf4j.nop_1.6.1
                Master=104
114 ACTIVE      com.springsource.javax.xml.stream_1.0.1
115 ACTIVE      org.eclipse.gemini.web.extender_2.0.2.RELEASE
116 ACTIVE      com.springsource.org.apache.el_7.0.26
117 INSTALLED   org.eclipse.equinox.jsp.jasper_1.0.0.v20070607

So, you can see that, Bundle 107 - com.springsource.org.apache.jasper_7.0.26 is in installed state, which I think contains the Missing-Import Package of the equinox.jsp.jasper bundle - Bundle 117

After some research, I found that, I need to add some more bundles: -

Out of those, I've found the 3rd bundle, but I'm unable to find the first 2 bundles.

Can anyone see what is going on. Have I done something wrong at some place? Or Did I miss to add some bundle? I've been stuck in this issue from the last 2 days, and I think, I'm in no way going to resolve this issue.

One more thing, which I think might be important is, I'm getting these warnings, when I try to start my Web APP bundle - Bundle 25: -

Jan 18, 2013 11:06:30 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/resources/j2ee_1_4.xsd
Jan 18, 2013 11:06:30 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/resources/javaee_5.xsd
Jan 18, 2013 11:06:30 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/resources/javaee_6.xsd
Jan 18, 2013 11:06:30 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/resources/xml.xsd
Jan 18, 2013 11:06:30 AM org.apache.catalina.startup.DigesterFactory register
WARNING: Could not get url for /javax/servlet/resources/XMLSchema.dtd

There are some more warnings like this, but I've skipped them, as there are too many.

I've added as much information, that I think would be needed. But, if you need some more information, please ask the same.

Upvotes: 1

Views: 3989

Answers (2)

Neil Bartlett
Neil Bartlett

Reputation: 23948

First of all, fragments can never be started as they don't have their own lifecycle. So this is not really an error; you just shouldn't try to start a fragment.

Second, it looks like bundle 117 is indeed failing because of the missing import of package org.apache.jasper.servlet, and this package probably comes from the fragment 107 that doesn't resolve. So the challenge is to work out why 107 can't resolve. You can get a clue about this by typing the command diag 107; this will print the list of unsatisfied imports for the fragment.

Upvotes: 2

Achim Nierbeck
Achim Nierbeck

Reputation: 5285

It might not be pleasant for you, but if you use Pax-Web instead of Gemini, it'll work with jsp right away.

Pax-Web can be found at http://www.google.de/url?sa=t&rct=j&q=pax%20web&source=web&cd=1&cad=rja&ved=0CDcQFjAA&url=http%3A%2F%2Fteam.ops4j.org%2Fwiki%2Fdisplay%2Fpaxweb%2FPax%2BWeb&ei=-WT6UITsL4mItQbw_IGICA&usg=AFQjCNFWWNAvM4nxEqoqVnlL14P3gt2aLw&sig2=Q7fVwc6mjMN68ErFbhTDEA&bvm=bv.41248874,d.Yms

It looks to me, like you are building a complete container. Ever considered using either Apache Karaf or Eclipse Virgo? Karaf is also awailable with a minimal set, containing only the basics.

Upvotes: 0

Related Questions