Re: [osgi-dev] Enabling debug of SCR with Equinox

2018-08-06 Thread Cristiano via osgi-dev

hi,

if you are using the latest equinox, one good alternative is to use the 
recently released org.apache.felix.logback.


you just need to set a proper logback configuration file defining the 
appenders and log level and then use the vm argument as below (I used to 
debug inside eclipse ide):



-Dlogback.configurationFile=${workspace_loc:your_project}/logback-test.xml


Also, it is better to set org.apache.felix.logback's start level to one, 
so you won't miss any log entry.


See an example:

21:23:29,959 |-INFO in 
ch.qos.logback.classic.joran.action.LoggerAction - Setting level of 
logger [Events.Service.org.eclipse.osgi] to DEBUG
21:36:13||DEBUG|bundle org.apache.felix.scr:2.1.2 (20)bundle 
org.eclipse.equinox.console:1.3.0.v20180119-0630 (22) : Starting 
extension synchronously|L.org.apache.felix.scr||L.o.a.f.scr@?[main]


21:36:13||INFO|BundleEvent 
STARTED|E.B.o.e.equinox.console||E.B.o.e.e.console@?[Framework Event 
Dispatcher: Equinox Container: f558dbee-500a-4400-ae8a-0e68b1b46f2e]


21:36:18||DEBUG|ServiceEvent MODIFIED 
{org.osgi.service.component.runtime.ServiceComponentRuntime}={service.changecount=19, 
service.id=39, service.bundleid=20, 
service.scope=singleton}|E.S.org.apache.felix.scr||E.S.o.a.f.scr@?[Timer-1]



regards,

Cristiano

