You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Brad Cox <bc...@virtualschool.edu> on 2008/10/21 14:14:03 UTC

JDOM Bundle Problems

Surely such a simple problem can't be so difficult. Can someone help?

I need to use org.jdom in an OSGI application. But it is not (to my 
knowledge) available as a bundle, just a jar. So I've been trying to 
wrap the jar as a bundle; soakit.jdom.

The problem then is getting dependent jars into that bundle. All 
permutations I've tried all wind up in errors like this one. Adding the 
unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the 
problem worse; the unresolved references list just grows and grows.

I'm using Java 1.5 on MacOSX.

[ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT : 
Unresolved references to [javax.security.auth.x500, javax.xml.parsers, 
javax.xml.transform, javax.xml.transform.sax, 
javax.xml.transform.stream, oracle.xml.parser, oracle.xml.parser.v2, 
org.apache.xerces.dom, org.apache.xerces.parsers, org.jaxen, 
org.jaxen.jdom, org.w3c.dom, org.xml.sax, org.xml.sax.ext, 
org.xml.sax.helpers] by class(es) on the Bundle-Classpath[Jar:dot]: 
[org/jdom/adapters/XML4JDOMAdapter.class, 
org/jdom/adapters/XercesDOMAdapter.class, 
org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class, 
org/jdom/input/BuilderErrorHandler.class, 
org/jdom/transform/JDOMResult$FragmentHandler.class, 
org/jdom/adapters/CrimsonDOMAdapter.class, 
org/jdom/input/DOMBuilder.class, org/jdom/JDOMException.class, 
org/jdom/input/JAXPParserFactory.class, 
org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class, 
org/jdom/adapters/DOMAdapter.class, 
org/jdom/adapters/OracleV1DOMAdapter.class, 
org/eclipse/core/runtime/internal/adaptor/PluginParser.class, 
org/jdom/output/JDOMLocator.class, 
org/jdom/transform/JDOMSource$DocumentReader.class, 
org/jdom/xpath/JaxenXPath$NSContext.class, 
org/jdom/transform/JDOMSource$JDOMInputSource.class, 
org/jdom/transform/XSLTransformer.class, 
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class, 
org/jdom/adapters/JAXPDOMAdapter.class, 
org/jdom/input/JDOMParseException.class, 
org/jdom/output/SAXOutputter.class, org/jdom/output/DOMOutputter.class, 
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class, 
org/jdom/transform/JDOMResult$DocumentBuilder.class, 
org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class, 
org/jdom/adapters/AbstractDOMAdapter.class, 
org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class, 
org/eclipse/osgi/internal/signedcontent/DNChainMatching.class, 
org/jdom/adapters/OracleV2DOMAdapter.class, 
org/jdom/transform/JDOMSource.class]

Here's the pom. The commented sections show various permutations I've tried.

<project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">

     <modelVersion>4.0.0</modelVersion>

     <groupId>soakit</groupId>
     <artifactId>soakit.jdom</artifactId>
     <version>1.0-SNAPSHOT</version>

     <name>soakit.jdom</name>
     <description>org.jdom and commons.collections</description>
     <packaging>bundle</packaging>

     <parent>
         <groupId>soakit</groupId>
         <artifactId>soakit</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>

     <dependencies>
			<dependency>
			  <groupId>org.jdom</groupId>
			  <artifactId>jdom</artifactId>
   			<version>1.1</version>
			</dependency>
			<dependency>
				 <groupId>commons-collections</groupId>
				 <artifactId>commons-collections</artifactId>
				 <version>3.1</version>
			</dependency>
			<!--
			<dependency>
					<groupId>com.sun.xml.bind</groupId>
					<artifactId>jaxb-xjc</artifactId>
					<version>2.1.6</version>
			</dependency>
			<dependency>
				<groupId>com.oracle.xml</groupId>
				<artifactId>com.springsource.oracle.xml</artifactId>
				<version>10.2.0.2</version>
			</dependency>
			<dependency>
				<groupId>javax.sql</groupId>
				<artifactId>jdbc-stdext</artifactId>
				<version>2.0</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jaas</artifactId>
				<version>1.0.01</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jacc</artifactId>
				<version>1.0</version>
			</dependency>
			<dependency>
				<groupId>javax.activation</groupId>
				<artifactId>activation</artifactId>
				<version>1.1</version>
			</dependency>
			-->
			<!--
			<dependency>
				<groupId>javax.xml.parsers</groupId>
				<artifactId>jaxp-api</artifactId>
				<version>1.4</version>
			</dependency>
			<dependency>
				<groupId>xerces</groupId>
				<artifactId>xercesImpl</artifactId>
				<version>2.4.0</version>
			</dependency>
			<dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
         <version>2.8.1</version>
       </dependency>
			<dependency>
				<groupId>org.w3c</groupId>
				<artifactId>dom</artifactId>
				<version>2.3.0-jaxb-1.0.6</version>
			</dependency>
			-->
<!--
javax.security.auth.x500
oracle.xml.parser
oracle.xml.parser.v2
org.apache.env
org.apache.xml.resolver
org.apache.xml.resolver.readers
sun.io
-->
     </dependencies>

     <build>
         <plugins>
						<plugin>
							<artifactId>maven-compiler-plugin</artifactId>
							<configuration>
								<source>1.5</source>
								<target>1.5</target>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.felix</groupId>
							<artifactId>maven-scr-plugin</artifactId>
						</plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
								<version>1.4.3</version>
                 <extensions>true</extensions>
                 <configuration>
										<manifestLocation>META-INF</manifestLocation>
                     <instructions>
                         <Bundle-Version>${pom.version}</Bundle-Version>
                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
                         <Bundle-Vendor>Gestalt</Bundle-Vendor>
 
<Bundle-Description>${pom.description}</Bundle-Description>
 
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
												<Embed-Transitive>true</Embed-Transitive>
											 
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
												<Embed-Directory>target/dependency</Embed-Directory>
											 
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
												<Bundle-ClassPath>
													lib/jaxen-core.jar,
													lib/jaxen-jdom.jar,
													lib/saxpath.jar,
													lib/xalan.jar,
													lib/xerces.jar,
													lib/xml-apis.jar,
													lib/activation.jar,
													lib/jndi.jar,
												</Bundle-ClassPath>
												<Include-Resource>
													lib=lib
												</Include-Resource>
                         <Export-Package>
													org.apache.commons.collections.*;version="3.1",
													org.jdom.*,
                         </Export-Package>
                         <Import-Package>
                           *;resolution:=optional
                         </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
</project>


Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
No, I tried including jdom as an ordinary dependency of another one of 
my bundle poms. Exactly the same error:

Brad Cox wrote:
> Could the problem be that now I'm trying to wrap a bundle not a jar? Is 
> that even possible?



Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
That could explain it. Thanks!

But I didn't understand your fix:
  * Declare *what* to <Embed-Dependency> and how? Not familiar with that 
command.
  * Set which dependency scope to compile?
  * Will jdom still work at runtime that way?

arnaud.constancin@orange-ftgroup.com wrote:
> I have same problem with jDom. The jdom jar contains classes at the root level with no no package. 
This "." package cannot be included in the bundle Exports or Imports...
> 
> So, I don't declare it to <Embed-Dependency> and set dependency scope to <scope>compile</scope>. 
The jdom classes are extrated to the bundle... And the Error disappears.




RE: JDOM Bundle Problems

Posted by ar...@orange-ftgroup.com.
Hello, 

I have same problem with jDom. The jdom jar contains classes at the root level with no no package. This "." package cannot be included in the bundle Exports or Imports... 

So, I don't declare it to <Embed-Dependency> and set dependency scope to <scope>compile</scope>. The jdom classes are extrated to the bundle... And the Error disappears.


--

  Arnaud Constancin

  Software Architect

  Orange Labs
  ft/nsm/rd/maps/shine/sume

  tel. externe 04 76 76 44 16

  tel. interne 83 44 16
  mob. 06 84 79 99 63
  arnaud.constancin@orange-ftgroup.com

 


-----Message d'origine-----
De : Brad Cox [mailto:bcox@virtualschool.edu] 
Envoyé : mardi 21 octobre 2008 15:04
À : users@felix.apache.org
Objet : Re: JDOM Bundle Problems

Could the problem be that now I'm trying to wrap a bundle not a jar? Is that even possible?

I'd like to keep the soakit.jdom name until this gets resolved, to avoid editing <dependencies> in (numerous) dependent poms.

Brad Cox wrote:
> Nope, not the hanging comma. Other ideas?
> 
> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT : 
> Unresolved references to [.] by class(es) on the
> Bundle-Classpath[Jar:dot]: [JDOMAbout$Info.class, JDOMAbout.class, 
> JDOMAbout$Author.class] [ERROR] Error(s) found in bundle configuration
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> 
>     <modelVersion>4.0.0</modelVersion>
> 
>     <groupId>soakit</groupId>
>     <artifactId>soakit.jdom</artifactId>
>     <version>1.0-SNAPSHOT</version>
> 
>     <name>soakit.jdom</name>
>     <description>org.jdom and commons.collections</description>
>     <packaging>bundle</packaging>
> 
>     <parent>
>         <groupId>soakit</groupId>
>         <artifactId>soakit</artifactId>
>         <version>1.0-SNAPSHOT</version>
>     </parent>
> 
>     <dependencies>
>             <dependency>
>                 <!--
>               <groupId>org.jdom</groupId>
>               <artifactId>jdom</artifactId>
>               <version>1.1</version>
>                 -->
>                 <groupId>org.jdom</groupId>
>                 <artifactId>com.springsource.org.jdom</artifactId>
>                 <version>1.0.0</version>
>             </dependency>
>             <dependency>
>                  <groupId>commons-collections</groupId>
>                  <artifactId>commons-collections</artifactId>
>                  <version>3.1</version>
>             </dependency>
>             <!--
>             <dependency>
>                     <groupId>com.sun.xml.bind</groupId>
>                     <artifactId>jaxb-xjc</artifactId>
>                     <version>2.1.6</version>
>             </dependency>
>             <dependency>
>                 <groupId>com.oracle.xml</groupId>
>                 <artifactId>com.springsource.oracle.xml</artifactId>
>                 <version>10.2.0.2</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.sql</groupId>
>                 <artifactId>jdbc-stdext</artifactId>
>                 <version>2.0</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.security</groupId>
>                 <artifactId>jaas</artifactId>
>                 <version>1.0.01</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.security</groupId>
>                 <artifactId>jacc</artifactId>
>                 <version>1.0</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.activation</groupId>
>                 <artifactId>activation</artifactId>
>                 <version>1.1</version>
>             </dependency>
>             -->
>             <!--
>             <dependency>
>                 <groupId>javax.xml.parsers</groupId>
>                 <artifactId>jaxp-api</artifactId>
>                 <version>1.4</version>
>             </dependency>
>             <dependency>
>                 <groupId>xerces</groupId>
>                 <artifactId>xercesImpl</artifactId>
>                 <version>2.4.0</version>
>             </dependency>
>             <dependency>
>         <groupId>xerces</groupId>
>         <artifactId>xercesImpl</artifactId>
>         <version>2.8.1</version>
>       </dependency>
>             <dependency>
>                 <groupId>org.w3c</groupId>
>                 <artifactId>dom</artifactId>
>                 <version>2.3.0-jaxb-1.0.6</version>
>             </dependency>
>             -->
> <!--
> javax.security.auth.x500
> oracle.xml.parser
> oracle.xml.parser.v2
> org.apache.env
> org.apache.xml.resolver
> org.apache.xml.resolver.readers
> sun.io
> -->
>     </dependencies>
> 
>     <build>
>         <plugins>
>                         <plugin>
>                             <artifactId>maven-compiler-plugin</artifactId>
>                             <configuration>
>                                 <source>1.5</source>
>                                 <target>1.5</target>
>                             </configuration>
>                         </plugin>
>                         <plugin>
>                             <groupId>org.apache.felix</groupId>
>                             <artifactId>maven-scr-plugin</artifactId>
>                         </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <configuration>
>                                         
> <manifestLocation>META-INF</manifestLocation>
>                     <instructions>
>                         <Bundle-Version>${pom.version}</Bundle-Version>
>                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
>                         <Bundle-Vendor>Gestalt</Bundle-Vendor>
> 
> <Bundle-Description>${pom.description}</Bundle-Description>
> 
> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>                                                 
> <Embed-Transitive>true</Embed-Transitive>
>                                              
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependenc
> y>
>                                                 
> <Embed-Directory>target/dependency</Embed-Directory>
>                                              
> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutio
> nEnvironment>
> 
>                                                 <!--
>                                                 <Bundle-ClassPath>
>                                                     lib/jaxen-core.jar,
>                                                     lib/jaxen-jdom.jar,
>                                                     lib/saxpath.jar,
>                                                     lib/xalan.jar,
>                                                     lib/xerces.jar,
>                                                     lib/xml-apis.jar,
>                                                     lib/activation.jar,
>                                                     lib/jndi.jar,
>                                                 </Bundle-ClassPath>
>                                                 <Include-Resource>
>                                                     lib=lib
>                                                 </Include-Resource>
>                                                 <Import-Bundle>
>                                                     
> com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>                                                 </Import-Bundle>
>                                                 -->
>                         <Export-Package>
>                                                     
> org.apache.commons.collections.*;version="3.1",
>                                                     org.jdom.*
>                         </Export-Package>
>                         <Import-Package>
>                           *;resolution:=optional
>                         </Import-Package>
>                     </instructions>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
> </project>
> 
> 
> Stuart McCulloch wrote:
>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>
>>
>>> Thanks! That reduced it to one stupefying problem. Can you advise?
>>>
>>> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT :
>>> Unresolved references to [.] by class(es) on the
>>> Bundle-Classpath[Jar:dot]:
>>> [JDOMAbout$Info.class, JDOMAbout.class, JDOMAbout$Author.class] 
>>> [ERROR] Error(s) found in bundle configuration
>>>
>>> Here's the changed POM:
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>
>>>    <modelVersion>4.0.0</modelVersion>
>>>
>>>    <groupId>soakit</groupId>
>>>    <artifactId>soakit.jdom</artifactId>
>>>    <version>1.0-SNAPSHOT</version>
>>>
>>>    <name>soakit.jdom</name>
>>>    <description>org.jdom and commons.collections</description>
>>>    <packaging>bundle</packaging>
>>>
>>>    <parent>
>>>        <groupId>soakit</groupId>
>>>        <artifactId>soakit</artifactId>
>>>        <version>1.0-SNAPSHOT</version>
>>>    </parent>
>>>
>>>    <dependencies>
>>>                        <dependency>
>>>                                <!--
>>>                          <groupId>org.jdom</groupId>
>>>                          <artifactId>jdom</artifactId>
>>>                        <version>1.1</version>
>>>                                -->
>>>                                <groupId>org.jdom</groupId>
>>>
>>>  <artifactId>com.springsource.org.jdom</artifactId>
>>>                                <version>1.0.0</version>
>>>
>>>                        </dependency>
>>>                        <dependency>
>>>                                 
>>> <groupId>commons-collections</groupId>
>>>
>>> <artifactId>commons-collections</artifactId>
>>>                                 <version>3.1</version>
>>>                        </dependency>
>>>                        <!--
>>>                        <dependency>
>>>                                        
>>> <groupId>com.sun.xml.bind</groupId>
>>>                                        <artifactId>jaxb-xjc</artifactId>
>>>                                        <version>2.1.6</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>com.oracle.xml</groupId>
>>>
>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>                                <version>10.2.0.2</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.sql</groupId>
>>>                                <artifactId>jdbc-stdext</artifactId>
>>>                                <version>2.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.security</groupId>
>>>                                <artifactId>jaas</artifactId>
>>>                                <version>1.0.01</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.security</groupId>
>>>                                <artifactId>jacc</artifactId>
>>>                                <version>1.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.activation</groupId>
>>>                                <artifactId>activation</artifactId>
>>>                                <version>1.1</version>
>>>                        </dependency>
>>>                        -->
>>>                        <!--
>>>                        <dependency>
>>>                                <groupId>javax.xml.parsers</groupId>
>>>                                <artifactId>jaxp-api</artifactId>
>>>                                <version>1.4</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>xerces</groupId>
>>>                                <artifactId>xercesImpl</artifactId>
>>>                                <version>2.4.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>        <groupId>xerces</groupId>
>>>        <artifactId>xercesImpl</artifactId>
>>>        <version>2.8.1</version>
>>>      </dependency>
>>>                        <dependency>
>>>                                <groupId>org.w3c</groupId>
>>>                                <artifactId>dom</artifactId>
>>>                                <version>2.3.0-jaxb-1.0.6</version>
>>>                        </dependency>
>>>                        -->
>>> <!--
>>> javax.security.auth.x500
>>> oracle.xml.parser
>>> oracle.xml.parser.v2
>>> org.apache.env
>>> org.apache.xml.resolver
>>> org.apache.xml.resolver.readers
>>> sun.io
>>> -->
>>>    </dependencies>
>>>
>>>    <build>
>>>        <plugins>
>>>                                                <plugin>
>>>
>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>                                                        
>>> <configuration>
>>>
>>>  <source>1.5</source>
>>>
>>>  <target>1.5</target>
>>>                                                        </configuration>
>>>                                                </plugin>
>>>                                                <plugin>
>>>
>>>  <groupId>org.apache.felix</groupId>
>>>
>>>  <artifactId>maven-scr-plugin</artifactId>
>>>                                                </plugin>
>>>            <plugin>
>>>                <groupId>org.apache.felix</groupId>
>>>                <artifactId>maven-bundle-plugin</artifactId>
>>>
>>>  <version>1.4.3</version>
>>>                <extensions>true</extensions>
>>>                <configuration>
>>>
>>>    <manifestLocation>META-INF</manifestLocation>
>>>                    <instructions>
>>>                        <Bundle-Version>${pom.version}</Bundle-Version>
>>>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>
>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>
>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>
>>>                    <Embed-Transitive>true</Embed-Transitive>
>>>
>>>
>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Depende
>>> ncy>
>>>
>>>                    
>>> <Embed-Directory>target/dependency</Embed-Directory>
>>>
>>>
>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecut
>>> ionEnvironment>
>>>
>>>
>>>                    <!--
>>>
>>>                    <Bundle-ClassPath>
>>>
>>>                            lib/jaxen-core.jar,
>>>
>>>                            lib/jaxen-jdom.jar,
>>>
>>>                            lib/saxpath.jar,
>>>
>>>                            lib/xalan.jar,
>>>
>>>                            lib/xerces.jar,
>>>
>>>                            lib/xml-apis.jar,
>>>
>>>                            lib/activation.jar,
>>>
>>>                            lib/jndi.jar,
>>>
>>>                    </Bundle-ClassPath>
>>>
>>>                    <Include-Resource>
>>>
>>>                            lib=lib
>>>
>>>                    </Include-Resource>
>>>
>>>                    -->
>>>
>>>                    <Import-Bundle>
>>>
>>>                            
>>> com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>>>
>>>                    </Import-Bundle>
>>>
>>
>> you don't need "Import-Bundle" as this is a Spring specific header 
>> (but having it won't break anything)
>>
>>                        <Export-Package>
>>>                            
>>> org.apache.commons.collections.*;version="3.1",
>>>
>>>                            org.jdom.*,
>>>                        </Export-Package>
>>>
>>
>> the error about "." might be due to the hanging comma after 
>> org.jdom.* ...
>> try removing that comma
>>
>>
>>>                        <Import-Package>
>>>                          *;resolution:=optional
>>>                        </Import-Package>
>>>                    </instructions>
>>>                </configuration>
>>>            </plugin>
>>>        </plugins>
>>>    </build>
>>> </project>
>>>
>>>
>>>
>>> David Bosschaert wrote:
>>>
>>>> Hi Brad,
>>>>
>>>> Have a look at the SpringSource bundle repository. They have a JDom 
>>>> jar that is wrapped as a bundle.
>>>> See http://www.springsource.com/repository/app/search?query=jdom
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>:
>>>>
>>>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>>>
>>>>> I need to use org.jdom in an OSGI application. But it is not (to 
>>>>> my
>>>>> knowledge) available as a bundle, just a jar. So I've been trying 
>>>>> to wrap the jar as a bundle; soakit.jdom.
>>>>>
>>>>> The problem then is getting dependent jars into that bundle. All 
>>>>> permutations I've tried all wind up in errors like this one. 
>>>>> Adding the unresolved ones (oracle, javax, jaxen, etc) to the lib 
>>>>> just makes the problem worse; the unresolved references list just 
>>>>> grows and grows.
>>>>>
>>>>> I'm using Java 1.5 on MacOSX.
>>>>>
>>>>> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
>>>>> Unresolved references to [javax.security.auth.x500, 
>>>>> javax.xml.parsers, javax.xml.transform, javax.xml.transform.sax, 
>>>>> javax.xml.transform.stream, oracle.xml.parser, 
>>>>> oracle.xml.parser.v2, org.apache.xerces.dom, 
>>>>> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom, 
>>>>> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on 
>>>>> the
>>>>> Bundle-Classpath[Jar:dot]: 
>>>>> [org/jdom/adapters/XML4JDOMAdapter.class,
>>>>> org/jdom/adapters/XercesDOMAdapter.class,
>>>>> org/jdom/transform/JDOMResult.class, 
>>>>> org/jdom/xpath/JaxenXPath.class, 
>>>>> org/jdom/input/BuilderErrorHandler.class,
>>>>> org/jdom/transform/JDOMResult$FragmentHandler.class,
>>>>> org/jdom/adapters/CrimsonDOMAdapter.class,
>>>>> org/jdom/input/DOMBuilder.class,
>>>>> org/jdom/JDOMException.class, 
>>>>> org/jdom/input/JAXPParserFactory.class,
>>>>> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
>>>>> org/jdom/adapters/DOMAdapter.class,
>>>>> org/jdom/adapters/OracleV1DOMAdapter.class,
>>>>> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
>>>>> org/jdom/output/JDOMLocator.class,
>>>>> org/jdom/transform/JDOMSource$DocumentReader.class,
>>>>> org/jdom/xpath/JaxenXPath$NSContext.class,
>>>>> org/jdom/transform/JDOMSource$JDOMInputSource.class,
>>>>> org/jdom/transform/XSLTransformer.class,
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class
>>>>> , org/jdom/adapters/JAXPDOMAdapter.class,
>>>>> org/jdom/input/JDOMParseException.class,
>>>>> org/jdom/output/SAXOutputter.class,
>>>>> org/jdom/output/DOMOutputter.class,
>>>>>
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomPa
>>>>> rsingService.class,
>>>>>
>>>>> org/jdom/transform/JDOMResult$DocumentBuilder.class,
>>>>> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class, 
>>>>> org/jdom/adapters/AbstractDOMAdapter.class,
>>>>>
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxPa
>>>>> rsingService.class,
>>>>>
>>>>> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
>>>>> org/jdom/adapters/OracleV2DOMAdapter.class,
>>>>> org/jdom/transform/JDOMSource.class]
>>>>>
>>>>> Here's the pom. The commented sections show various permutations 
>>>>> I've tried.
>>>>>
>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>>>
>>>>>   <modelVersion>4.0.0</modelVersion>
>>>>>
>>>>>   <groupId>soakit</groupId>
>>>>>   <artifactId>soakit.jdom</artifactId>
>>>>>   <version>1.0-SNAPSHOT</version>
>>>>>
>>>>>   <name>soakit.jdom</name>
>>>>>   <description>org.jdom and commons.collections</description>
>>>>>   <packaging>bundle</packaging>
>>>>>
>>>>>   <parent>
>>>>>       <groupId>soakit</groupId>
>>>>>       <artifactId>soakit</artifactId>
>>>>>       <version>1.0-SNAPSHOT</version>
>>>>>   </parent>
>>>>>
>>>>>   <dependencies>
>>>>>                       <dependency>
>>>>>                         <groupId>org.jdom</groupId>
>>>>>                         <artifactId>jdom</artifactId>
>>>>>                       <version>1.1</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                                
>>>>> <groupId>commons-collections</groupId>
>>>>>
>>>>>  <artifactId>commons-collections</artifactId>
>>>>>                                <version>3.1</version>
>>>>>                       </dependency>
>>>>>                       <!--
>>>>>                       <dependency>
>>>>>                                       
>>>>> <groupId>com.sun.xml.bind</groupId>
>>>>>                                       
>>>>> <artifactId>jaxb-xjc</artifactId>
>>>>>                                       <version>2.1.6</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>com.oracle.xml</groupId>
>>>>>
>>>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>>>                               <version>10.2.0.2</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.sql</groupId>
>>>>>                               <artifactId>jdbc-stdext</artifactId>
>>>>>                               <version>2.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.security</groupId>
>>>>>                               <artifactId>jaas</artifactId>
>>>>>                               <version>1.0.01</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.security</groupId>
>>>>>                               <artifactId>jacc</artifactId>
>>>>>                               <version>1.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.activation</groupId>
>>>>>                               <artifactId>activation</artifactId>
>>>>>                               <version>1.1</version>
>>>>>                       </dependency>
>>>>>                       -->
>>>>>                       <!--
>>>>>                       <dependency>
>>>>>                               <groupId>javax.xml.parsers</groupId>
>>>>>                               <artifactId>jaxp-api</artifactId>
>>>>>                               <version>1.4</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>xerces</groupId>
>>>>>                               <artifactId>xercesImpl</artifactId>
>>>>>                               <version>2.4.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>       <groupId>xerces</groupId>
>>>>>       <artifactId>xercesImpl</artifactId>
>>>>>       <version>2.8.1</version>
>>>>>     </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>org.w3c</groupId>
>>>>>                               <artifactId>dom</artifactId>
>>>>>                               <version>2.3.0-jaxb-1.0.6</version>
>>>>>                       </dependency>
>>>>>                       -->
>>>>> <!--
>>>>> javax.security.auth.x500
>>>>> oracle.xml.parser
>>>>> oracle.xml.parser.v2
>>>>> org.apache.env
>>>>> org.apache.xml.resolver
>>>>> org.apache.xml.resolver.readers
>>>>> sun.io
>>>>> -->
>>>>>   </dependencies>
>>>>>
>>>>>   <build>
>>>>>       <plugins>
>>>>>                                               <plugin>
>>>>>
>>>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>>>                                                       
>>>>> <configuration>
>>>>>
>>>>>  <source>1.5</source>
>>>>>
>>>>>  <target>1.5</target>
>>>>>                                                       </configuration>
>>>>>                                               </plugin>
>>>>>                                               <plugin>
>>>>>
>>>>>  <groupId>org.apache.felix</groupId>
>>>>>
>>>>>  <artifactId>maven-scr-plugin</artifactId>
>>>>>                                               </plugin>
>>>>>           <plugin>
>>>>>               <groupId>org.apache.felix</groupId>
>>>>>               <artifactId>maven-bundle-plugin</artifactId>
>>>>>
>>>>>  <version>1.4.3</version>
>>>>>               <extensions>true</extensions>
>>>>>               <configuration>
>>>>>
>>>>>   <manifestLocation>META-INF</manifestLocation>
>>>>>                   <instructions>
>>>>>                       <Bundle-Version>${pom.version}</Bundle-Version>
>>>>>                       <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>>>                       <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>>>
>>>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>>>
>>>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>>>
>>>>>                   <Embed-Transitive>true</Embed-Transitive>
>>>>>
>>>>>
>>>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Depen
>>>>> dency>
>>>>>
>>>>>
>>>>>                   
>>>>> <Embed-Directory>target/dependency</Embed-Directory>
>>>>>
>>>>>
>>>>>
>>>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExec
>>>>> utionEnvironment>
>>>>>
>>>>>
>>>>>                   <Bundle-ClassPath>
>>>>>
>>>>>                           lib/jaxen-core.jar,
>>>>>
>>>>>                           lib/jaxen-jdom.jar,
>>>>>
>>>>>                           lib/saxpath.jar,
>>>>>
>>>>>                           lib/xalan.jar,
>>>>>
>>>>>                           lib/xerces.jar,
>>>>>
>>>>>                           lib/xml-apis.jar,
>>>>>
>>>>>                           lib/activation.jar,
>>>>>
>>>>>                           lib/jndi.jar,
>>>>>
>>>>>                   </Bundle-ClassPath>
>>>>>
>>>>>                   <Include-Resource>
>>>>>
>>>>>                           lib=lib
>>>>>
>>>>>                   </Include-Resource>
>>>>>                       <Export-Package>
>>>>>
>>>>>                           
>>>>> org.apache.commons.collections.*;version="3.1",
>>>>>
>>>>>                           org.jdom.*,
>>>>>                       </Export-Package>
>>>>>                       <Import-Package>
>>>>>                         *;resolution:=optional
>>>>>                       </Import-Package>
>>>>>                   </instructions>
>>>>>               </configuration>
>>>>>           </plugin>
>>>>>       </plugins>
>>>>>   </build>
>>>>> </project>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> --- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>>
>>>> -------------------------------------------------------------------
>>>> -- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>>
> 
> 
> 
> ----------------------------------------------------------------------
> --
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
Could the problem be that now I'm trying to wrap a bundle not a jar? Is 
that even possible?

I'd like to keep the soakit.jdom name until this gets resolved, to avoid 
editing <dependencies> in (numerous) dependent poms.

Brad Cox wrote:
> Nope, not the hanging comma. Other ideas?
> 
> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT : 
> Unresolved references to [.] by class(es) on the 
> Bundle-Classpath[Jar:dot]: [JDOMAbout$Info.class, JDOMAbout.class, 
> JDOMAbout$Author.class]
> [ERROR] Error(s) found in bundle configuration
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd">
> 
>     <modelVersion>4.0.0</modelVersion>
> 
>     <groupId>soakit</groupId>
>     <artifactId>soakit.jdom</artifactId>
>     <version>1.0-SNAPSHOT</version>
> 
>     <name>soakit.jdom</name>
>     <description>org.jdom and commons.collections</description>
>     <packaging>bundle</packaging>
> 
>     <parent>
>         <groupId>soakit</groupId>
>         <artifactId>soakit</artifactId>
>         <version>1.0-SNAPSHOT</version>
>     </parent>
> 
>     <dependencies>
>             <dependency>
>                 <!--
>               <groupId>org.jdom</groupId>
>               <artifactId>jdom</artifactId>
>               <version>1.1</version>
>                 -->
>                 <groupId>org.jdom</groupId>
>                 <artifactId>com.springsource.org.jdom</artifactId>
>                 <version>1.0.0</version>
>             </dependency>
>             <dependency>
>                  <groupId>commons-collections</groupId>
>                  <artifactId>commons-collections</artifactId>
>                  <version>3.1</version>
>             </dependency>
>             <!--
>             <dependency>
>                     <groupId>com.sun.xml.bind</groupId>
>                     <artifactId>jaxb-xjc</artifactId>
>                     <version>2.1.6</version>
>             </dependency>
>             <dependency>
>                 <groupId>com.oracle.xml</groupId>
>                 <artifactId>com.springsource.oracle.xml</artifactId>
>                 <version>10.2.0.2</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.sql</groupId>
>                 <artifactId>jdbc-stdext</artifactId>
>                 <version>2.0</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.security</groupId>
>                 <artifactId>jaas</artifactId>
>                 <version>1.0.01</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.security</groupId>
>                 <artifactId>jacc</artifactId>
>                 <version>1.0</version>
>             </dependency>
>             <dependency>
>                 <groupId>javax.activation</groupId>
>                 <artifactId>activation</artifactId>
>                 <version>1.1</version>
>             </dependency>
>             -->
>             <!--
>             <dependency>
>                 <groupId>javax.xml.parsers</groupId>
>                 <artifactId>jaxp-api</artifactId>
>                 <version>1.4</version>
>             </dependency>
>             <dependency>
>                 <groupId>xerces</groupId>
>                 <artifactId>xercesImpl</artifactId>
>                 <version>2.4.0</version>
>             </dependency>
>             <dependency>
>         <groupId>xerces</groupId>
>         <artifactId>xercesImpl</artifactId>
>         <version>2.8.1</version>
>       </dependency>
>             <dependency>
>                 <groupId>org.w3c</groupId>
>                 <artifactId>dom</artifactId>
>                 <version>2.3.0-jaxb-1.0.6</version>
>             </dependency>
>             -->
> <!--
> javax.security.auth.x500
> oracle.xml.parser
> oracle.xml.parser.v2
> org.apache.env
> org.apache.xml.resolver
> org.apache.xml.resolver.readers
> sun.io
> -->
>     </dependencies>
> 
>     <build>
>         <plugins>
>                         <plugin>
>                             <artifactId>maven-compiler-plugin</artifactId>
>                             <configuration>
>                                 <source>1.5</source>
>                                 <target>1.5</target>
>                             </configuration>
>                         </plugin>
>                         <plugin>
>                             <groupId>org.apache.felix</groupId>
>                             <artifactId>maven-scr-plugin</artifactId>
>                         </plugin>
>             <plugin>
>                 <groupId>org.apache.felix</groupId>
>                 <artifactId>maven-bundle-plugin</artifactId>
>                                 <version>1.4.3</version>
>                 <extensions>true</extensions>
>                 <configuration>
>                                         
> <manifestLocation>META-INF</manifestLocation>
>                     <instructions>
>                         <Bundle-Version>${pom.version}</Bundle-Version>
>                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
>                         <Bundle-Vendor>Gestalt</Bundle-Vendor>
> 
> <Bundle-Description>${pom.description}</Bundle-Description>
> 
> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>                                                 
> <Embed-Transitive>true</Embed-Transitive>
>                                              
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>                                                 
> <Embed-Directory>target/dependency</Embed-Directory>
>                                              
> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> 
> 
>                                                 <!--
>                                                 <Bundle-ClassPath>
>                                                     lib/jaxen-core.jar,
>                                                     lib/jaxen-jdom.jar,
>                                                     lib/saxpath.jar,
>                                                     lib/xalan.jar,
>                                                     lib/xerces.jar,
>                                                     lib/xml-apis.jar,
>                                                     lib/activation.jar,
>                                                     lib/jndi.jar,
>                                                 </Bundle-ClassPath>
>                                                 <Include-Resource>
>                                                     lib=lib
>                                                 </Include-Resource>
>                                                 <Import-Bundle>
>                                                     
> com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>                                                 </Import-Bundle>
>                                                 -->
>                         <Export-Package>
>                                                     
> org.apache.commons.collections.*;version="3.1",
>                                                     org.jdom.*
>                         </Export-Package>
>                         <Import-Package>
>                           *;resolution:=optional
>                         </Import-Package>
>                     </instructions>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
> </project>
> 
> 
> Stuart McCulloch wrote:
>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>
>>
>>> Thanks! That reduced it to one stupefying problem. Can you advise?
>>>
>>> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT :
>>> Unresolved references to [.] by class(es) on the 
>>> Bundle-Classpath[Jar:dot]:
>>> [JDOMAbout$Info.class, JDOMAbout.class, JDOMAbout$Author.class]
>>> [ERROR] Error(s) found in bundle configuration
>>>
>>> Here's the changed POM:
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>
>>>    <modelVersion>4.0.0</modelVersion>
>>>
>>>    <groupId>soakit</groupId>
>>>    <artifactId>soakit.jdom</artifactId>
>>>    <version>1.0-SNAPSHOT</version>
>>>
>>>    <name>soakit.jdom</name>
>>>    <description>org.jdom and commons.collections</description>
>>>    <packaging>bundle</packaging>
>>>
>>>    <parent>
>>>        <groupId>soakit</groupId>
>>>        <artifactId>soakit</artifactId>
>>>        <version>1.0-SNAPSHOT</version>
>>>    </parent>
>>>
>>>    <dependencies>
>>>                        <dependency>
>>>                                <!--
>>>                          <groupId>org.jdom</groupId>
>>>                          <artifactId>jdom</artifactId>
>>>                        <version>1.1</version>
>>>                                -->
>>>                                <groupId>org.jdom</groupId>
>>>
>>>  <artifactId>com.springsource.org.jdom</artifactId>
>>>                                <version>1.0.0</version>
>>>
>>>                        </dependency>
>>>                        <dependency>
>>>                                 <groupId>commons-collections</groupId>
>>>
>>> <artifactId>commons-collections</artifactId>
>>>                                 <version>3.1</version>
>>>                        </dependency>
>>>                        <!--
>>>                        <dependency>
>>>                                        
>>> <groupId>com.sun.xml.bind</groupId>
>>>                                        <artifactId>jaxb-xjc</artifactId>
>>>                                        <version>2.1.6</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>com.oracle.xml</groupId>
>>>
>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>                                <version>10.2.0.2</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.sql</groupId>
>>>                                <artifactId>jdbc-stdext</artifactId>
>>>                                <version>2.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.security</groupId>
>>>                                <artifactId>jaas</artifactId>
>>>                                <version>1.0.01</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.security</groupId>
>>>                                <artifactId>jacc</artifactId>
>>>                                <version>1.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>javax.activation</groupId>
>>>                                <artifactId>activation</artifactId>
>>>                                <version>1.1</version>
>>>                        </dependency>
>>>                        -->
>>>                        <!--
>>>                        <dependency>
>>>                                <groupId>javax.xml.parsers</groupId>
>>>                                <artifactId>jaxp-api</artifactId>
>>>                                <version>1.4</version>
>>>                        </dependency>
>>>                        <dependency>
>>>                                <groupId>xerces</groupId>
>>>                                <artifactId>xercesImpl</artifactId>
>>>                                <version>2.4.0</version>
>>>                        </dependency>
>>>                        <dependency>
>>>        <groupId>xerces</groupId>
>>>        <artifactId>xercesImpl</artifactId>
>>>        <version>2.8.1</version>
>>>      </dependency>
>>>                        <dependency>
>>>                                <groupId>org.w3c</groupId>
>>>                                <artifactId>dom</artifactId>
>>>                                <version>2.3.0-jaxb-1.0.6</version>
>>>                        </dependency>
>>>                        -->
>>> <!--
>>> javax.security.auth.x500
>>> oracle.xml.parser
>>> oracle.xml.parser.v2
>>> org.apache.env
>>> org.apache.xml.resolver
>>> org.apache.xml.resolver.readers
>>> sun.io
>>> -->
>>>    </dependencies>
>>>
>>>    <build>
>>>        <plugins>
>>>                                                <plugin>
>>>
>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>                                                        <configuration>
>>>
>>>  <source>1.5</source>
>>>
>>>  <target>1.5</target>
>>>                                                        </configuration>
>>>                                                </plugin>
>>>                                                <plugin>
>>>
>>>  <groupId>org.apache.felix</groupId>
>>>
>>>  <artifactId>maven-scr-plugin</artifactId>
>>>                                                </plugin>
>>>            <plugin>
>>>                <groupId>org.apache.felix</groupId>
>>>                <artifactId>maven-bundle-plugin</artifactId>
>>>
>>>  <version>1.4.3</version>
>>>                <extensions>true</extensions>
>>>                <configuration>
>>>
>>>    <manifestLocation>META-INF</manifestLocation>
>>>                    <instructions>
>>>                        <Bundle-Version>${pom.version}</Bundle-Version>
>>>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>
>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>
>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>
>>>                    <Embed-Transitive>true</Embed-Transitive>
>>>
>>>
>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>>>
>>>                    <Embed-Directory>target/dependency</Embed-Directory>
>>>
>>>
>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> 
>>>
>>>
>>>                    <!--
>>>
>>>                    <Bundle-ClassPath>
>>>
>>>                            lib/jaxen-core.jar,
>>>
>>>                            lib/jaxen-jdom.jar,
>>>
>>>                            lib/saxpath.jar,
>>>
>>>                            lib/xalan.jar,
>>>
>>>                            lib/xerces.jar,
>>>
>>>                            lib/xml-apis.jar,
>>>
>>>                            lib/activation.jar,
>>>
>>>                            lib/jndi.jar,
>>>
>>>                    </Bundle-ClassPath>
>>>
>>>                    <Include-Resource>
>>>
>>>                            lib=lib
>>>
>>>                    </Include-Resource>
>>>
>>>                    -->
>>>
>>>                    <Import-Bundle>
>>>
>>>                            
>>> com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>>>
>>>                    </Import-Bundle>
>>>
>>
>> you don't need "Import-Bundle" as this is a Spring specific header (but
>> having it won't break anything)
>>
>>                        <Export-Package>
>>>                            
>>> org.apache.commons.collections.*;version="3.1",
>>>
>>>                            org.jdom.*,
>>>                        </Export-Package>
>>>
>>
>> the error about "." might be due to the hanging comma after org.jdom.* 
>> ...
>> try removing that comma
>>
>>
>>>                        <Import-Package>
>>>                          *;resolution:=optional
>>>                        </Import-Package>
>>>                    </instructions>
>>>                </configuration>
>>>            </plugin>
>>>        </plugins>
>>>    </build>
>>> </project>
>>>
>>>
>>>
>>> David Bosschaert wrote:
>>>
>>>> Hi Brad,
>>>>
>>>> Have a look at the SpringSource bundle repository. They have a JDom
>>>> jar that is wrapped as a bundle.
>>>> See http://www.springsource.com/repository/app/search?query=jdom
>>>>
>>>> Cheers,
>>>>
>>>> David
>>>>
>>>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>:
>>>>
>>>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>>>
>>>>> I need to use org.jdom in an OSGI application. But it is not (to my
>>>>> knowledge) available as a bundle, just a jar. So I've been trying 
>>>>> to wrap
>>>>> the jar as a bundle; soakit.jdom.
>>>>>
>>>>> The problem then is getting dependent jars into that bundle. All
>>>>> permutations I've tried all wind up in errors like this one. Adding 
>>>>> the
>>>>> unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
>>>>> problem worse; the unresolved references list just grows and grows.
>>>>>
>>>>> I'm using Java 1.5 on MacOSX.
>>>>>
>>>>> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
>>>>> Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
>>>>> javax.xml.transform, javax.xml.transform.sax, 
>>>>> javax.xml.transform.stream,
>>>>> oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
>>>>> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
>>>>> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
>>>>> Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
>>>>> org/jdom/adapters/XercesDOMAdapter.class,
>>>>> org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
>>>>> org/jdom/input/BuilderErrorHandler.class,
>>>>> org/jdom/transform/JDOMResult$FragmentHandler.class,
>>>>> org/jdom/adapters/CrimsonDOMAdapter.class,
>>>>> org/jdom/input/DOMBuilder.class,
>>>>> org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
>>>>> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
>>>>> org/jdom/adapters/DOMAdapter.class,
>>>>> org/jdom/adapters/OracleV1DOMAdapter.class,
>>>>> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
>>>>> org/jdom/output/JDOMLocator.class,
>>>>> org/jdom/transform/JDOMSource$DocumentReader.class,
>>>>> org/jdom/xpath/JaxenXPath$NSContext.class,
>>>>> org/jdom/transform/JDOMSource$JDOMInputSource.class,
>>>>> org/jdom/transform/XSLTransformer.class,
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
>>>>> org/jdom/adapters/JAXPDOMAdapter.class,
>>>>> org/jdom/input/JDOMParseException.class,
>>>>> org/jdom/output/SAXOutputter.class,
>>>>> org/jdom/output/DOMOutputter.class,
>>>>>
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class, 
>>>>>
>>>>> org/jdom/transform/JDOMResult$DocumentBuilder.class,
>>>>> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
>>>>> org/jdom/adapters/AbstractDOMAdapter.class,
>>>>>
>>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class, 
>>>>>
>>>>> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
>>>>> org/jdom/adapters/OracleV2DOMAdapter.class,
>>>>> org/jdom/transform/JDOMSource.class]
>>>>>
>>>>> Here's the pom. The commented sections show various permutations I've
>>>>> tried.
>>>>>
>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>>>
>>>>>   <modelVersion>4.0.0</modelVersion>
>>>>>
>>>>>   <groupId>soakit</groupId>
>>>>>   <artifactId>soakit.jdom</artifactId>
>>>>>   <version>1.0-SNAPSHOT</version>
>>>>>
>>>>>   <name>soakit.jdom</name>
>>>>>   <description>org.jdom and commons.collections</description>
>>>>>   <packaging>bundle</packaging>
>>>>>
>>>>>   <parent>
>>>>>       <groupId>soakit</groupId>
>>>>>       <artifactId>soakit</artifactId>
>>>>>       <version>1.0-SNAPSHOT</version>
>>>>>   </parent>
>>>>>
>>>>>   <dependencies>
>>>>>                       <dependency>
>>>>>                         <groupId>org.jdom</groupId>
>>>>>                         <artifactId>jdom</artifactId>
>>>>>                       <version>1.1</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                                <groupId>commons-collections</groupId>
>>>>>
>>>>>  <artifactId>commons-collections</artifactId>
>>>>>                                <version>3.1</version>
>>>>>                       </dependency>
>>>>>                       <!--
>>>>>                       <dependency>
>>>>>                                       
>>>>> <groupId>com.sun.xml.bind</groupId>
>>>>>                                       
>>>>> <artifactId>jaxb-xjc</artifactId>
>>>>>                                       <version>2.1.6</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>com.oracle.xml</groupId>
>>>>>
>>>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>>>                               <version>10.2.0.2</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.sql</groupId>
>>>>>                               <artifactId>jdbc-stdext</artifactId>
>>>>>                               <version>2.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.security</groupId>
>>>>>                               <artifactId>jaas</artifactId>
>>>>>                               <version>1.0.01</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.security</groupId>
>>>>>                               <artifactId>jacc</artifactId>
>>>>>                               <version>1.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>javax.activation</groupId>
>>>>>                               <artifactId>activation</artifactId>
>>>>>                               <version>1.1</version>
>>>>>                       </dependency>
>>>>>                       -->
>>>>>                       <!--
>>>>>                       <dependency>
>>>>>                               <groupId>javax.xml.parsers</groupId>
>>>>>                               <artifactId>jaxp-api</artifactId>
>>>>>                               <version>1.4</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>xerces</groupId>
>>>>>                               <artifactId>xercesImpl</artifactId>
>>>>>                               <version>2.4.0</version>
>>>>>                       </dependency>
>>>>>                       <dependency>
>>>>>       <groupId>xerces</groupId>
>>>>>       <artifactId>xercesImpl</artifactId>
>>>>>       <version>2.8.1</version>
>>>>>     </dependency>
>>>>>                       <dependency>
>>>>>                               <groupId>org.w3c</groupId>
>>>>>                               <artifactId>dom</artifactId>
>>>>>                               <version>2.3.0-jaxb-1.0.6</version>
>>>>>                       </dependency>
>>>>>                       -->
>>>>> <!--
>>>>> javax.security.auth.x500
>>>>> oracle.xml.parser
>>>>> oracle.xml.parser.v2
>>>>> org.apache.env
>>>>> org.apache.xml.resolver
>>>>> org.apache.xml.resolver.readers
>>>>> sun.io
>>>>> -->
>>>>>   </dependencies>
>>>>>
>>>>>   <build>
>>>>>       <plugins>
>>>>>                                               <plugin>
>>>>>
>>>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>>>                                                       <configuration>
>>>>>
>>>>>  <source>1.5</source>
>>>>>
>>>>>  <target>1.5</target>
>>>>>                                                       </configuration>
>>>>>                                               </plugin>
>>>>>                                               <plugin>
>>>>>
>>>>>  <groupId>org.apache.felix</groupId>
>>>>>
>>>>>  <artifactId>maven-scr-plugin</artifactId>
>>>>>                                               </plugin>
>>>>>           <plugin>
>>>>>               <groupId>org.apache.felix</groupId>
>>>>>               <artifactId>maven-bundle-plugin</artifactId>
>>>>>
>>>>>  <version>1.4.3</version>
>>>>>               <extensions>true</extensions>
>>>>>               <configuration>
>>>>>
>>>>>   <manifestLocation>META-INF</manifestLocation>
>>>>>                   <instructions>
>>>>>                       <Bundle-Version>${pom.version}</Bundle-Version>
>>>>>                       <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>>>                       <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>>>
>>>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>>>
>>>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>>>
>>>>>                   <Embed-Transitive>true</Embed-Transitive>
>>>>>
>>>>>
>>>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency> 
>>>>>
>>>>>
>>>>>                   <Embed-Directory>target/dependency</Embed-Directory>
>>>>>
>>>>>
>>>>>
>>>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> 
>>>>>
>>>>>
>>>>>                   <Bundle-ClassPath>
>>>>>
>>>>>                           lib/jaxen-core.jar,
>>>>>
>>>>>                           lib/jaxen-jdom.jar,
>>>>>
>>>>>                           lib/saxpath.jar,
>>>>>
>>>>>                           lib/xalan.jar,
>>>>>
>>>>>                           lib/xerces.jar,
>>>>>
>>>>>                           lib/xml-apis.jar,
>>>>>
>>>>>                           lib/activation.jar,
>>>>>
>>>>>                           lib/jndi.jar,
>>>>>
>>>>>                   </Bundle-ClassPath>
>>>>>
>>>>>                   <Include-Resource>
>>>>>
>>>>>                           lib=lib
>>>>>
>>>>>                   </Include-Resource>
>>>>>                       <Export-Package>
>>>>>
>>>>>                           
>>>>> org.apache.commons.collections.*;version="3.1",
>>>>>
>>>>>                           org.jdom.*,
>>>>>                       </Export-Package>
>>>>>                       <Import-Package>
>>>>>                         *;resolution:=optional
>>>>>                       </Import-Package>
>>>>>                   </instructions>
>>>>>               </configuration>
>>>>>           </plugin>
>>>>>       </plugins>
>>>>>   </build>
>>>>> </project>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org



Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
Nope, not the hanging comma. Other ideas?

[ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT : 
Unresolved references to [.] by class(es) on the 
Bundle-Classpath[Jar:dot]: [JDOMAbout$Info.class, JDOMAbout.class, 
JDOMAbout$Author.class]
[ERROR] Error(s) found in bundle configuration

<project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">

     <modelVersion>4.0.0</modelVersion>

     <groupId>soakit</groupId>
     <artifactId>soakit.jdom</artifactId>
     <version>1.0-SNAPSHOT</version>

     <name>soakit.jdom</name>
     <description>org.jdom and commons.collections</description>
     <packaging>bundle</packaging>

     <parent>
         <groupId>soakit</groupId>
         <artifactId>soakit</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>

     <dependencies>
			<dependency>
				<!--
			  <groupId>org.jdom</groupId>
			  <artifactId>jdom</artifactId>
   			<version>1.1</version>
				-->
				<groupId>org.jdom</groupId>
				<artifactId>com.springsource.org.jdom</artifactId>
				<version>1.0.0</version>
			</dependency>
			<dependency>
				 <groupId>commons-collections</groupId>
				 <artifactId>commons-collections</artifactId>
				 <version>3.1</version>
			</dependency>
			<!--
			<dependency>
					<groupId>com.sun.xml.bind</groupId>
					<artifactId>jaxb-xjc</artifactId>
					<version>2.1.6</version>
			</dependency>
			<dependency>
				<groupId>com.oracle.xml</groupId>
				<artifactId>com.springsource.oracle.xml</artifactId>
				<version>10.2.0.2</version>
			</dependency>
			<dependency>
				<groupId>javax.sql</groupId>
				<artifactId>jdbc-stdext</artifactId>
				<version>2.0</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jaas</artifactId>
				<version>1.0.01</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jacc</artifactId>
				<version>1.0</version>
			</dependency>
			<dependency>
				<groupId>javax.activation</groupId>
				<artifactId>activation</artifactId>
				<version>1.1</version>
			</dependency>
			-->
			<!--
			<dependency>
				<groupId>javax.xml.parsers</groupId>
				<artifactId>jaxp-api</artifactId>
				<version>1.4</version>
			</dependency>
			<dependency>
				<groupId>xerces</groupId>
				<artifactId>xercesImpl</artifactId>
				<version>2.4.0</version>
			</dependency>
			<dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
         <version>2.8.1</version>
       </dependency>
			<dependency>
				<groupId>org.w3c</groupId>
				<artifactId>dom</artifactId>
				<version>2.3.0-jaxb-1.0.6</version>
			</dependency>
			-->
<!--
javax.security.auth.x500
oracle.xml.parser
oracle.xml.parser.v2
org.apache.env
org.apache.xml.resolver
org.apache.xml.resolver.readers
sun.io
-->
     </dependencies>

     <build>
         <plugins>
						<plugin>
							<artifactId>maven-compiler-plugin</artifactId>
							<configuration>
								<source>1.5</source>
								<target>1.5</target>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.felix</groupId>
							<artifactId>maven-scr-plugin</artifactId>
						</plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
								<version>1.4.3</version>
                 <extensions>true</extensions>
                 <configuration>
										<manifestLocation>META-INF</manifestLocation>
                     <instructions>
                         <Bundle-Version>${pom.version}</Bundle-Version>
                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
                         <Bundle-Vendor>Gestalt</Bundle-Vendor>
 
<Bundle-Description>${pom.description}</Bundle-Description>
 
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
												<Embed-Transitive>true</Embed-Transitive>
											 
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
												<Embed-Directory>target/dependency</Embed-Directory>
											 
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
												<!--
												<Bundle-ClassPath>
													lib/jaxen-core.jar,
													lib/jaxen-jdom.jar,
													lib/saxpath.jar,
													lib/xalan.jar,
													lib/xerces.jar,
													lib/xml-apis.jar,
													lib/activation.jar,
													lib/jndi.jar,
												</Bundle-ClassPath>
												<Include-Resource>
													lib=lib
												</Include-Resource>
												<Import-Bundle>
													com.springsource.org.jdom;version="[1.0.0,1.0.0]"
												</Import-Bundle>
												-->
                         <Export-Package>
													org.apache.commons.collections.*;version="3.1",
													org.jdom.*
                         </Export-Package>
                         <Import-Package>
                           *;resolution:=optional
                         </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
</project>


Stuart McCulloch wrote:
> 2008/10/21 Brad Cox <bc...@virtualschool.edu>
> 
>> Thanks! That reduced it to one stupefying problem. Can you advise?
>>
>> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT :
>> Unresolved references to [.] by class(es) on the Bundle-Classpath[Jar:dot]:
>> [JDOMAbout$Info.class, JDOMAbout.class, JDOMAbout$Author.class]
>> [ERROR] Error(s) found in bundle configuration
>>
>> Here's the changed POM:
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/maven-v4_0_0.xsd">
>>
>>    <modelVersion>4.0.0</modelVersion>
>>
>>    <groupId>soakit</groupId>
>>    <artifactId>soakit.jdom</artifactId>
>>    <version>1.0-SNAPSHOT</version>
>>
>>    <name>soakit.jdom</name>
>>    <description>org.jdom and commons.collections</description>
>>    <packaging>bundle</packaging>
>>
>>    <parent>
>>        <groupId>soakit</groupId>
>>        <artifactId>soakit</artifactId>
>>        <version>1.0-SNAPSHOT</version>
>>    </parent>
>>
>>    <dependencies>
>>                        <dependency>
>>                                <!--
>>                          <groupId>org.jdom</groupId>
>>                          <artifactId>jdom</artifactId>
>>                        <version>1.1</version>
>>                                -->
>>                                <groupId>org.jdom</groupId>
>>
>>  <artifactId>com.springsource.org.jdom</artifactId>
>>                                <version>1.0.0</version>
>>
>>                        </dependency>
>>                        <dependency>
>>                                 <groupId>commons-collections</groupId>
>>
>> <artifactId>commons-collections</artifactId>
>>                                 <version>3.1</version>
>>                        </dependency>
>>                        <!--
>>                        <dependency>
>>                                        <groupId>com.sun.xml.bind</groupId>
>>                                        <artifactId>jaxb-xjc</artifactId>
>>                                        <version>2.1.6</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>com.oracle.xml</groupId>
>>
>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>                                <version>10.2.0.2</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.sql</groupId>
>>                                <artifactId>jdbc-stdext</artifactId>
>>                                <version>2.0</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.security</groupId>
>>                                <artifactId>jaas</artifactId>
>>                                <version>1.0.01</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.security</groupId>
>>                                <artifactId>jacc</artifactId>
>>                                <version>1.0</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.activation</groupId>
>>                                <artifactId>activation</artifactId>
>>                                <version>1.1</version>
>>                        </dependency>
>>                        -->
>>                        <!--
>>                        <dependency>
>>                                <groupId>javax.xml.parsers</groupId>
>>                                <artifactId>jaxp-api</artifactId>
>>                                <version>1.4</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>xerces</groupId>
>>                                <artifactId>xercesImpl</artifactId>
>>                                <version>2.4.0</version>
>>                        </dependency>
>>                        <dependency>
>>        <groupId>xerces</groupId>
>>        <artifactId>xercesImpl</artifactId>
>>        <version>2.8.1</version>
>>      </dependency>
>>                        <dependency>
>>                                <groupId>org.w3c</groupId>
>>                                <artifactId>dom</artifactId>
>>                                <version>2.3.0-jaxb-1.0.6</version>
>>                        </dependency>
>>                        -->
>> <!--
>> javax.security.auth.x500
>> oracle.xml.parser
>> oracle.xml.parser.v2
>> org.apache.env
>> org.apache.xml.resolver
>> org.apache.xml.resolver.readers
>> sun.io
>> -->
>>    </dependencies>
>>
>>    <build>
>>        <plugins>
>>                                                <plugin>
>>
>>  <artifactId>maven-compiler-plugin</artifactId>
>>                                                        <configuration>
>>
>>  <source>1.5</source>
>>
>>  <target>1.5</target>
>>                                                        </configuration>
>>                                                </plugin>
>>                                                <plugin>
>>
>>  <groupId>org.apache.felix</groupId>
>>
>>  <artifactId>maven-scr-plugin</artifactId>
>>                                                </plugin>
>>            <plugin>
>>                <groupId>org.apache.felix</groupId>
>>                <artifactId>maven-bundle-plugin</artifactId>
>>
>>  <version>1.4.3</version>
>>                <extensions>true</extensions>
>>                <configuration>
>>
>>    <manifestLocation>META-INF</manifestLocation>
>>                    <instructions>
>>                        <Bundle-Version>${pom.version}</Bundle-Version>
>>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>
>> <Bundle-Description>${pom.description}</Bundle-Description>
>>
>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>
>>                    <Embed-Transitive>true</Embed-Transitive>
>>
>>
>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>>
>>                    <Embed-Directory>target/dependency</Embed-Directory>
>>
>>
>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>>
>>                    <!--
>>
>>                    <Bundle-ClassPath>
>>
>>                            lib/jaxen-core.jar,
>>
>>                            lib/jaxen-jdom.jar,
>>
>>                            lib/saxpath.jar,
>>
>>                            lib/xalan.jar,
>>
>>                            lib/xerces.jar,
>>
>>                            lib/xml-apis.jar,
>>
>>                            lib/activation.jar,
>>
>>                            lib/jndi.jar,
>>
>>                    </Bundle-ClassPath>
>>
>>                    <Include-Resource>
>>
>>                            lib=lib
>>
>>                    </Include-Resource>
>>
>>                    -->
>>
>>                    <Import-Bundle>
>>
>>                            com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>>
>>                    </Import-Bundle>
>>
> 
> you don't need "Import-Bundle" as this is a Spring specific header (but
> having it won't break anything)
> 
>                        <Export-Package>
>>                            org.apache.commons.collections.*;version="3.1",
>>
>>                            org.jdom.*,
>>                        </Export-Package>
>>
> 
> the error about "." might be due to the hanging comma after org.jdom.* ...
> try removing that comma
> 
> 
>>                        <Import-Package>
>>                          *;resolution:=optional
>>                        </Import-Package>
>>                    </instructions>
>>                </configuration>
>>            </plugin>
>>        </plugins>
>>    </build>
>> </project>
>>
>>
>>
>> David Bosschaert wrote:
>>
>>> Hi Brad,
>>>
>>> Have a look at the SpringSource bundle repository. They have a JDom
>>> jar that is wrapped as a bundle.
>>> See http://www.springsource.com/repository/app/search?query=jdom
>>>
>>> Cheers,
>>>
>>> David
>>>
>>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>:
>>>
>>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>>
>>>> I need to use org.jdom in an OSGI application. But it is not (to my
>>>> knowledge) available as a bundle, just a jar. So I've been trying to wrap
>>>> the jar as a bundle; soakit.jdom.
>>>>
>>>> The problem then is getting dependent jars into that bundle. All
>>>> permutations I've tried all wind up in errors like this one. Adding the
>>>> unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
>>>> problem worse; the unresolved references list just grows and grows.
>>>>
>>>> I'm using Java 1.5 on MacOSX.
>>>>
>>>> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
>>>> Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
>>>> javax.xml.transform, javax.xml.transform.sax, javax.xml.transform.stream,
>>>> oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
>>>> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
>>>> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
>>>> Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
>>>> org/jdom/adapters/XercesDOMAdapter.class,
>>>> org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
>>>> org/jdom/input/BuilderErrorHandler.class,
>>>> org/jdom/transform/JDOMResult$FragmentHandler.class,
>>>> org/jdom/adapters/CrimsonDOMAdapter.class,
>>>> org/jdom/input/DOMBuilder.class,
>>>> org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
>>>> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
>>>> org/jdom/adapters/DOMAdapter.class,
>>>> org/jdom/adapters/OracleV1DOMAdapter.class,
>>>> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
>>>> org/jdom/output/JDOMLocator.class,
>>>> org/jdom/transform/JDOMSource$DocumentReader.class,
>>>> org/jdom/xpath/JaxenXPath$NSContext.class,
>>>> org/jdom/transform/JDOMSource$JDOMInputSource.class,
>>>> org/jdom/transform/XSLTransformer.class,
>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
>>>> org/jdom/adapters/JAXPDOMAdapter.class,
>>>> org/jdom/input/JDOMParseException.class,
>>>> org/jdom/output/SAXOutputter.class,
>>>> org/jdom/output/DOMOutputter.class,
>>>>
>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class,
>>>> org/jdom/transform/JDOMResult$DocumentBuilder.class,
>>>> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
>>>> org/jdom/adapters/AbstractDOMAdapter.class,
>>>>
>>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class,
>>>> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
>>>> org/jdom/adapters/OracleV2DOMAdapter.class,
>>>> org/jdom/transform/JDOMSource.class]
>>>>
>>>> Here's the pom. The commented sections show various permutations I've
>>>> tried.
>>>>
>>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>>
>>>>   <modelVersion>4.0.0</modelVersion>
>>>>
>>>>   <groupId>soakit</groupId>
>>>>   <artifactId>soakit.jdom</artifactId>
>>>>   <version>1.0-SNAPSHOT</version>
>>>>
>>>>   <name>soakit.jdom</name>
>>>>   <description>org.jdom and commons.collections</description>
>>>>   <packaging>bundle</packaging>
>>>>
>>>>   <parent>
>>>>       <groupId>soakit</groupId>
>>>>       <artifactId>soakit</artifactId>
>>>>       <version>1.0-SNAPSHOT</version>
>>>>   </parent>
>>>>
>>>>   <dependencies>
>>>>                       <dependency>
>>>>                         <groupId>org.jdom</groupId>
>>>>                         <artifactId>jdom</artifactId>
>>>>                       <version>1.1</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                                <groupId>commons-collections</groupId>
>>>>
>>>>  <artifactId>commons-collections</artifactId>
>>>>                                <version>3.1</version>
>>>>                       </dependency>
>>>>                       <!--
>>>>                       <dependency>
>>>>                                       <groupId>com.sun.xml.bind</groupId>
>>>>                                       <artifactId>jaxb-xjc</artifactId>
>>>>                                       <version>2.1.6</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>com.oracle.xml</groupId>
>>>>
>>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>>                               <version>10.2.0.2</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>javax.sql</groupId>
>>>>                               <artifactId>jdbc-stdext</artifactId>
>>>>                               <version>2.0</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>javax.security</groupId>
>>>>                               <artifactId>jaas</artifactId>
>>>>                               <version>1.0.01</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>javax.security</groupId>
>>>>                               <artifactId>jacc</artifactId>
>>>>                               <version>1.0</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>javax.activation</groupId>
>>>>                               <artifactId>activation</artifactId>
>>>>                               <version>1.1</version>
>>>>                       </dependency>
>>>>                       -->
>>>>                       <!--
>>>>                       <dependency>
>>>>                               <groupId>javax.xml.parsers</groupId>
>>>>                               <artifactId>jaxp-api</artifactId>
>>>>                               <version>1.4</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>                               <groupId>xerces</groupId>
>>>>                               <artifactId>xercesImpl</artifactId>
>>>>                               <version>2.4.0</version>
>>>>                       </dependency>
>>>>                       <dependency>
>>>>       <groupId>xerces</groupId>
>>>>       <artifactId>xercesImpl</artifactId>
>>>>       <version>2.8.1</version>
>>>>     </dependency>
>>>>                       <dependency>
>>>>                               <groupId>org.w3c</groupId>
>>>>                               <artifactId>dom</artifactId>
>>>>                               <version>2.3.0-jaxb-1.0.6</version>
>>>>                       </dependency>
>>>>                       -->
>>>> <!--
>>>> javax.security.auth.x500
>>>> oracle.xml.parser
>>>> oracle.xml.parser.v2
>>>> org.apache.env
>>>> org.apache.xml.resolver
>>>> org.apache.xml.resolver.readers
>>>> sun.io
>>>> -->
>>>>   </dependencies>
>>>>
>>>>   <build>
>>>>       <plugins>
>>>>                                               <plugin>
>>>>
>>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>>                                                       <configuration>
>>>>
>>>>  <source>1.5</source>
>>>>
>>>>  <target>1.5</target>
>>>>                                                       </configuration>
>>>>                                               </plugin>
>>>>                                               <plugin>
>>>>
>>>>  <groupId>org.apache.felix</groupId>
>>>>
>>>>  <artifactId>maven-scr-plugin</artifactId>
>>>>                                               </plugin>
>>>>           <plugin>
>>>>               <groupId>org.apache.felix</groupId>
>>>>               <artifactId>maven-bundle-plugin</artifactId>
>>>>
>>>>  <version>1.4.3</version>
>>>>               <extensions>true</extensions>
>>>>               <configuration>
>>>>
>>>>   <manifestLocation>META-INF</manifestLocation>
>>>>                   <instructions>
>>>>                       <Bundle-Version>${pom.version}</Bundle-Version>
>>>>                       <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>>                       <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>>
>>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>>
>>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>>
>>>>                   <Embed-Transitive>true</Embed-Transitive>
>>>>
>>>>
>>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>>>>
>>>>                   <Embed-Directory>target/dependency</Embed-Directory>
>>>>
>>>>
>>>>
>>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>>>>
>>>>                   <Bundle-ClassPath>
>>>>
>>>>                           lib/jaxen-core.jar,
>>>>
>>>>                           lib/jaxen-jdom.jar,
>>>>
>>>>                           lib/saxpath.jar,
>>>>
>>>>                           lib/xalan.jar,
>>>>
>>>>                           lib/xerces.jar,
>>>>
>>>>                           lib/xml-apis.jar,
>>>>
>>>>                           lib/activation.jar,
>>>>
>>>>                           lib/jndi.jar,
>>>>
>>>>                   </Bundle-ClassPath>
>>>>
>>>>                   <Include-Resource>
>>>>
>>>>                           lib=lib
>>>>
>>>>                   </Include-Resource>
>>>>                       <Export-Package>
>>>>
>>>>                           org.apache.commons.collections.*;version="3.1",
>>>>
>>>>                           org.jdom.*,
>>>>                       </Export-Package>
>>>>                       <Import-Package>
>>>>                         *;resolution:=optional
>>>>                       </Import-Package>
>>>>                   </instructions>
>>>>               </configuration>
>>>>           </plugin>
>>>>       </plugins>
>>>>   </build>
>>>> </project>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 
> 
> 



Re: JDOM Bundle Problems

Posted by Stuart McCulloch <mc...@gmail.com>.
2008/10/21 Brad Cox <bc...@virtualschool.edu>

> Thanks! That reduced it to one stupefying problem. Can you advise?
>
> [ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT :
> Unresolved references to [.] by class(es) on the Bundle-Classpath[Jar:dot]:
> [JDOMAbout$Info.class, JDOMAbout.class, JDOMAbout$Author.class]
> [ERROR] Error(s) found in bundle configuration
>
> Here's the changed POM:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
>    <modelVersion>4.0.0</modelVersion>
>
>    <groupId>soakit</groupId>
>    <artifactId>soakit.jdom</artifactId>
>    <version>1.0-SNAPSHOT</version>
>
>    <name>soakit.jdom</name>
>    <description>org.jdom and commons.collections</description>
>    <packaging>bundle</packaging>
>
>    <parent>
>        <groupId>soakit</groupId>
>        <artifactId>soakit</artifactId>
>        <version>1.0-SNAPSHOT</version>
>    </parent>
>
>    <dependencies>
>                        <dependency>
>                                <!--
>                          <groupId>org.jdom</groupId>
>                          <artifactId>jdom</artifactId>
>                        <version>1.1</version>
>                                -->
>                                <groupId>org.jdom</groupId>
>
>  <artifactId>com.springsource.org.jdom</artifactId>
>                                <version>1.0.0</version>
>
>                        </dependency>
>                        <dependency>
>                                 <groupId>commons-collections</groupId>
>
> <artifactId>commons-collections</artifactId>
>                                 <version>3.1</version>
>                        </dependency>
>                        <!--
>                        <dependency>
>                                        <groupId>com.sun.xml.bind</groupId>
>                                        <artifactId>jaxb-xjc</artifactId>
>                                        <version>2.1.6</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>com.oracle.xml</groupId>
>
>  <artifactId>com.springsource.oracle.xml</artifactId>
>                                <version>10.2.0.2</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.sql</groupId>
>                                <artifactId>jdbc-stdext</artifactId>
>                                <version>2.0</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.security</groupId>
>                                <artifactId>jaas</artifactId>
>                                <version>1.0.01</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.security</groupId>
>                                <artifactId>jacc</artifactId>
>                                <version>1.0</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.activation</groupId>
>                                <artifactId>activation</artifactId>
>                                <version>1.1</version>
>                        </dependency>
>                        -->
>                        <!--
>                        <dependency>
>                                <groupId>javax.xml.parsers</groupId>
>                                <artifactId>jaxp-api</artifactId>
>                                <version>1.4</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>xerces</groupId>
>                                <artifactId>xercesImpl</artifactId>
>                                <version>2.4.0</version>
>                        </dependency>
>                        <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xercesImpl</artifactId>
>        <version>2.8.1</version>
>      </dependency>
>                        <dependency>
>                                <groupId>org.w3c</groupId>
>                                <artifactId>dom</artifactId>
>                                <version>2.3.0-jaxb-1.0.6</version>
>                        </dependency>
>                        -->
> <!--
> javax.security.auth.x500
> oracle.xml.parser
> oracle.xml.parser.v2
> org.apache.env
> org.apache.xml.resolver
> org.apache.xml.resolver.readers
> sun.io
> -->
>    </dependencies>
>
>    <build>
>        <plugins>
>                                                <plugin>
>
>  <artifactId>maven-compiler-plugin</artifactId>
>                                                        <configuration>
>
>  <source>1.5</source>
>
>  <target>1.5</target>
>                                                        </configuration>
>                                                </plugin>
>                                                <plugin>
>
>  <groupId>org.apache.felix</groupId>
>
>  <artifactId>maven-scr-plugin</artifactId>
>                                                </plugin>
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>
>  <version>1.4.3</version>
>                <extensions>true</extensions>
>                <configuration>
>
>    <manifestLocation>META-INF</manifestLocation>
>                    <instructions>
>                        <Bundle-Version>${pom.version}</Bundle-Version>
>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>
> <Bundle-Description>${pom.description}</Bundle-Description>
>
> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>
>                    <Embed-Transitive>true</Embed-Transitive>
>
>
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>
>                    <Embed-Directory>target/dependency</Embed-Directory>
>
>
> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>
>                    <!--
>
>                    <Bundle-ClassPath>
>
>                            lib/jaxen-core.jar,
>
>                            lib/jaxen-jdom.jar,
>
>                            lib/saxpath.jar,
>
>                            lib/xalan.jar,
>
>                            lib/xerces.jar,
>
>                            lib/xml-apis.jar,
>
>                            lib/activation.jar,
>
>                            lib/jndi.jar,
>
>                    </Bundle-ClassPath>
>
>                    <Include-Resource>
>
>                            lib=lib
>
>                    </Include-Resource>
>
>                    -->
>
>                    <Import-Bundle>
>
>                            com.springsource.org.jdom;version="[1.0.0,1.0.0]"
>
>                    </Import-Bundle>
>

you don't need "Import-Bundle" as this is a Spring specific header (but
having it won't break anything)

                       <Export-Package>
>
>                            org.apache.commons.collections.*;version="3.1",
>
>                            org.jdom.*,
>                        </Export-Package>
>

the error about "." might be due to the hanging comma after org.jdom.* ...
try removing that comma


>                        <Import-Package>
>                          *;resolution:=optional
>                        </Import-Package>
>                    </instructions>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
> </project>
>
>
>
> David Bosschaert wrote:
>
>> Hi Brad,
>>
>> Have a look at the SpringSource bundle repository. They have a JDom
>> jar that is wrapped as a bundle.
>> See http://www.springsource.com/repository/app/search?query=jdom
>>
>> Cheers,
>>
>> David
>>
>> 2008/10/21 Brad Cox <bc...@virtualschool.edu>:
>>
>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>
>>> I need to use org.jdom in an OSGI application. But it is not (to my
>>> knowledge) available as a bundle, just a jar. So I've been trying to wrap
>>> the jar as a bundle; soakit.jdom.
>>>
>>> The problem then is getting dependent jars into that bundle. All
>>> permutations I've tried all wind up in errors like this one. Adding the
>>> unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
>>> problem worse; the unresolved references list just grows and grows.
>>>
>>> I'm using Java 1.5 on MacOSX.
>>>
>>> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
>>> Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
>>> javax.xml.transform, javax.xml.transform.sax, javax.xml.transform.stream,
>>> oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
>>> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
>>> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
>>> Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
>>> org/jdom/adapters/XercesDOMAdapter.class,
>>> org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
>>> org/jdom/input/BuilderErrorHandler.class,
>>> org/jdom/transform/JDOMResult$FragmentHandler.class,
>>> org/jdom/adapters/CrimsonDOMAdapter.class,
>>> org/jdom/input/DOMBuilder.class,
>>> org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
>>> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
>>> org/jdom/adapters/DOMAdapter.class,
>>> org/jdom/adapters/OracleV1DOMAdapter.class,
>>> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
>>> org/jdom/output/JDOMLocator.class,
>>> org/jdom/transform/JDOMSource$DocumentReader.class,
>>> org/jdom/xpath/JaxenXPath$NSContext.class,
>>> org/jdom/transform/JDOMSource$JDOMInputSource.class,
>>> org/jdom/transform/XSLTransformer.class,
>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
>>> org/jdom/adapters/JAXPDOMAdapter.class,
>>> org/jdom/input/JDOMParseException.class,
>>> org/jdom/output/SAXOutputter.class,
>>> org/jdom/output/DOMOutputter.class,
>>>
>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class,
>>> org/jdom/transform/JDOMResult$DocumentBuilder.class,
>>> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
>>> org/jdom/adapters/AbstractDOMAdapter.class,
>>>
>>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class,
>>> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
>>> org/jdom/adapters/OracleV2DOMAdapter.class,
>>> org/jdom/transform/JDOMSource.class]
>>>
>>> Here's the pom. The commented sections show various permutations I've
>>> tried.
>>>
>>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>
>>>   <modelVersion>4.0.0</modelVersion>
>>>
>>>   <groupId>soakit</groupId>
>>>   <artifactId>soakit.jdom</artifactId>
>>>   <version>1.0-SNAPSHOT</version>
>>>
>>>   <name>soakit.jdom</name>
>>>   <description>org.jdom and commons.collections</description>
>>>   <packaging>bundle</packaging>
>>>
>>>   <parent>
>>>       <groupId>soakit</groupId>
>>>       <artifactId>soakit</artifactId>
>>>       <version>1.0-SNAPSHOT</version>
>>>   </parent>
>>>
>>>   <dependencies>
>>>                       <dependency>
>>>                         <groupId>org.jdom</groupId>
>>>                         <artifactId>jdom</artifactId>
>>>                       <version>1.1</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                                <groupId>commons-collections</groupId>
>>>
>>>  <artifactId>commons-collections</artifactId>
>>>                                <version>3.1</version>
>>>                       </dependency>
>>>                       <!--
>>>                       <dependency>
>>>                                       <groupId>com.sun.xml.bind</groupId>
>>>                                       <artifactId>jaxb-xjc</artifactId>
>>>                                       <version>2.1.6</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>com.oracle.xml</groupId>
>>>
>>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>>                               <version>10.2.0.2</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>javax.sql</groupId>
>>>                               <artifactId>jdbc-stdext</artifactId>
>>>                               <version>2.0</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>javax.security</groupId>
>>>                               <artifactId>jaas</artifactId>
>>>                               <version>1.0.01</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>javax.security</groupId>
>>>                               <artifactId>jacc</artifactId>
>>>                               <version>1.0</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>javax.activation</groupId>
>>>                               <artifactId>activation</artifactId>
>>>                               <version>1.1</version>
>>>                       </dependency>
>>>                       -->
>>>                       <!--
>>>                       <dependency>
>>>                               <groupId>javax.xml.parsers</groupId>
>>>                               <artifactId>jaxp-api</artifactId>
>>>                               <version>1.4</version>
>>>                       </dependency>
>>>                       <dependency>
>>>                               <groupId>xerces</groupId>
>>>                               <artifactId>xercesImpl</artifactId>
>>>                               <version>2.4.0</version>
>>>                       </dependency>
>>>                       <dependency>
>>>       <groupId>xerces</groupId>
>>>       <artifactId>xercesImpl</artifactId>
>>>       <version>2.8.1</version>
>>>     </dependency>
>>>                       <dependency>
>>>                               <groupId>org.w3c</groupId>
>>>                               <artifactId>dom</artifactId>
>>>                               <version>2.3.0-jaxb-1.0.6</version>
>>>                       </dependency>
>>>                       -->
>>> <!--
>>> javax.security.auth.x500
>>> oracle.xml.parser
>>> oracle.xml.parser.v2
>>> org.apache.env
>>> org.apache.xml.resolver
>>> org.apache.xml.resolver.readers
>>> sun.io
>>> -->
>>>   </dependencies>
>>>
>>>   <build>
>>>       <plugins>
>>>                                               <plugin>
>>>
>>>  <artifactId>maven-compiler-plugin</artifactId>
>>>                                                       <configuration>
>>>
>>>  <source>1.5</source>
>>>
>>>  <target>1.5</target>
>>>                                                       </configuration>
>>>                                               </plugin>
>>>                                               <plugin>
>>>
>>>  <groupId>org.apache.felix</groupId>
>>>
>>>  <artifactId>maven-scr-plugin</artifactId>
>>>                                               </plugin>
>>>           <plugin>
>>>               <groupId>org.apache.felix</groupId>
>>>               <artifactId>maven-bundle-plugin</artifactId>
>>>
>>>  <version>1.4.3</version>
>>>               <extensions>true</extensions>
>>>               <configuration>
>>>
>>>   <manifestLocation>META-INF</manifestLocation>
>>>                   <instructions>
>>>                       <Bundle-Version>${pom.version}</Bundle-Version>
>>>                       <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>>                       <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>>
>>> <Bundle-Description>${pom.description}</Bundle-Description>
>>>
>>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>>
>>>                   <Embed-Transitive>true</Embed-Transitive>
>>>
>>>
>>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>>>
>>>                   <Embed-Directory>target/dependency</Embed-Directory>
>>>
>>>
>>>
>>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>>>
>>>                   <Bundle-ClassPath>
>>>
>>>                           lib/jaxen-core.jar,
>>>
>>>                           lib/jaxen-jdom.jar,
>>>
>>>                           lib/saxpath.jar,
>>>
>>>                           lib/xalan.jar,
>>>
>>>                           lib/xerces.jar,
>>>
>>>                           lib/xml-apis.jar,
>>>
>>>                           lib/activation.jar,
>>>
>>>                           lib/jndi.jar,
>>>
>>>                   </Bundle-ClassPath>
>>>
>>>                   <Include-Resource>
>>>
>>>                           lib=lib
>>>
>>>                   </Include-Resource>
>>>                       <Export-Package>
>>>
>>>                           org.apache.commons.collections.*;version="3.1",
>>>
>>>                           org.jdom.*,
>>>                       </Export-Package>
>>>                       <Import-Package>
>>>                         *;resolution:=optional
>>>                       </Import-Package>
>>>                   </instructions>
>>>               </configuration>
>>>           </plugin>
>>>       </plugins>
>>>   </build>
>>> </project>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>



-- 
Cheers, Stuart

Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
Thanks! That reduced it to one stupefying problem. Can you advise?

[ERROR] Error building bundle soakit:soakit.jdom:bundle:1.0-SNAPSHOT : 
Unresolved references to [.] by class(es) on the 
Bundle-Classpath[Jar:dot]: [JDOMAbout$Info.class, JDOMAbout.class, 
JDOMAbout$Author.class]
[ERROR] Error(s) found in bundle configuration

Here's the changed POM:

<project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">

     <modelVersion>4.0.0</modelVersion>

     <groupId>soakit</groupId>
     <artifactId>soakit.jdom</artifactId>
     <version>1.0-SNAPSHOT</version>

     <name>soakit.jdom</name>
     <description>org.jdom and commons.collections</description>
     <packaging>bundle</packaging>

     <parent>
         <groupId>soakit</groupId>
         <artifactId>soakit</artifactId>
         <version>1.0-SNAPSHOT</version>
     </parent>

     <dependencies>
			<dependency>
				<!--
			  <groupId>org.jdom</groupId>
			  <artifactId>jdom</artifactId>
   			<version>1.1</version>
				-->
				<groupId>org.jdom</groupId>
				<artifactId>com.springsource.org.jdom</artifactId>
				<version>1.0.0</version>
			</dependency>
			<dependency>
				 <groupId>commons-collections</groupId>
				 <artifactId>commons-collections</artifactId>
				 <version>3.1</version>
			</dependency>
			<!--
			<dependency>
					<groupId>com.sun.xml.bind</groupId>
					<artifactId>jaxb-xjc</artifactId>
					<version>2.1.6</version>
			</dependency>
			<dependency>
				<groupId>com.oracle.xml</groupId>
				<artifactId>com.springsource.oracle.xml</artifactId>
				<version>10.2.0.2</version>
			</dependency>
			<dependency>
				<groupId>javax.sql</groupId>
				<artifactId>jdbc-stdext</artifactId>
				<version>2.0</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jaas</artifactId>
				<version>1.0.01</version>
			</dependency>
			<dependency>
				<groupId>javax.security</groupId>
				<artifactId>jacc</artifactId>
				<version>1.0</version>
			</dependency>
			<dependency>
				<groupId>javax.activation</groupId>
				<artifactId>activation</artifactId>
				<version>1.1</version>
			</dependency>
			-->
			<!--
			<dependency>
				<groupId>javax.xml.parsers</groupId>
				<artifactId>jaxp-api</artifactId>
				<version>1.4</version>
			</dependency>
			<dependency>
				<groupId>xerces</groupId>
				<artifactId>xercesImpl</artifactId>
				<version>2.4.0</version>
			</dependency>
			<dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
         <version>2.8.1</version>
       </dependency>
			<dependency>
				<groupId>org.w3c</groupId>
				<artifactId>dom</artifactId>
				<version>2.3.0-jaxb-1.0.6</version>
			</dependency>
			-->
<!--
javax.security.auth.x500
oracle.xml.parser
oracle.xml.parser.v2
org.apache.env
org.apache.xml.resolver
org.apache.xml.resolver.readers
sun.io
-->
     </dependencies>

     <build>
         <plugins>
						<plugin>
							<artifactId>maven-compiler-plugin</artifactId>
							<configuration>
								<source>1.5</source>
								<target>1.5</target>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.felix</groupId>
							<artifactId>maven-scr-plugin</artifactId>
						</plugin>
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
								<version>1.4.3</version>
                 <extensions>true</extensions>
                 <configuration>
										<manifestLocation>META-INF</manifestLocation>
                     <instructions>
                         <Bundle-Version>${pom.version}</Bundle-Version>
                         <Bundle-Name>${pom.artifactId}</Bundle-Name>
                         <Bundle-Vendor>Gestalt</Bundle-Vendor>
 
<Bundle-Description>${pom.description}</Bundle-Description>
 
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
												<Embed-Transitive>true</Embed-Transitive>
											 
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
												<Embed-Directory>target/dependency</Embed-Directory>
											 
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
												<!--
												<Bundle-ClassPath>
													lib/jaxen-core.jar,
													lib/jaxen-jdom.jar,
													lib/saxpath.jar,
													lib/xalan.jar,
													lib/xerces.jar,
													lib/xml-apis.jar,
													lib/activation.jar,
													lib/jndi.jar,
												</Bundle-ClassPath>
												<Include-Resource>
													lib=lib
												</Include-Resource>
												-->
												<Import-Bundle>
													com.springsource.org.jdom;version="[1.0.0,1.0.0]"
												</Import-Bundle>
                         <Export-Package>
													org.apache.commons.collections.*;version="3.1",
													org.jdom.*,
                         </Export-Package>
                         <Import-Package>
                           *;resolution:=optional
                         </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
</project>



David Bosschaert wrote:
> Hi Brad,
> 
> Have a look at the SpringSource bundle repository. They have a JDom
> jar that is wrapped as a bundle.
> See http://www.springsource.com/repository/app/search?query=jdom
> 
> Cheers,
> 
> David
> 
> 2008/10/21 Brad Cox <bc...@virtualschool.edu>:
>> Surely such a simple problem can't be so difficult. Can someone help?
>>
>> I need to use org.jdom in an OSGI application. But it is not (to my
>> knowledge) available as a bundle, just a jar. So I've been trying to wrap
>> the jar as a bundle; soakit.jdom.
>>
>> The problem then is getting dependent jars into that bundle. All
>> permutations I've tried all wind up in errors like this one. Adding the
>> unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
>> problem worse; the unresolved references list just grows and grows.
>>
>> I'm using Java 1.5 on MacOSX.
>>
>> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
>> Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
>> javax.xml.transform, javax.xml.transform.sax, javax.xml.transform.stream,
>> oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
>> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
>> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
>> Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
>> org/jdom/adapters/XercesDOMAdapter.class,
>> org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
>> org/jdom/input/BuilderErrorHandler.class,
>> org/jdom/transform/JDOMResult$FragmentHandler.class,
>> org/jdom/adapters/CrimsonDOMAdapter.class, org/jdom/input/DOMBuilder.class,
>> org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
>> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
>> org/jdom/adapters/DOMAdapter.class,
>> org/jdom/adapters/OracleV1DOMAdapter.class,
>> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
>> org/jdom/output/JDOMLocator.class,
>> org/jdom/transform/JDOMSource$DocumentReader.class,
>> org/jdom/xpath/JaxenXPath$NSContext.class,
>> org/jdom/transform/JDOMSource$JDOMInputSource.class,
>> org/jdom/transform/XSLTransformer.class,
>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
>> org/jdom/adapters/JAXPDOMAdapter.class,
>> org/jdom/input/JDOMParseException.class, org/jdom/output/SAXOutputter.class,
>> org/jdom/output/DOMOutputter.class,
>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class,
>> org/jdom/transform/JDOMResult$DocumentBuilder.class,
>> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
>> org/jdom/adapters/AbstractDOMAdapter.class,
>> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class,
>> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
>> org/jdom/adapters/OracleV2DOMAdapter.class,
>> org/jdom/transform/JDOMSource.class]
>>
>> Here's the pom. The commented sections show various permutations I've tried.
>>
>> <project xmlns="http://maven.apache.org/POM/4.0.0"
>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>> http://maven.apache.org/maven-v4_0_0.xsd">
>>
>>    <modelVersion>4.0.0</modelVersion>
>>
>>    <groupId>soakit</groupId>
>>    <artifactId>soakit.jdom</artifactId>
>>    <version>1.0-SNAPSHOT</version>
>>
>>    <name>soakit.jdom</name>
>>    <description>org.jdom and commons.collections</description>
>>    <packaging>bundle</packaging>
>>
>>    <parent>
>>        <groupId>soakit</groupId>
>>        <artifactId>soakit</artifactId>
>>        <version>1.0-SNAPSHOT</version>
>>    </parent>
>>
>>    <dependencies>
>>                        <dependency>
>>                          <groupId>org.jdom</groupId>
>>                          <artifactId>jdom</artifactId>
>>                        <version>1.1</version>
>>                        </dependency>
>>                        <dependency>
>>                                 <groupId>commons-collections</groupId>
>>                                 <artifactId>commons-collections</artifactId>
>>                                 <version>3.1</version>
>>                        </dependency>
>>                        <!--
>>                        <dependency>
>>                                        <groupId>com.sun.xml.bind</groupId>
>>                                        <artifactId>jaxb-xjc</artifactId>
>>                                        <version>2.1.6</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>com.oracle.xml</groupId>
>>
>>  <artifactId>com.springsource.oracle.xml</artifactId>
>>                                <version>10.2.0.2</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.sql</groupId>
>>                                <artifactId>jdbc-stdext</artifactId>
>>                                <version>2.0</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.security</groupId>
>>                                <artifactId>jaas</artifactId>
>>                                <version>1.0.01</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.security</groupId>
>>                                <artifactId>jacc</artifactId>
>>                                <version>1.0</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>javax.activation</groupId>
>>                                <artifactId>activation</artifactId>
>>                                <version>1.1</version>
>>                        </dependency>
>>                        -->
>>                        <!--
>>                        <dependency>
>>                                <groupId>javax.xml.parsers</groupId>
>>                                <artifactId>jaxp-api</artifactId>
>>                                <version>1.4</version>
>>                        </dependency>
>>                        <dependency>
>>                                <groupId>xerces</groupId>
>>                                <artifactId>xercesImpl</artifactId>
>>                                <version>2.4.0</version>
>>                        </dependency>
>>                        <dependency>
>>        <groupId>xerces</groupId>
>>        <artifactId>xercesImpl</artifactId>
>>        <version>2.8.1</version>
>>      </dependency>
>>                        <dependency>
>>                                <groupId>org.w3c</groupId>
>>                                <artifactId>dom</artifactId>
>>                                <version>2.3.0-jaxb-1.0.6</version>
>>                        </dependency>
>>                        -->
>> <!--
>> javax.security.auth.x500
>> oracle.xml.parser
>> oracle.xml.parser.v2
>> org.apache.env
>> org.apache.xml.resolver
>> org.apache.xml.resolver.readers
>> sun.io
>> -->
>>    </dependencies>
>>
>>    <build>
>>        <plugins>
>>                                                <plugin>
>>
>>  <artifactId>maven-compiler-plugin</artifactId>
>>                                                        <configuration>
>>
>>  <source>1.5</source>
>>
>>  <target>1.5</target>
>>                                                        </configuration>
>>                                                </plugin>
>>                                                <plugin>
>>
>>  <groupId>org.apache.felix</groupId>
>>
>>  <artifactId>maven-scr-plugin</artifactId>
>>                                                </plugin>
>>            <plugin>
>>                <groupId>org.apache.felix</groupId>
>>                <artifactId>maven-bundle-plugin</artifactId>
>>
>>  <version>1.4.3</version>
>>                <extensions>true</extensions>
>>                <configuration>
>>
>>    <manifestLocation>META-INF</manifestLocation>
>>                    <instructions>
>>                        <Bundle-Version>${pom.version}</Bundle-Version>
>>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>>
>> <Bundle-Description>${pom.description}</Bundle-Description>
>>
>> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>>
>>                    <Embed-Transitive>true</Embed-Transitive>
>>
>>
>> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>>
>>                    <Embed-Directory>target/dependency</Embed-Directory>
>>
>>
>> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>>
>>                    <Bundle-ClassPath>
>>
>>                            lib/jaxen-core.jar,
>>
>>                            lib/jaxen-jdom.jar,
>>
>>                            lib/saxpath.jar,
>>
>>                            lib/xalan.jar,
>>
>>                            lib/xerces.jar,
>>
>>                            lib/xml-apis.jar,
>>
>>                            lib/activation.jar,
>>
>>                            lib/jndi.jar,
>>
>>                    </Bundle-ClassPath>
>>
>>                    <Include-Resource>
>>
>>                            lib=lib
>>
>>                    </Include-Resource>
>>                        <Export-Package>
>>
>>                            org.apache.commons.collections.*;version="3.1",
>>
>>                            org.jdom.*,
>>                        </Export-Package>
>>                        <Import-Package>
>>                          *;resolution:=optional
>>                        </Import-Package>
>>                    </instructions>
>>                </configuration>
>>            </plugin>
>>        </plugins>
>>    </build>
>> </project>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 



Re: JDOM Bundle Problems

Posted by David Bosschaert <da...@gmail.com>.
Hi Brad,

Have a look at the SpringSource bundle repository. They have a JDom
jar that is wrapped as a bundle.
See http://www.springsource.com/repository/app/search?query=jdom

Cheers,

David

2008/10/21 Brad Cox <bc...@virtualschool.edu>:
> Surely such a simple problem can't be so difficult. Can someone help?
>
> I need to use org.jdom in an OSGI application. But it is not (to my
> knowledge) available as a bundle, just a jar. So I've been trying to wrap
> the jar as a bundle; soakit.jdom.
>
> The problem then is getting dependent jars into that bundle. All
> permutations I've tried all wind up in errors like this one. Adding the
> unresolved ones (oracle, javax, jaxen, etc) to the lib just makes the
> problem worse; the unresolved references list just grows and grows.
>
> I'm using Java 1.5 on MacOSX.
>
> [ERROR] Error building bundle soakit:soakit.core:bundle:1.0-SNAPSHOT :
> Unresolved references to [javax.security.auth.x500, javax.xml.parsers,
> javax.xml.transform, javax.xml.transform.sax, javax.xml.transform.stream,
> oracle.xml.parser, oracle.xml.parser.v2, org.apache.xerces.dom,
> org.apache.xerces.parsers, org.jaxen, org.jaxen.jdom, org.w3c.dom,
> org.xml.sax, org.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
> Bundle-Classpath[Jar:dot]: [org/jdom/adapters/XML4JDOMAdapter.class,
> org/jdom/adapters/XercesDOMAdapter.class,
> org/jdom/transform/JDOMResult.class, org/jdom/xpath/JaxenXPath.class,
> org/jdom/input/BuilderErrorHandler.class,
> org/jdom/transform/JDOMResult$FragmentHandler.class,
> org/jdom/adapters/CrimsonDOMAdapter.class, org/jdom/input/DOMBuilder.class,
> org/jdom/JDOMException.class, org/jdom/input/JAXPParserFactory.class,
> org/eclipse/osgi/internal/signedcontent/PKCS7Processor.class,
> org/jdom/adapters/DOMAdapter.class,
> org/jdom/adapters/OracleV1DOMAdapter.class,
> org/eclipse/core/runtime/internal/adaptor/PluginParser.class,
> org/jdom/output/JDOMLocator.class,
> org/jdom/transform/JDOMSource$DocumentReader.class,
> org/jdom/xpath/JaxenXPath$NSContext.class,
> org/jdom/transform/JDOMSource$JDOMInputSource.class,
> org/jdom/transform/XSLTransformer.class,
> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.class,
> org/jdom/adapters/JAXPDOMAdapter.class,
> org/jdom/input/JDOMParseException.class, org/jdom/output/SAXOutputter.class,
> org/jdom/output/DOMOutputter.class,
> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$DomParsingService.class,
> org/jdom/transform/JDOMResult$DocumentBuilder.class,
> org/jdom/input/SAXBuilder.class, org/jdom/input/SAXHandler.class,
> org/jdom/adapters/AbstractDOMAdapter.class,
> org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook$SaxParsingService.class,
> org/eclipse/osgi/internal/signedcontent/DNChainMatching.class,
> org/jdom/adapters/OracleV2DOMAdapter.class,
> org/jdom/transform/JDOMSource.class]
>
> Here's the pom. The commented sections show various permutations I've tried.
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>
>    <modelVersion>4.0.0</modelVersion>
>
>    <groupId>soakit</groupId>
>    <artifactId>soakit.jdom</artifactId>
>    <version>1.0-SNAPSHOT</version>
>
>    <name>soakit.jdom</name>
>    <description>org.jdom and commons.collections</description>
>    <packaging>bundle</packaging>
>
>    <parent>
>        <groupId>soakit</groupId>
>        <artifactId>soakit</artifactId>
>        <version>1.0-SNAPSHOT</version>
>    </parent>
>
>    <dependencies>
>                        <dependency>
>                          <groupId>org.jdom</groupId>
>                          <artifactId>jdom</artifactId>
>                        <version>1.1</version>
>                        </dependency>
>                        <dependency>
>                                 <groupId>commons-collections</groupId>
>                                 <artifactId>commons-collections</artifactId>
>                                 <version>3.1</version>
>                        </dependency>
>                        <!--
>                        <dependency>
>                                        <groupId>com.sun.xml.bind</groupId>
>                                        <artifactId>jaxb-xjc</artifactId>
>                                        <version>2.1.6</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>com.oracle.xml</groupId>
>
>  <artifactId>com.springsource.oracle.xml</artifactId>
>                                <version>10.2.0.2</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.sql</groupId>
>                                <artifactId>jdbc-stdext</artifactId>
>                                <version>2.0</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.security</groupId>
>                                <artifactId>jaas</artifactId>
>                                <version>1.0.01</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.security</groupId>
>                                <artifactId>jacc</artifactId>
>                                <version>1.0</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>javax.activation</groupId>
>                                <artifactId>activation</artifactId>
>                                <version>1.1</version>
>                        </dependency>
>                        -->
>                        <!--
>                        <dependency>
>                                <groupId>javax.xml.parsers</groupId>
>                                <artifactId>jaxp-api</artifactId>
>                                <version>1.4</version>
>                        </dependency>
>                        <dependency>
>                                <groupId>xerces</groupId>
>                                <artifactId>xercesImpl</artifactId>
>                                <version>2.4.0</version>
>                        </dependency>
>                        <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xercesImpl</artifactId>
>        <version>2.8.1</version>
>      </dependency>
>                        <dependency>
>                                <groupId>org.w3c</groupId>
>                                <artifactId>dom</artifactId>
>                                <version>2.3.0-jaxb-1.0.6</version>
>                        </dependency>
>                        -->
> <!--
> javax.security.auth.x500
> oracle.xml.parser
> oracle.xml.parser.v2
> org.apache.env
> org.apache.xml.resolver
> org.apache.xml.resolver.readers
> sun.io
> -->
>    </dependencies>
>
>    <build>
>        <plugins>
>                                                <plugin>
>
>  <artifactId>maven-compiler-plugin</artifactId>
>                                                        <configuration>
>
>  <source>1.5</source>
>
>  <target>1.5</target>
>                                                        </configuration>
>                                                </plugin>
>                                                <plugin>
>
>  <groupId>org.apache.felix</groupId>
>
>  <artifactId>maven-scr-plugin</artifactId>
>                                                </plugin>
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>
>  <version>1.4.3</version>
>                <extensions>true</extensions>
>                <configuration>
>
>    <manifestLocation>META-INF</manifestLocation>
>                    <instructions>
>                        <Bundle-Version>${pom.version}</Bundle-Version>
>                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
>                        <Bundle-Vendor>Gestalt</Bundle-Vendor>
>
> <Bundle-Description>${pom.description}</Bundle-Description>
>
> <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
>
>                    <Embed-Transitive>true</Embed-Transitive>
>
>
> <Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
>
>                    <Embed-Directory>target/dependency</Embed-Directory>
>
>
> <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
>
>                    <Bundle-ClassPath>
>
>                            lib/jaxen-core.jar,
>
>                            lib/jaxen-jdom.jar,
>
>                            lib/saxpath.jar,
>
>                            lib/xalan.jar,
>
>                            lib/xerces.jar,
>
>                            lib/xml-apis.jar,
>
>                            lib/activation.jar,
>
>                            lib/jndi.jar,
>
>                    </Bundle-ClassPath>
>
>                    <Include-Resource>
>
>                            lib=lib
>
>                    </Include-Resource>
>                        <Export-Package>
>
>                            org.apache.commons.collections.*;version="3.1",
>
>                            org.jdom.*,
>                        </Export-Package>
>                        <Import-Package>
>                          *;resolution:=optional
>                        </Import-Package>
>                    </instructions>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
> </project>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Composites, Components, POJOs; oh my!

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

> -----Original Message-----
> From: Brad Cox [mailto:bcox@virtualschool.edu]
> Sent: dimanche 23 novembre 2008 19:50
> To: users@felix.apache.org
> Subject: Composites, Components, POJOs; oh my!
> 
> The problem now is; nothing's happening. How do I tell what's going on?
> I've got printouts scattered in obvious places but none are getting
> triggered; for example:
> 
> public class TestServiceImpl implements ServiceFactory {
> 	private BundleContext context;
> 	private Properties properties;
> 
> 	public TestServiceImpl(BundleContext context, Properties
> properties)
> 	{
> 		System.err.println("new TestServiceImpl(c, p)");
> 		log.info("new TestServiceImpl(..,..)");
> 		this.context = context;
> 		this.properties = properties;
> 	}
> ...
> 

Is this class expect to be an iPOJO powered components ? In this case, there
is an issue. iPOJO supports two types of constructor: empty one (no
argument), or with a bundle context (BundleContext bc).

Moreover, to be sure that you POJO objects are created, set your component
to 'immediate' (add immediate="true" in your <component> tag). Indeed if
your component provides services, POJO objects will be created only if the
service is used.


> I'm guessing they're all waiting on some prerequisite to start but I
> don't have a clue as to what. Suspecting a metadata.xml problem.
> Struggled to understand the ipojo documentation but its just not
> connecting for me.
> 
> What I'm trying to do build a software bus (soakit.core), several
> software cards (soakit.ports and soakit.transforms), and a test case
> (soakit.test). The metadata.xml files are:
> 
> soakit.core
> <ipojo>
> 	<component
> classname="com.gestalt.soakit.core.internal.CoreServiceImpl">
> 		<provides/>
> 	</component>
> 	<instance
> component="com.gestalt.soakit.core.internal.CoreServiceImpl"/>
> </ipojo>
> 
> soakit.transform.identity (one of the cards):
> <ipojo>
> 	<component
> classname="com.gestalt.soakit.transform.identity.internals.IdentityTran
> sformServiceImpl">
> 		<provides/>
> 	</component>
> 	<instance
> component="com.gestalt.soakit.transform.identity.internals.IdentityTran
> sformServiceImpl"/>
> </ipojo>
> 
> soakit.test:
> <ipojo>
> 	<composite name="soakit.test">
> 		<instance component="com.gestalt.soakit.core"/>
> 		<instance component="com.gestalt.soakit.port.file"/>
> 		<instance component="com.gestalt.soakit.port.http"/>
> 		<instance component="com.gestalt.soakit.port.jms"/>
> 		<instance
> component="com.gestalt.soakit.transform.identity"/>
> 		<instance component="com.gestalt.soakit.transform.log"/>
> 		<instance component="com.gestalt.soakit.transform.pep"/>
> 		<instance component="com.gestalt.soakit.transform.xsl"/>
> 	</composite>
> 	<instance component="soakit.test"/>
> </ipojo>

You do'nt reuse component type that you declare previously
(com.gestalt.soakit.transform.identity.internals.IdentityTransformServiceImp
l and com.gestalt.soakit.core.internal.CoreServiceImpl). Is it the expected
composition?

If you want to reuse the same one, you should avoid creating instances of
component types sued in you're the composite.
(<instance component="com.gestalt.soakit.core.internal.CoreServiceImpl"/>)


So, a last advice, if you use Felix, you should try the 'arch' command
(http://felix.apache.org/site/architecture-handler.html), that will give you
the structure of your system. 
Install and start the arch command (from the Felix download page).
Then list created instances (arch), and get info on them (arch -instance
instance_name).

If some instances are invalid, it means that services dependencies are not
satisfied (the failing dependency is contained in the instance description
given by the arch command).

If instances are not created, then check factories (i.e. component type):
arch -factories


Hope this help,

Regards,

Clement 



> 
> Can someone help me dig out of the weeds with the declarations? Any
> tips for diagnosing WTF is going on would be helpful too. Its
> discouraging that even basic System.err.println() doesn't help.
> 
> 
> 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Composites, Components, POJOs; oh my!

Posted by Brad Cox <bc...@virtualschool.edu>.
Woot! Moved another notch further down the line in my osgi saga, but 
immediately went right into the weeds again:

-> ps
START LEVEL 1
    ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.4.0)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.1)
[   4] [Active     ] [    1] aQute.fileinstall (1.0)
[   5] [Active     ] [    1] osgi (4.0)
[   6] [Active     ] [    1] iPOJO (1.0.0)
[   8] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
[   9] [Active     ] [    1] soakit.transform.identity (1.0.0.SNAPSHOT)
[  10] [Active     ] [    1] soakit.port.file (1.0.0.SNAPSHOT)
[  11] [Active     ] [    1] soakit.port.http (1.0.0.SNAPSHOT)
[  12] [Active     ] [    1] soakit.port.jms (1.0.0.SNAPSHOT)
[  13] [Active     ] [    1] soakit.transform.log (1.0.0.SNAPSHOT)
[  14] [Active     ] [    1] soakit.transform.pep (1.0.0.SNAPSHOT)
[  15] [Active     ] [    1] soakit.transform.xsl (1.0.0.SNAPSHOT)
[  16] [Active     ] [    1] soakit.test (1.0.0.SNAPSHOT)

The trick to my ClassNotFoundException problem was to add 
<scope>provided</scope> to my parent pom. Who'd have thought it?

<dependencies>
	<dependency>
		<groupId>org.apache.felix</groupId>
		<artifactId>org.apache.felix.framework</artifactId>
		<version>1.4.0</version>
		<scope>provided</scope>
	</dependency>
</dependencies>

The problem now is; nothing's happening. How do I tell what's going on? 
I've got printouts scattered in obvious places but none are getting 
triggered; for example:

public class TestServiceImpl implements ServiceFactory
{
	private BundleContext context;
	private Properties properties;
	
	public TestServiceImpl(BundleContext context, Properties properties)
	{
		System.err.println("new TestServiceImpl(c, p)");
		log.info("new TestServiceImpl(..,..)");
		this.context = context;
		this.properties = properties;
	}
...

I'm guessing they're all waiting on some prerequisite to start but I 
don't have a clue as to what. Suspecting a metadata.xml problem. 
Struggled to understand the ipojo documentation but its just not 
connecting for me.

What I'm trying to do build a software bus (soakit.core), several 
software cards (soakit.ports and soakit.transforms), and a test case 
(soakit.test). The metadata.xml files are:

soakit.core
<ipojo>
	<component classname="com.gestalt.soakit.core.internal.CoreServiceImpl">
		<provides/>
	</component>
	<instance component="com.gestalt.soakit.core.internal.CoreServiceImpl"/>
</ipojo>

soakit.transform.identity (one of the cards):
<ipojo>
	<component 
classname="com.gestalt.soakit.transform.identity.internals.IdentityTransformServiceImpl">
		<provides/>
	</component>
	<instance 
component="com.gestalt.soakit.transform.identity.internals.IdentityTransformServiceImpl"/>
</ipojo>

soakit.test:
<ipojo>
	<composite name="soakit.test">
		<instance component="com.gestalt.soakit.core"/>
		<instance component="com.gestalt.soakit.port.file"/>
		<instance component="com.gestalt.soakit.port.http"/>
		<instance component="com.gestalt.soakit.port.jms"/>
		<instance component="com.gestalt.soakit.transform.identity"/>
		<instance component="com.gestalt.soakit.transform.log"/>
		<instance component="com.gestalt.soakit.transform.pep"/>
		<instance component="com.gestalt.soakit.transform.xsl"/>
	</composite>
	<instance component="soakit.test"/>
</ipojo>

Can someone help me dig out of the weeds with the declarations? Any tips 
for diagnosing WTF is going on would be helpful too. Its discouraging 
that even basic System.err.println() doesn't help.









Re: JDOM Bundle Problems

Posted by clement escoffier <cl...@gmail.com>.
2008/11/17 Richard S. Hall <he...@ungoverned.org>

> Brad Cox wrote:
>
>> Totally confused now; that seems to be saying the LogTransform factory
>> (service) produces instances of itself. Or was that a typo.
>>
>> I thought I understood before but maybe not. The pattern I'm following is
>> that each component X needs for classes:
>>
>>    XService (factory interface)
>>    XServiceImpl (factory implementation)
>>    X (instance interface)
>>    XImpl (instance implementation)
>>
>> And that manifest declares what kind of instance the factory creates. By
>> that understanding it would look what I have
>>
>> <ipojo>
>>    <component classname="com.gestalt.soakit.core.XService">
>>        <provides/>
>>    </component>
>>    <instance component="com.gestalt.soakit.core.X"/>
>> </ipojo>
>>
>> Might giving an interface where an impl is expected might cause that class
>> loader problem. Will try that.
>>
>
> I don't think so.
>
> Clearly, I don't really know what you are doing, so I may be off base.
>
> I believe I do know how the iPOJO descriptor works, but even then I could
> be wrong about that since I don't use it regularly, so Clement can correct
> me if I am wrong.
>
> From my recollection, in the iPOJO descriptor you define a component which
> has a concrete class (i.e., the Impl class). iPOJO automatically creates a
> factory service for that component from which it creates instances. The name
> of the factory, by default, is the name of the component impl class (you can
> specify a different name if you want). So, when you declare the <instance
> ...> tag you have to specify the name of the factory, which is the name of
> the component impl class in this case.
>
> If your component implements a service, you generally don't need to specify
> the service interface itself in the component descriptor, since iPOJO
> determines that automatically. You just need to specify the Impl class.


Hi,

Richard is correct. iPOJO does not impose any "pattern". So, a <component>
has a classname and can have a name attribute. The name is the factory name
(is not specified, the class name is used). The implementation class
(specified in the classname attribute) must implement interfaces if the
component has a <provides> element.

Then, when you declare an <instance>, you target (thanks to the 'component'
attribute) a factory (either by their 'name' or the 'className'). This will
create an instance with the factory (not an instance of the implementation
class). If the <component> has a <provides> element and the instance is
valid (service dependencies are fulfilled), the service is published. Then,
according to the building policy, an instance of the implementation class
can be created (immediate component, lifecycle callback ...). If you're
providing a service, by default, the creation of the instance of the
implementation class is delayed until a client uses the service.

Regards,

Clement






>
>
> -> richard
>
>
>>
>>
>> Richard S. Hall wrote:
>>
>>> Brad Cox wrote:
>>> I am a little confused, it seems there are lots of types involved here.
>>>
>>> In your activator you seem to be creating a LogTransformServiceImpl, but
>>> you are registering it as a ComponentService. In your iPOJO descriptor it
>>> appears you have the service interface as the component implementation class
>>> (i.e., LogTransformService instead of LogTransformServiceImpl) and then you
>>> are trying to create an instance of "LogTransform", which is something else
>>> altogether.
>>>
>>> I would guess your iPOJO descriptor should look something like this:
>>>
>>> <ipojo>
>>>   <component
>>> classname="com.gestalt.soakit.transform.log.LogTransformServiceImpl">
>>>       <provides/>
>>>   </component>
>>>   <instance
>>> component="com.gestalt.soakit.transform.log.LogTransformServiceImpl"/>
>>> </ipojo>
>>>
>>> I don't think this will fix the class format exception, though.
>>>
>>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: JDOM Bundle Problems

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Brad Cox wrote:
> Totally confused now; that seems to be saying the LogTransform factory 
> (service) produces instances of itself. Or was that a typo.
>
> I thought I understood before but maybe not. The pattern I'm following 
> is that each component X needs for classes:
>
>     XService (factory interface)
>     XServiceImpl (factory implementation)
>     X (instance interface)
>     XImpl (instance implementation)
>
> And that manifest declares what kind of instance the factory creates. 
> By that understanding it would look what I have
>
> <ipojo>
>     <component classname="com.gestalt.soakit.core.XService">
>         <provides/>
>     </component>
>     <instance component="com.gestalt.soakit.core.X"/>
> </ipojo>
>
> Might giving an interface where an impl is expected might cause that 
> class loader problem. Will try that.

I don't think so.

Clearly, I don't really know what you are doing, so I may be off base.

I believe I do know how the iPOJO descriptor works, but even then I 
could be wrong about that since I don't use it regularly, so Clement can 
correct me if I am wrong.

 From my recollection, in the iPOJO descriptor you define a component 
which has a concrete class (i.e., the Impl class). iPOJO automatically 
creates a factory service for that component from which it creates 
instances. The name of the factory, by default, is the name of the 
component impl class (you can specify a different name if you want). So, 
when you declare the <instance ...> tag you have to specify the name of 
the factory, which is the name of the component impl class in this case.

If your component implements a service, you generally don't need to 
specify the service interface itself in the component descriptor, since 
iPOJO determines that automatically. You just need to specify the Impl 
class.

-> richard

>
>
>
> Richard S. Hall wrote:
>> Brad Cox wrote:
>> I am a little confused, it seems there are lots of types involved here.
>>
>> In your activator you seem to be creating a LogTransformServiceImpl, 
>> but you are registering it as a ComponentService. In your iPOJO 
>> descriptor it appears you have the service interface as the component 
>> implementation class (i.e., LogTransformService instead of 
>> LogTransformServiceImpl) and then you are trying to create an 
>> instance of "LogTransform", which is something else altogether.
>>
>> I would guess your iPOJO descriptor should look something like this:
>>
>> <ipojo>
>>    <component 
>> classname="com.gestalt.soakit.transform.log.LogTransformServiceImpl">
>>        <provides/>
>>    </component>
>>    <instance 
>> component="com.gestalt.soakit.transform.log.LogTransformServiceImpl"/>
>> </ipojo>
>>
>> I don't think this will fix the class format exception, though.
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
Totally confused now; that seems to be saying the LogTransform factory 
(service) produces instances of itself. Or was that a typo.

I thought I understood before but maybe not. The pattern I'm following 
is that each component X needs for classes:

	XService (factory interface)
	XServiceImpl (factory implementation)
	X (instance interface)
	XImpl (instance implementation)

And that manifest declares what kind of instance the factory creates. By 
that understanding it would look what I have

<ipojo>
	<component classname="com.gestalt.soakit.core.XService">
		<provides/>
	</component>
	<instance component="com.gestalt.soakit.core.X"/>
</ipojo>

Might giving an interface where an impl is expected might cause that 
class loader problem. Will try that.



Richard S. Hall wrote:
> Brad Cox wrote:
> I am a little confused, it seems there are lots of types involved here.
> 
> In your activator you seem to be creating a LogTransformServiceImpl, but 
> you are registering it as a ComponentService. In your iPOJO descriptor 
> it appears you have the service interface as the component 
> implementation class (i.e., LogTransformService instead of 
> LogTransformServiceImpl) and then you are trying to create an instance 
> of "LogTransform", which is something else altogether.
> 
> I would guess your iPOJO descriptor should look something like this:
> 
> <ipojo>
>    <component 
> classname="com.gestalt.soakit.transform.log.LogTransformServiceImpl">
>        <provides/>
>    </component>
>    <instance 
> component="com.gestalt.soakit.transform.log.LogTransformServiceImpl"/>
> </ipojo>
> 
> I don't think this will fix the class format exception, though.
> 



Re: JDOM Bundle Problems

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Brad Cox wrote:
> Thanks! One step forward. The log messages weren't appearing because I 
> must be doing something wrong with ipojos, so I reenabled the osgi 
> activator logic to see if I could get oriented.
>
> I'm getting my log msgs now on refresh (what does that do?), but most 
> die like this
>
> java.lang.ClassFormatError: Illegal field modifiers in class 
> com/gestalt/soakit/transform/log/LogTransformService: 0x2

Hmm. I have no idea about that. See below too...

>
> This happens as the activator tries to create an instance
>
> public class LogTransformServiceActivator implements BundleActivator
> {
>     public void start(BundleContext context) throws Exception
>     {
>         System.out.println("LogTransformServiceActivator.start()");
>         Properties props = new Properties();
>         LogTransformServiceImpl factory = new 
> LogTransformServiceImpl(context, props);
>         context.registerService(ComponentService.class.getName(), 
> factory, props);
>     }
>
>     public void stop(BundleContext context) throws Exception
>     {
>         System.out.println("LogTransformServiceActivator.stop()");
>     }
> }
>
> This seems to be a garden variety class loader error, but I just can't 
> find it. Maybe something wrong in metadata.xml?
>
> <ipojo>
>     <component 
> classname="com.gestalt.soakit.transform.log.LogTransformService">
>         <provides/>
>     </component>
>     <instance component="com.gestalt.soakit.transform.log.LogTransform"/>
> </ipojo>

I am a little confused, it seems there are lots of types involved here.

In your activator you seem to be creating a LogTransformServiceImpl, but 
you are registering it as a ComponentService. In your iPOJO descriptor 
it appears you have the service interface as the component 
implementation class (i.e., LogTransformService instead of 
LogTransformServiceImpl) and then you are trying to create an instance 
of "LogTransform", which is something else altogether.

I would guess your iPOJO descriptor should look something like this:

<ipojo>
    <component 
classname="com.gestalt.soakit.transform.log.LogTransformServiceImpl">
        <provides/>
    </component>
    <instance 
component="com.gestalt.soakit.transform.log.LogTransformServiceImpl"/>
</ipojo>

I don't think this will fix the class format exception, though.

-> richard

>
>
> Richard S. Hall wrote:
>>
>>
>> Brad Cox wrote:
>>> The saga continues. I gave up on jdom and converted everything to 
>>> xom. Got all components converted to ipojo bundles (enclosing 
>>> dependencies), I think successfully (finally!).
>>>
>>> -> ps
>>> START LEVEL 1
>>>    ID   State         Level  Name
>>> [   0] [Active     ] [    0] System Bundle (1.2.1)
>>> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
>>> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
>>> [   9] [Active     ] [    1] Apache Felix Bundle Repository (1.2.0)
>>> [  10] [Active     ] [    1] iPOJO (1.0.0)
>>> [  11] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
>>> [  12] [Active     ] [    1] soakit.port.file (1.0.0.SNAPSHOT)
>>> [  13] [Active     ] [    1] soakit.port.http (1.0.0.SNAPSHOT)
>>> [  14] [Active     ] [    1] soakit.port.jms (1.0.0.SNAPSHOT)
>>> [  15] [Active     ] [    1] soakit.transform.identity (1.0.0.SNAPSHOT)
>>> [  16] [Active     ] [    1] soakit.transform.log (1.0.0.SNAPSHOT)
>>> [  17] [Active     ] [    1] soakit.transform.pep (1.0.0.SNAPSHOT)
>>> [  18] [Active     ] [    1] soakit.transform.xsl (1.0.0.SNAPSHOT)
>>>
>>> Problem is, that's all I see; in particular, no sign of logging 
>>> messages  from any of these files. I'd expect to see at least the 
>>> service constructor logs.
>>>
>>> Is felix redirecting the logs, or is this constructor not getting 
>>> called?
>>
>> The level of logging output is dependent on how you have your logger 
>> configured. Felix' log level is used for logging messages from Felix, 
>> not bundles.
>>
>>>
>>>     public CompositeServiceImpl(BundleContext context, Properties 
>>> properties)
>>>     {
>>>         System.err.println("new CompositeServiceImpl(c, p)");
>>>         log.info("new CompositeServiceImpl(..,..)");
>>>         this.context = context;
>>>         this.properties = properties;
>>>         componentTracker = new ComponentTracker(context);
>>>         componentTracker.open();
>>>         System.err.println("new CompositeServiceImpl(c, p) OK");
>>>     }
>>>
>>> Most of all, could someone provide steps for debugging a felix 
>>> console session like this one from eclipse? The obvious approach, 
>>> launching felix (via pax runner) inside eclipse stopped working; 
>>> mysterious error during startup that I really don't understand.
>>
>> I am not a power user of Eclipse, but the general approach I use for 
>> both Eclipse and NetBeans is to launch Felix something like this:
>>
>> java -Xdebug 
>> -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -jar 
>> bin/felix.jar
>>
>> Then I can attach the debugger to it on port 8001. Works well enough 
>> for me.
>>
>> -> richard
>>
>>> PS: Just tried installing all this under springsource-dm. I get to 
>>> the same point; nothing being logged and no idea how to debug it. 
>>> Launching it with startup.jar -debug -something (don't recall what) 
>>> gives a bus error.
>>>
>>> Brad Cox wrote:
>>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>>
>>>> I need to use org.jdom in an OSGI application. But it is not (to my 
>>>> knowledge) available as a bundle, just a jar. So I've been trying 
>>>> to wrap the jar as a bundle; soakit.jdom.
>>>
>>>
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
Thanks! One step forward. The log messages weren't appearing because I 
must be doing something wrong with ipojos, so I reenabled the osgi 
activator logic to see if I could get oriented.

I'm getting my log msgs now on refresh (what does that do?), but most 
die like this

java.lang.ClassFormatError: Illegal field modifiers in class 
com/gestalt/soakit/transform/log/LogTransformService: 0x2

This happens as the activator tries to create an instance

public class LogTransformServiceActivator implements BundleActivator
{
	public void start(BundleContext context) throws Exception
	{
		System.out.println("LogTransformServiceActivator.start()");
         Properties props = new Properties();
         LogTransformServiceImpl factory = new 
LogTransformServiceImpl(context, props);
         context.registerService(ComponentService.class.getName(), 
factory, props);
	}

	public void stop(BundleContext context) throws Exception
	{
		System.out.println("LogTransformServiceActivator.stop()");
	}
}

This seems to be a garden variety class loader error, but I just can't 
find it. Maybe something wrong in metadata.xml?

<ipojo>
	<component 
classname="com.gestalt.soakit.transform.log.LogTransformService">
		<provides/>
	</component>
	<instance component="com.gestalt.soakit.transform.log.LogTransform"/>
</ipojo>


Richard S. Hall wrote:
> 
> 
> Brad Cox wrote:
>> The saga continues. I gave up on jdom and converted everything to xom. 
>> Got all components converted to ipojo bundles (enclosing 
>> dependencies), I think successfully (finally!).
>>
>> -> ps
>> START LEVEL 1
>>    ID   State         Level  Name
>> [   0] [Active     ] [    0] System Bundle (1.2.1)
>> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
>> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
>> [   9] [Active     ] [    1] Apache Felix Bundle Repository (1.2.0)
>> [  10] [Active     ] [    1] iPOJO (1.0.0)
>> [  11] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
>> [  12] [Active     ] [    1] soakit.port.file (1.0.0.SNAPSHOT)
>> [  13] [Active     ] [    1] soakit.port.http (1.0.0.SNAPSHOT)
>> [  14] [Active     ] [    1] soakit.port.jms (1.0.0.SNAPSHOT)
>> [  15] [Active     ] [    1] soakit.transform.identity (1.0.0.SNAPSHOT)
>> [  16] [Active     ] [    1] soakit.transform.log (1.0.0.SNAPSHOT)
>> [  17] [Active     ] [    1] soakit.transform.pep (1.0.0.SNAPSHOT)
>> [  18] [Active     ] [    1] soakit.transform.xsl (1.0.0.SNAPSHOT)
>>
>> Problem is, that's all I see; in particular, no sign of logging 
>> messages  from any of these files. I'd expect to see at least the 
>> service constructor logs.
>>
>> Is felix redirecting the logs, or is this constructor not getting called?
> 
> The level of logging output is dependent on how you have your logger 
> configured. Felix' log level is used for logging messages from Felix, 
> not bundles.
> 
>>
>>     public CompositeServiceImpl(BundleContext context, Properties 
>> properties)
>>     {
>>         System.err.println("new CompositeServiceImpl(c, p)");
>>         log.info("new CompositeServiceImpl(..,..)");
>>         this.context = context;
>>         this.properties = properties;
>>         componentTracker = new ComponentTracker(context);
>>         componentTracker.open();
>>         System.err.println("new CompositeServiceImpl(c, p) OK");
>>     }
>>
>> Most of all, could someone provide steps for debugging a felix console 
>> session like this one from eclipse? The obvious approach, launching 
>> felix (via pax runner) inside eclipse stopped working; mysterious 
>> error during startup that I really don't understand.
> 
> I am not a power user of Eclipse, but the general approach I use for 
> both Eclipse and NetBeans is to launch Felix something like this:
> 
> java -Xdebug 
> -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -jar 
> bin/felix.jar
> 
> Then I can attach the debugger to it on port 8001. Works well enough for 
> me.
> 
> -> richard
> 
>> PS: Just tried installing all this under springsource-dm. I get to the 
>> same point; nothing being logged and no idea how to debug it. 
>> Launching it with startup.jar -debug -something (don't recall what) 
>> gives a bus error.
>>
>> Brad Cox wrote:
>>> Surely such a simple problem can't be so difficult. Can someone help?
>>>
>>> I need to use org.jdom in an OSGI application. But it is not (to my 
>>> knowledge) available as a bundle, just a jar. So I've been trying to 
>>> wrap the jar as a bundle; soakit.jdom.
>>
>>
>> ------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 



Re: JDOM Bundle Problems

Posted by "Richard S. Hall" <he...@ungoverned.org>.

Brad Cox wrote:
> The saga continues. I gave up on jdom and converted everything to xom. 
> Got all components converted to ipojo bundles (enclosing 
> dependencies), I think successfully (finally!).
>
> -> ps
> START LEVEL 1
>    ID   State         Level  Name
> [   0] [Active     ] [    0] System Bundle (1.2.1)
> [   7] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
> [   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
> [   9] [Active     ] [    1] Apache Felix Bundle Repository (1.2.0)
> [  10] [Active     ] [    1] iPOJO (1.0.0)
> [  11] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
> [  12] [Active     ] [    1] soakit.port.file (1.0.0.SNAPSHOT)
> [  13] [Active     ] [    1] soakit.port.http (1.0.0.SNAPSHOT)
> [  14] [Active     ] [    1] soakit.port.jms (1.0.0.SNAPSHOT)
> [  15] [Active     ] [    1] soakit.transform.identity (1.0.0.SNAPSHOT)
> [  16] [Active     ] [    1] soakit.transform.log (1.0.0.SNAPSHOT)
> [  17] [Active     ] [    1] soakit.transform.pep (1.0.0.SNAPSHOT)
> [  18] [Active     ] [    1] soakit.transform.xsl (1.0.0.SNAPSHOT)
>
> Problem is, that's all I see; in particular, no sign of logging 
> messages  from any of these files. I'd expect to see at least the 
> service constructor logs.
>
> Is felix redirecting the logs, or is this constructor not getting called?

The level of logging output is dependent on how you have your logger 
configured. Felix' log level is used for logging messages from Felix, 
not bundles.

>
>     public CompositeServiceImpl(BundleContext context, Properties 
> properties)
>     {
>         System.err.println("new CompositeServiceImpl(c, p)");
>         log.info("new CompositeServiceImpl(..,..)");
>         this.context = context;
>         this.properties = properties;
>         componentTracker = new ComponentTracker(context);
>         componentTracker.open();
>         System.err.println("new CompositeServiceImpl(c, p) OK");
>     }
>
> Most of all, could someone provide steps for debugging a felix console 
> session like this one from eclipse? The obvious approach, launching 
> felix (via pax runner) inside eclipse stopped working; mysterious 
> error during startup that I really don't understand.

I am not a power user of Eclipse, but the general approach I use for 
both Eclipse and NetBeans is to launch Felix something like this:

java -Xdebug 
-Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -jar 
bin/felix.jar

Then I can attach the debugger to it on port 8001. Works well enough for me.

-> richard

> PS: Just tried installing all this under springsource-dm. I get to the 
> same point; nothing being logged and no idea how to debug it. 
> Launching it with startup.jar -debug -something (don't recall what) 
> gives a bus error.
>
> Brad Cox wrote:
>> Surely such a simple problem can't be so difficult. Can someone help?
>>
>> I need to use org.jdom in an OSGI application. But it is not (to my 
>> knowledge) available as a bundle, just a jar. So I've been trying to 
>> wrap the jar as a bundle; soakit.jdom.
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: JDOM Bundle Problems

Posted by Brad Cox <bc...@virtualschool.edu>.
The saga continues. I gave up on jdom and converted everything to xom. 
Got all components converted to ipojo bundles (enclosing dependencies), 
I think successfully (finally!).

-> ps
START LEVEL 1
    ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.2.1)
[   7] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
[   8] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
[   9] [Active     ] [    1] Apache Felix Bundle Repository (1.2.0)
[  10] [Active     ] [    1] iPOJO (1.0.0)
[  11] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
[  12] [Active     ] [    1] soakit.port.file (1.0.0.SNAPSHOT)
[  13] [Active     ] [    1] soakit.port.http (1.0.0.SNAPSHOT)
[  14] [Active     ] [    1] soakit.port.jms (1.0.0.SNAPSHOT)
[  15] [Active     ] [    1] soakit.transform.identity (1.0.0.SNAPSHOT)
[  16] [Active     ] [    1] soakit.transform.log (1.0.0.SNAPSHOT)
[  17] [Active     ] [    1] soakit.transform.pep (1.0.0.SNAPSHOT)
[  18] [Active     ] [    1] soakit.transform.xsl (1.0.0.SNAPSHOT)

Problem is, that's all I see; in particular, no sign of logging messages 
  from any of these files. I'd expect to see at least the service 
constructor logs.

Is felix redirecting the logs, or is this constructor not getting called?

	public CompositeServiceImpl(BundleContext context, Properties properties)
	{
		System.err.println("new CompositeServiceImpl(c, p)");
		log.info("new CompositeServiceImpl(..,..)");
		this.context = context;
		this.properties = properties;
		componentTracker = new ComponentTracker(context);
		componentTracker.open();
		System.err.println("new CompositeServiceImpl(c, p) OK");
	}

Most of all, could someone provide steps for debugging a felix console 
session like this one from eclipse? The obvious approach, launching 
felix (via pax runner) inside eclipse stopped working; mysterious error 
during startup that I really don't understand.

PS: Just tried installing all this under springsource-dm. I get to the 
same point; nothing being logged and no idea how to debug it. Launching 
it with startup.jar -debug -something (don't recall what) gives a bus error.

Brad Cox wrote:
> Surely such a simple problem can't be so difficult. Can someone help?
> 
> I need to use org.jdom in an OSGI application. But it is not (to my 
> knowledge) available as a bundle, just a jar. So I've been trying to 
> wrap the jar as a bundle; soakit.jdom.