Hi,

After going through sources, I figured out carbon kernel has configuration
file[1] to export several packages to OSGi runtime including javax.*. So it
is required to import packages specified in launch.ini[1] file as OSGi
imports.

[1]
https://github.com/wso2/carbon4-kernel/blob/master/distribution/kernel/carbon-home/repository/conf/etc/launch.ini

Thanks & Regards,
/charithag

On Tue, Aug 11, 2015 at 11:39 AM, Charitha Goonetilleke <[email protected]>
wrote:

> Hi Devs,
>
> I'm working on optimizing maven build scripts for CDMF grouping feature.
> In group-mgt component I had to import javax.sql and javax.naming as OSGi
> imports to build and run product without issue. Here is the snap from my
> pom file.
>
>            * <plugin>*
> *                <groupId>org.apache.felix</groupId>*
> *                <artifactId>maven-bundle-plugin</artifactId>*
> *                <version>1.4.0</version>*
> *                <extensions>true</extensions>*
> *                <configuration>*
> *                    <instructions>*
> *
> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>*
> *                        <Bundle-Name>${project.artifactId}</Bundle-Name>*
> *
> <Bundle-Version>${carbon.device.mgt.version}</Bundle-Version>*
> *                        <Bundle-Description>Device Management Core Group
> Bundle</Bundle-Description>*
> *
> <Private-Package>org.wso2.carbon.device.mgt.group.core.internal</Private-Package>*
> *                        <Import-Package>*
> *                            org.wso2.carbon.device.mgt.group.common.*,*
> *                            org.wso2.carbon.device.mgt.common.*,*
> *                            org.wso2.carbon.device.mgt.core.*,*
> *                            org.wso2.carbon.user.core.*,*
> *                            org.wso2.carbon.user.core,*
> *                            org.apache.commons.logging.*,*
> *                            javax.naming,*
> *                            javax.sql.*,*
> *                            org.osgi.framework.*,*
> *                            org.osgi.service.component.*,*
> *                            org.wso2.carbon.user.api.**
> *                        </Import-Package>*
> *                        <Export-Package>*
> *
> !org.wso2.carbon.device.mgt.group.core.internal,*
> *                            org.wso2.carbon.device.mgt.group.core.**
> *                        </Export-Package>*
> *                    </instructions>*
> *                </configuration>*
> *            </plugin>*
>
> But I feel that, javax.naming and javax.sql imports should be get rid out
> from OSGi imports since they are provided by the runtime. However when I
> removed those two imports from pom file, build break happen with this error.
>
> [ERROR] Error building bundle
> org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.group.core:bundle:0.9.2-SNAPSHOT
> : Unresolved references to [javax.naming, javax.sql] by class(es) on the
> Bundle-Classpath[Jar:dot]:
> [org/wso2/carbon/device/mgt/group/core/dao/GroupManagementDAOFactory.class,
> org/wso2/carbon/device/mgt/group/core/dao/GroupManagementDAOUtil.class,
> org/wso2/carbon/device/mgt/group/core/dao/GroupDAOImpl.class]
>
>
> So I'm wondering that, why I still need to import those non OSGi packages
> inside OSGi imports since they are provided by the runtime.
>
> Any thoughts?
>
>
> --
> *Charitha Goonetilleke*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 77 751 3669 <%2B94777513669>
> Twitter:@CharithaWs <https://twitter.com/CharithaWs>, fb: charithag
> <https://www.facebook.com/charithag>, linkedin: charithag
> <http://www.linkedin.com/in/charithag>
>



-- 
*Charitha Goonetilleke*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 77 751 3669 <%2B94777513669>
Twitter:@CharithaWs <https://twitter.com/CharithaWs>, fb: charithag
<https://www.facebook.com/charithag>, linkedin: charithag
<http://www.linkedin.com/in/charithag>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to