On 06/08/2018 12:28, Alain Picard via osgi-dev wrote:
I want to enable debug logging / tracing of SCR when running with 
Equinox. I tried to use config admin to configure 
"org.apache.felix.scr.ScrService" but to no avail. Not sure if even if 
Eclipse now uses felix scr if that is the way to go. Or it is the 
whole log redirection thing 
(https://io7m.com/documents/brutal-felix-logging/). Just looking for 
console debug.


Thanks
Alain



___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Reference not injected to component

2018-08-06 Thread Nhut Thai Le via osgi-dev
Hi Tim,

The servlet is inside a WAB file which has a web.xml:


http://java.sun.com/xml/ns/javaee;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
 version="3.0">

HelloWorld
com.webapp.HelloWorld



HelloWorld
/



I'm not trying to use the whiteboard pattern in the first place but rather
looking for a way to inject my AdminBroker service into my servlet so I
turn my servlet into a component in order to use the reference.

Thai


On Mon, Aug 6, 2018 at 4:44 PM, Tim Ward  wrote:

> I don’t see any Http Service whiteboard properties on the Servlet
> component. How are you registering it with the Servlet container?
>
> Tim
>
> Sent from my iPhone
>
> On 6 Aug 2018, at 16:22, Nhut Thai Le via osgi-dev 
> wrote:
>
> Hello,
>
> I have a servlet defined like this:
>
> @Component(service = Servlet.class)
> public class HelloWorld extends HttpServlet {
> @Reference(cardinality = ReferenceCardinality.MANDATORY)
> private AdminBroker adminBroker;
>
> protected void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {
> adminBroker.doSomething();
> }
> }
>
> My AdminBroker implementation looks like:
> @Component(service=AdminBroker.class)
> public class AdminBrokerImpl implements AdminBroker {
> @Activate
> private void init() {
> String param1 = "some text";
> }
> }
>
> When I started the env (felix 6 with pax-web), I can see the AdminBroker
> instantiated (hit a break point in the init of my AdminBroker
> implementation) but when the web request arrives and the doGet method is
> called, the adminBroker is null.
>
> Does anyone have an idea what may go wrong here?
>
> Thai Le
>
> --
> Castor Technologies Inc
> 460 rue St-Catherine St
> 
> Ouest, Suite 613
> Montréal, Québec H3B-1A7
> (514) 360-7208 o
> (514) 798-2044 f
> n...@castortech.com
> www.castortech.com
>
> CONFIDENTIALITY NOTICE: The information contained in this e-mail is
> confidential and may be proprietary information intended only for the use
> of the individual or entity to whom it is addressed. If the reader of this
> message is not the intended recipient, you are hereby notified that any
> viewing, dissemination, distribution, disclosure, copy or use of the
> information contained in this e-mail message is strictly prohibited. If you
> have received and/or are viewing this e-mail in error, please immediately
> notify the sender by reply e-mail, and delete it from your system without
> reading, forwarding, copying or saving in any manner. Thank you.
> AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est
> confidentiel, peut être protégé par le secret professionnel et est réservé
> à l'usage exclusif du destinataire. Toute autre personne est par les
> présentes avisée qu'il lui est strictement interdit de diffuser, distribuer
> ou reproduire ce message. Si vous avez reçu cette communication par erreur,
> veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>


-- 
Castor Technologies Inc
460 rue St-Catherine St Ouest, Suite 613
Montréal, Québec H3B-1A7
(514) 360-7208 o
(514) 798-2044 f
n...@castortech.com
www.castortech.com

CONFIDENTIALITY NOTICE: The information contained in this e-mail is
confidential and may be proprietary information intended only for the use
of the individual or entity to whom it is addressed. If the reader of this
message is not the intended recipient, you are hereby notified that any
viewing, dissemination, distribution, disclosure, copy or use of the
information contained in this e-mail message is strictly prohibited. If you
have received and/or are viewing this e-mail in error, please immediately
notify the sender by reply e-mail, and delete it from your system without
reading, forwarding, copying or saving in any manner. Thank you.
AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est
confidentiel, peut être protégé par le secret professionnel et est réservé
à l'usage exclusif du destinataire. Toute autre personne est par les
présentes avisée qu'il lui est strictement interdit de diffuser, distribuer
ou reproduire ce message. Si vous avez reçu cette communication par erreur,
veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Reference not injected to component

2018-08-06 Thread Tim Ward via osgi-dev
I don’t see any Http Service whiteboard properties on the Servlet component. 
How are you registering it with the Servlet container?

Tim

Sent from my iPhone

> On 6 Aug 2018, at 16:22, Nhut Thai Le via osgi-dev  
> wrote:
> 
> Hello,
> 
> I have a servlet defined like this:
> 
> @Component(service = Servlet.class)
> public class HelloWorld extends HttpServlet {
>   @Reference(cardinality = ReferenceCardinality.MANDATORY)
>   private AdminBroker adminBroker;
> 
>   protected void doGet(HttpServletRequest request, HttpServletResponse 
> response) throws ServletException, IOException {   
>   adminBroker.doSomething();
>   }
> }
> 
> My AdminBroker implementation looks like:
> @Component(service=AdminBroker.class)
> public class AdminBrokerImpl implements AdminBroker {
>   @Activate
>   private void init() {
>   String param1 = "some text";
>   }
> }
> 
> When I started the env (felix 6 with pax-web), I can see the AdminBroker 
> instantiated (hit a break point in the init of my AdminBroker implementation) 
> but when the web request arrives and the doGet method is called, the 
> adminBroker is null.
> 
> Does anyone have an idea what may go wrong here?
> 
> Thai Le
> 
> -- 
> Castor Technologies Inc
> 460 rue St-Catherine St Ouest, Suite 613 
> Montréal, Québec H3B-1A7
> (514) 360-7208 o
> (514) 798-2044 f
> n...@castortech.com
> www.castortech.com 
> 
> CONFIDENTIALITY NOTICE: The information contained in this e-mail is 
> confidential and may be proprietary information intended only for the use of 
> the individual or entity to whom it is addressed. If the reader of this 
> message is not the intended recipient, you are hereby notified that any 
> viewing, dissemination, distribution, disclosure, copy or use of the 
> information contained in this e-mail message is strictly prohibited. If you 
> have received and/or are viewing this e-mail in error, please immediately 
> notify the sender by reply e-mail, and delete it from your system without 
> reading, forwarding, copying or saving in any manner. Thank you.
> AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est 
> confidentiel, peut être protégé par le secret professionnel et est réservé à 
> l'usage exclusif du destinataire. Toute autre personne est par les présentes 
> avisée qu'il lui est strictement interdit de diffuser, distribuer ou 
> reproduire ce message. Si vous avez reçu cette communication par erreur, 
> veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Re: [osgi-dev] Angular New Enroute

2018-08-06 Thread João Assunção via osgi-dev
As David mentioned you will need to include the "ng build" step in your
build process. I include a portion of the pom where exec-maven-plugin is
used to invoke "npm install" and "ng build".
To expose the angular app we are using HTTP whiteboard. The bundle
activator exports a  ResourceMapping service configured with the path of
the ngapp directory. We are doing it in the bundle activator but it could
be done in @Activate of a DS component. In our case, the communication
between the angular side and the server side (a DS component) is done using
web sockets, but I think it would be easy to make a DS component expose a
REST service..


DefaultResourceMapping rootResourceMapping = new DefaultResourceMapping();
rootResourceMapping.setAlias("/myApp");
rootResourceMapping.setPath("/ng");
rootResourceMappingRegistration =
bundleContext.registerService(ResourceMapping.class, rootResourceMapping,
null);

// Redirect 404 errors to the default page
DefaultErrorPageMapping errorpageMapping = new DefaultErrorPageMapping();
errorpageMapping.setError("404");
errorpageMapping.setLocation("/myApp/index.html");
errorpage404Registration =
bundleContext.registerService(ErrorPageMapping.class, errorpageMapping,
null);

// Registers a filter to rewrite the URL "myApp/" to
// index.html
RedirectMatchFilter filter = new RedirectMatchFilter("/myApp/",
"/myApp/index.html");
props = new Hashtable<>();
props.put(ExtenderConstants.PROPERTY_URL_PATTERNS, "/myApp/*");
filtrerRegistration = bundleContext.registerService(Filter.class, filter,
props);





org.codehaus.mojo
exec-maven-plugin
1.5.0


   exec-npm-install
   generate-sources
   
${maven.exec.skip}
${project.basedir}/src/main/ngapp
${npm.executable}

   install

   
   
exec
   


   exec-npm-ng-build
   generate-sources
   
${maven.exec.skip}
${project.basedir}/src/main/ngapp
${ng.executable}

   build
   --target=${build.target}
   --base-href=/myApp/
   --no-progress
   --output-hashing=all

   
   
exec
   






João Assunção

Email: joao.assun...@exploitsys.com
Mobile: +351 916968984
Phone: +351 211933149
Web: www.exploitsys.com



On Fri, Aug 3, 2018 at 11:42 PM, David Leangen via osgi-dev <
osgi-dev@mail.osgi.org> wrote:

>
> Hi,
>
> Angular 2+ works very differently from AngularJS. In enRoute (or at least
> in v2, I am not yet familiar with the current enRoute), it used AngularJS.
> You used to be able to just include the JS file, and that was it. Angular
> 2+ requires you to build/compile your application first, so you cannot just
> ship the source code (unless you include some kind of interpreter, but I’ve
> never attempted that).
>
> What we do is build the files at some point during the build process, and
> ship the entire dist directory.
>
> It works for us as a deployment mechanism. Never tried it as a DS
> component, though. Because of the way an Angular 2+ app works, I don’t
> immediately see how you could do that. If you figure it out, I’d be
> interested in hearing your solution.
>
>
> Cheers,
> =David
>
>
> On Aug 4, 2018, at 4:55, Matthews, Kevin via osgi-dev <
> osgi-dev@mail.osgi.org> wrote:
>
> Hello,
>
> Has anyone integrated the new angular 2+/6 into the enroute project as a
> separate UI module/DS component? I have added the contents of my angular
> src folder into the static folder  of the enroute sample but doesn’t seem
> to render the static pages. Should I add the entire angular folder to
> static folder or just the src folder of my angular generate project?
>
> *Kevin Matthews *
> Senior Application Analyst
> First Data, 3975 NW 120 Ave, Coral Springs, FL 33065
> Office: 954-845-4222 *|* Mobile: 561-465-6694
>
> kevin.matth...@firstdata.com *|* firstdata.com
>
> The information in this message may be proprietary and/or confidential,
> and protected from disclosure. If the reader of this message is not the
> intended recipient, or an employee or agent responsible for delivering this
> message to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, please notify
> First Data immediately by replying to this message and deleting it from
> your computer.
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
>
>
> ___
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
>
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Enabling debug of SCR with Equinox

2018-08-06 Thread Alain Picard via osgi-dev
I want to enable debug logging / tracing of SCR when running with Equinox.
I tried to use config admin to configure "org.apache.felix.scr.ScrService"
but to no avail. Not sure if even if Eclipse now uses felix scr if that is
the way to go. Or it is the whole log redirection thing (
https://io7m.com/documents/brutal-felix-logging/). Just looking for console
debug.

Thanks
Alain
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Reference not injected to component

2018-08-06 Thread Nhut Thai Le via osgi-dev
Hello,

I have a servlet defined like this:

@Component(service = Servlet.class)
public class HelloWorld extends HttpServlet {
@Reference(cardinality = ReferenceCardinality.MANDATORY)
private AdminBroker adminBroker;

protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
adminBroker.doSomething();
}
}

My AdminBroker implementation looks like:
@Component(service=AdminBroker.class)
public class AdminBrokerImpl implements AdminBroker {
@Activate
private void init() {
String param1 = "some text";
}
}

When I started the env (felix 6 with pax-web), I can see the AdminBroker
instantiated (hit a break point in the init of my AdminBroker
implementation) but when the web request arrives and the doGet method is
called, the adminBroker is null.

Does anyone have an idea what may go wrong here?

Thai Le

-- 
Castor Technologies Inc
460 rue St-Catherine St Ouest, Suite 613
Montréal, Québec H3B-1A7
(514) 360-7208 o
(514) 798-2044 f
n...@castortech.com
www.castortech.com

CONFIDENTIALITY NOTICE: The information contained in this e-mail is
confidential and may be proprietary information intended only for the use
of the individual or entity to whom it is addressed. If the reader of this
message is not the intended recipient, you are hereby notified that any
viewing, dissemination, distribution, disclosure, copy or use of the
information contained in this e-mail message is strictly prohibited. If you
have received and/or are viewing this e-mail in error, please immediately
notify the sender by reply e-mail, and delete it from your system without
reading, forwarding, copying or saving in any manner. Thank you.
AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est
confidentiel, peut être protégé par le secret professionnel et est réservé
à l'usage exclusif du destinataire. Toute autre personne est par les
présentes avisée qu'il lui est strictement interdit de diffuser, distribuer
ou reproduire ce message. Si vous avez reçu cette communication par erreur,
veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.
___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] Liferay Portlet created with BndTools and Gradle not outputting the right package versioning when building the JAR file

2018-08-06 Thread Ramazan Bekrek (Extern) via osgi-dev
I would like to know why when I'm running an OSGi compiled JAR Bundle inside of 
Liferay OSGi environment I get this error:

This is the bnd.bnd file

Bundle-Name: Liferay Portal Portlet Bridge Soy
Bundle-SymbolicName: com.liferay.portal.portlet.bridge.soy
Bundle-Version: 3.2.0
Export-Package: com.liferay.portal.portlet.bridge.soy
Liferay-Releng-Module-Group-Description:
Liferay-Releng-Module-Group-Title:
Web-ContextPath: /portal-portlet-bridge-soy

This ist he build.gradle file

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

configJSModules {
include "**/*.js*"
}

dependencies {
compileOnly group: "com.liferay", name: 
"com.liferay.osgi.util", version: "3.2.0"
compileOnly group: "com.liferay", name: 
"com.liferay.petra.function", version: "1.0.0"
compileOnly group: "com.liferay", name: 
"com.liferay.petra.string", version: "1.0.0"
compileOnly group: "com.liferay.portal", name: 
"com.liferay.portal.impl", version: "2.0.0"
compileOnly group: "com.liferay.portal", name: 
"com.liferay.portal.kernel", version: "2.13.0"
compileOnly group: "com.liferay.portal", name: 
"com.liferay.util.bridges", version: "2.0.0"
compileOnly group: "javax.portlet", name: "portlet-api", 
version: "2.0"
compileOnly group: "javax.servlet", name: "javax.servlet-api", 
version: "3.0.1"
compileOnly group: "org.osgi", name: "org.osgi.core", version: 
"6.0.0"
// Added this
compileOnly project(":modules:portal-template-soy-api")
// commented this provided 
project(":apps:foundation:portal-template:portal-template-soy-api")

testCompile group: "com.liferay", name: 
"com.liferay.petra.lang", version: "1.0.0"
testCompile group: "com.liferay", name: 
"com.liferay.registry.api", version: "1.1.0"
testCompile group: "com.liferay", name: "org.jabsorb", version: 
"1.3.1.LIFERAY-PATCHED-1"
testCompile group: "com.redhat.qe", name: "json-java", version: 
"20110202"
testCompile group: "org.jodd", name: "jodd-bean", version: 
"3.6.4"
testCompile group: "org.jodd", name: "jodd-json", version: 
"3.6.4"
testCompile group: "org.slf4j", name: "slf4j-api", version: 
"1.7.2"
}

transpileJS {
srcIncludes = "**/*.js"
}

What comes out in the MANIFEST.MF in the compiled JAR is

Manifest-Version: 1.0
Bnd-LastModified: 1533564551530
Bundle-ManifestVersion: 2
Bundle-Name: Liferay Portal Portlet Bridge Soy
Bundle-SymbolicName: com.liferay.portal.portlet.bridge.soy
Bundle-Version: 3.2.0
Created-By: 1.8.0_171 (Oracle Corporation)
Export-Package: com.liferay.portal.portlet.bridge.soy;version="2.2.0";
uses:="com.liferay.portal.kernel.portlet.bridges.mvc,com.liferay.port
al.kernel.template,javax.portlet"
Import-Package: com.liferay.osgi.util.service;version="[2.1,3)",com.li
feray.petra.function;version="[1.0,2)",com.liferay.portal.kernel.io.u
nsync;version="[6.2,7)",com.liferay.portal.kernel.json;version="[7.0,
8)",com.liferay.portal.kernel.log;version="[7.0,8)",com.liferay.porta
l.kernel.model;version="[1.0,2)",com.liferay.portal.kernel.portlet;ve
rsion="[7.5,8)",com.liferay.portal.kernel.portlet.bridges.mvc;version
="[1.4,2)",com.liferay.portal.kernel.service;version="[1.5,2)",com.li
feray.portal.kernel.servlet;version="[7.2,8)",com.liferay.portal.kern
el.servlet.taglib.aui;version="[7.0,8)",com.liferay.portal.kernel.tem
plate;version="[7.1,8)",com.liferay.portal.kernel.theme;version="[1.1
,2)",com.liferay.portal.kernel.util;version="[7.10,8)",com.liferay.po
rtal.template.soy.utils;version="[2.0,3)",com.liferay.portlet;version
="[1.0,2)",javax.portlet;version="[2.0,3)",javax.servlet;version="[3.
0,4)",javax.servlet.http;version="[3.0,4)",org.osgi.framework;version
="[1.8,2)"
Javac-Debug: on
Javac-Deprecation: off
Javac-Encoding: Cp1252
Private-Package: com.liferay.portal.portlet.bridge.soy.internal,com.li
feray.portal.portlet.bridge.soy.internal.dependencies
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-3.2.0.201605172007
Web-ContextPath: /portal-portlet-bridge-soy

The irregularity is the version from the com.liferay.kernel package:

com.liferay.portal.kernel.portlet;version="[7.5,8)"

When it should be [2.0.0,3) when I do in Gogo Shell diag 996 I get this error :

g! diag 1000
com.liferay.portal.portlet.bridge.soy [1000]
  Unresolved requirement: Import-Package: com.liferay.portal.kernel.portlet; 
version="[7.5.0,8.0.0)"

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

[osgi-dev] (no subject)

2018-08-06 Thread Ramazan Bekrek (Extern) via osgi-dev

___
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev