Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread 云展智创
Ayyoob,

Do you know what’s the cause of the following log? The agent is keeping 
running, but after a while, the server print this error, and then the command 
from the server CAN NOT be sent to the agent telling that no routes in cluster. 
Do I need to write some code in the agent to subscribe to the command topic in 
a fix interval?

TID: [-1] [] [2016-10-08 00:01:06,586]  INFO 
{org.wso2.andes.subscription.SubscriptionEngine} -  Local Subscription DELETED 
[carbon.super/fourswitchs/skxuww1q1yed/command]ID=carbon:paho/D4A884D6D87DEE2DA0:carbon.super/fourswitchs/skxuww1q1yed/command@NODEhankz/127.0.1.1/T=1475856066585/D=false/X=true/O=/E=amq.topic/ET=/EUD=1/S=false
 {org.wso2.andes.subscription.SubscriptionEngine}

--
Zhanwen Zhou (Jason)
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API Management

On Oct 8, 2016, at 11:49 AM, Ayyoob Hamza  wrote:

> 
> Hi Zhanwen,
> 
> On Fri, Oct 7, 2016 at 7:47 PM, 云展智创  wrote:
> Ayyoob,
> 
> Thanks for you reply. 
> 
>> If you change the default password then you have to change the password in 
>> set of other configuration files(given below). 
>> repository/conf/broker.xml, 
>> repository/conf/api-manager.xml,
>> repository/conf/analytics/analytics-data-config.xml
>> repository/conf/etc/webapp-authenticator-config.xml
> 
> Zhanwen: So, if I have change the admin password to the original password, I 
> don’t need to make any change to these configuration files and the IoTS will 
> run as before. Right?
> yes you dont need to change the password 
> 
>> [2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on 
>> connecting with the validation endpoint.
>> org.apache.axis2.AxisFault: Connection refused
> 
>> This error pops up because it is failing to connect to the authentication 
>> server. If you are trying this with a cluster then make sure to update the 
>> relevant configuration in the broker.xml, However if you are trying this 
>> with a single instance then there is a known intermittent issue in alpha 
>> pack which was resolved after the alpha release. So this might work after a 
>> restart.
> Zhanwen: Yes, I run the IoTS in a single instance server. Every time I 
> restarted the server, I got lots of this error message. 
> This issue is raised because the server is trying to connect to mqtt before 
> the services are up and its failing. Therefore it depends on service 
> initialisation order which could change when you restart the server. This 
> issue has been fixed in the latest pack. 
> 
>>> TID: [-1] [] [2016-10-07 15:31:55,578]  INFO 
>>> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
>>> routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
>>> cluster. Ignoring Message id 47932903411679232 
>>> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> 
>> This is not an issue, In here when a client publishes to a topic and if 
>> there aren't any subscription then it will ignore the message without 
>> persisting it. 
> 
> Zhanwen: I have created a mqtt receiver to map 
> carbon.super/fourswitchs/+/publisher to a stream, and I have many other 
> devices of the same type (fourswitchs) running which had no this problem. 
> These devices’ data were received and stored in the stream table, I could 
> confirm that through the Data Explorer. So, I think there is a subscription 
> for this message, but I don’t know why it is ignored by the backend IoTS 
> server. Do you have any advices? Thanks.
> Due to the above error the server might fail to subscribe to the topic, this 
> would lead to the data being ignored.
> 
> 
> 

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DSS] Ref cursor and Primitive data types as out parameter

2016-10-07 Thread Sebastián Pagano
i can this be accomplish with an small change at

org.wso2.carbon.dataservices.core.engine.OutputElementGroup

on execute method by


 if (!printOnceList.contains(oe)){
oe.execute(xmlWriter, params, queryLevel,
this.getParentResult().isEscapeNonPrintableChar());
}
if (oe instanceof StaticOutputElement) {
if (((StaticOutputElement) oe).isPrintOnce()){
printOnceList.add(oe);
}
}

I not sure if devs are agree with it.

Any suggestion will be apreciated!


Best regards!!


-- Forwarded message --
From: Sebastián Pagano 
Date: Fri, Oct 7, 2016 at 12:33 AM
Subject: Ref cursor and Primitive data types as out parameter
To: dev@wso2.org


Hi all,

I have the same issue that https://wso2.org/jira/browse/DS-1188, i don't
want repeat out param on every record of ref cursor. Could this be fix
adding an attribute to the element for ex "writeOnce=true"?


Best regards!
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread 云展智创
Ayyoob,

Thanks for you reply. 

> If you change the default password then you have to change the password in 
> set of other configuration files(given below). 
> repository/conf/broker.xml, 
> repository/conf/api-manager.xml,
> repository/conf/analytics/analytics-data-config.xml
> repository/conf/etc/webapp-authenticator-config.xml

Zhanwen: So, if I have change the admin password to the original password, I 
don’t need to make any change to these configuration files and the IoTS will 
run as before. Right?

> [2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on 
> connecting with the validation endpoint.
> org.apache.axis2.AxisFault: Connection refused

> This error pops up because it is failing to connect to the authentication 
> server. If you are trying this with a cluster then make sure to update the 
> relevant configuration in the broker.xml, However if you are trying this with 
> a single instance then there is a known intermittent issue in alpha pack 
> which was resolved after the alpha release. So this might work after a 
> restart.
Zhanwen: Yes, I run the IoTS in a single instance server. Every time I 
restarted the server, I got lots of this error message. 

>> TID: [-1] [] [2016-10-07 15:31:55,578]  INFO 
>> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
>> routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
>> cluster. Ignoring Message id 47932903411679232 
>> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}

> This is not an issue, In here when a client publishes to a topic and if there 
> aren't any subscription then it will ignore the message without persisting 
> it. 

Zhanwen: I have created a mqtt receiver to map 
carbon.super/fourswitchs/+/publisher to a stream, and I have many other devices 
of the same type (fourswitchs) running which had no this problem. These 
devices’ data were received and stored in the stream table, I could confirm 
that through the Data Explorer. So, I think there is a subscription for this 
message, but I don’t know why it is ignored by the backend IoTS server. Do you 
have any advices? Thanks.


--
Zhanwen Zhou (Jason)
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API Management

On Oct 7, 2016, at 5:46 PM, Ayyoob Hamza  wrote:

> Hi Jason,
> 
> If you change the default password then you have to change the password in 
> set of other configuration files(given below). 
> repository/conf/broker.xml, 
> repository/conf/api-manager.xml,
> repository/conf/analytics/analytics-data-config.xml
> repository/conf/etc/webapp-authenticator-config.xml
> 
> Please find the comments inline for the other issues.
> 
> On Fri, Oct 7, 2016 at 1:45 PM, 云展智创  wrote:
> Hi all,
> 
> I got lots of the following errors when startup. I don’t know if it is the 
> cause of the problem:
> 
> [2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on 
> connecting with the validation endpoint.
> org.apache.axis2.AxisFault: Connection refused
>   at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>   at 
> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
>   at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
>   at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
>   at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
>   at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>   at 
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
>   at 
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
>   at 
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
>   at 
> org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.validate(OAuth2TokenValidationServiceStub.java:461)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.getAuthenticationInfo(OAuth2BasedMQTTAuthenticator.java:126)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.validateToken(OAuth2BasedMQTTAuthenticator.java:82)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.checkValid(OAuth2BasedMQTTAuthenticator.java:62)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.processConnect(ProtocolProcessor.java:256)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:160)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:47)
>   at 
> com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
>   at 
> 

Re: [Dev] Get the private and public keys of a user

2016-10-07 Thread Tharindu Edirisinghe
Hi Niranda,

I've attached a sample Java class here that you can refer to get the
private key and public key. I've written this for signing a JWT but you can
use the same code segments for your scenario as well.

Thanks,
TharinduE

On Fri, Oct 7, 2016 at 8:54 AM, Danushka Fernando 
wrote:

> AFAIK SAML Token is signed using the tenant keystore. You can use the
> org.wso2.carbon.core.util.KeyStoreManager to achieve that. There are
> getDefaultPrivateKey and getDefaultPublicKey which will give you the
> default keys of the keystore.
>
> Thanks & Regards
> Danushka Fernando
> Senior Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Thu, Oct 6, 2016 at 5:38 PM, Niranda Perera  wrote:
>
>> Hi,
>>
>> I am trying to create a SAML response manually. This is a special type of
>> SAML response named SAML NameIdResponse and I am trying to set a signature
>> in it.
>>
>> I am trying to create a signature element, as mentioned here [1].
>>
>> For me to do this, I need to access the private and public keys
>> programatically.
>>
>> Could you please point me to a place where I could extract these
>> information?
>>
>> Best
>>
>> [1] http://www.programcreek.com/java-api-examples/index.php?
>> source_dir=saml-generator-master/src/main/java/com/rackspace
>> /saml/SamlAssertionProducer.java
>>
>> --
>> *Niranda Perera*
>> Software Engineer, WSO2 Inc.
>> Mobile: +94-71-554-8430
>> Twitter: @n1r44 
>> https://pythagoreanscript.wordpress.com/
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Tharindu Edirisinghe
Senior Software Engineer | WSO2 Inc
Platform Security Team
Blog : tharindue.blogspot.com
mobile : +94 775181586
package org.wso2.carbon.jwt.helper;

import org.apache.axiom.util.base64.Base64Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.core.util.KeyStoreManager;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;

import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.util.Calendar;
import java.util.concurrent.ConcurrentHashMap;

public class JWTHelper {

private static Log log = LogFactory.getLog(JWTHelper.class);

private static final String SHA256_WITH_RSA = "SHA256withRSA";
private static String signatureAlgorithm = SHA256_WITH_RSA;
private static final String NONE = "NONE";
private static volatile long ttl = -1L;

private static ConcurrentHashMap privateKeys = new ConcurrentHashMap();
private static ConcurrentHashMap publicCerts = new ConcurrentHashMap();


public static String generateJWT(String tenantDomain) throws Exception {

String jwt = buildJWT(tenantDomain);

log.info("JWT  = " + jwt);

return jwt;
}


/**
 * Method that generates the JWT.
 *
 * @return signed JWT token
 * @throws Exception
 */
private static String buildJWT(String tenantDomain) throws Exception {

//generating expiring timestamp
long currentTime = Calendar.getInstance().getTimeInMillis();
long expireIn = currentTime + 1000 * 60 * getTTL();

String jwtBody;
String issuer = "wso2.org/appserver";
int tenantId = getTenantId(tenantDomain);

//Sample JWT body
//{"iss":"wso2.org/appserver","exp":1448299984841,"tenant_domain":"wso2.com","tenant_id":"1"}

StringBuilder jwtBuilder = new StringBuilder();
jwtBuilder.append("{");
jwtBuilder.append("\"iss\":\"");
jwtBuilder.append(issuer);
jwtBuilder.append("\",");

jwtBuilder.append("\"exp\":");
jwtBuilder.append(String.valueOf(expireIn));
jwtBuilder.append(",");

jwtBuilder.append("\"tenant_domain\":\"");
jwtBuilder.append(tenantDomain);
jwtBuilder.append("\",");

jwtBuilder.append("\"tenant_id\":\"");
jwtBuilder.append(String.valueOf(tenantId));
jwtBuilder.append("\"");

jwtBuilder.append("}");
jwtBody = jwtBuilder.toString();

String jwtHeader = null;

//if signature algo==NONE, header without cert
if (signatureAlgorithm.equals(NONE)) {
jwtHeader = "{\"typ\":\"JWT\"}";
} else if (signatureAlgorithm.equals(SHA256_WITH_RSA)) {
jwtHeader = addCertToHeader(tenantDomain);
}

String base64EncodedHeader = Base64Utils.encode(jwtHeader.getBytes());
String base64EncodedBody = 

Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread Ayyoob Hamza
Hi Jason,

If you change the default password then you have to change the password in
set of other configuration files(given below).
repository/conf/broker.xml,
repository/conf/api-manager.xml,
repository/conf/analytics/analytics-data-config.xml
repository/conf/etc/webapp-authenticator-config.xml

Please find the comments inline for the other issues.

On Fri, Oct 7, 2016 at 1:45 PM, 云展智创  wrote:

> Hi all,
>
> I got lots of the following errors when startup. I don’t know if it is the
> cause of the problem:
>
> [2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on
> connecting with the validation endpoint.
> org.apache.axis2.AxisFault: Connection refused
> at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
> at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> HTTPSender.java:199)
> at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.
> writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
> at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(
> CommonsHTTPTransportSender.java:278)
> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
> at org.apache.axis2.description.OutInAxisOperationClient.send(
> OutInAxisOperation.java:430)
> at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
> OutInAxisOperation.java:225)
> at org.apache.axis2.client.OperationClient.execute(
> OperationClient.java:149)
> at org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceSt
> ub.validate(OAuth2TokenValidationServiceStub.java:461)
> at org.wso2.carbon.andes.authentication.andes.
> OAuth2BasedMQTTAuthenticator.getAuthenticationInfo(
> OAuth2BasedMQTTAuthenticator.java:126)
> at org.wso2.carbon.andes.authentication.andes.
> OAuth2BasedMQTTAuthenticator.validateToken(OAuth2BasedMQTTAuthenticator.
> java:82)
> at org.wso2.carbon.andes.authentication.andes.
> OAuth2BasedMQTTAuthenticator.checkValid(OAuth2BasedMQTTAuthenticator.
> java:62)
> at org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.
> processConnect(ProtocolProcessor.java:256)
> at org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(
> SimpleMessaging.java:160)
> at org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(
> SimpleMessaging.java:47)
> at com.lmax.disruptor.BatchEventProcessor.run(
> BatchEventProcessor.java:128)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.net.ConnectException: Connection refused
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.AbstractPlainSocketImpl.doConnect(
> AbstractPlainSocketImpl.java:350)
> at java.net.AbstractPlainSocketImpl.connectToAddress(
> AbstractPlainSocketImpl.java:206)
> at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:
> 188)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
> at java.net.Socket.connect(Socket.java:589)
> at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
> at org.apache.commons.ssl.Java14.connectSocket(Java14.java:178)
> at org.apache.commons.ssl.Java14.buildSocket(Java14.java:157)
> at org.apache.commons.ssl.JavaImpl.createSocket(JavaImpl.java:204)
> at org.apache.commons.ssl.SSL.createSocket(SSL.java:580)
> at org.apache.commons.ssl.SSLClient.createSocket(SSLClient.java:224)
> at org.apache.commons.ssl.HttpSecureProtocol.createSocket(
> HttpSecureProtocol.java:90)
> at org.apache.commons.httpclient.HttpConnection.open(
> HttpConnection.java:707)
> at org.apache.commons.httpclient.MultiThreadedHttpConnectionMan
> ager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionMan
> ager.java:1361)
> at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(
> HttpMethodDirector.java:387)
> at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(
> HttpMethodDirector.java:171)
> at org.apache.commons.httpclient.HttpClient.executeMethod(
> HttpClient.java:397)
> at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(
> AbstractHTTPSender.java:630)
> at org.apache.axis2.transport.http.HTTPSender.sendViaPost(
> HTTPSender.java:195)
> ... 18 more
>

This error pops up because it is failing to connect to the authentication
server. If you are trying this with a cluster then make sure to update the
relevant configuration in the broker.xml, However if you are trying this
with a single instance then there is a known *intermittent issue* in alpha
pack which was resolved after the alpha release. So this might work after a
restart.


> --
> Zhanwen Zhou (Jason)
> +86 13922218435
> zhanwen.z...@smartcloudex.com
> Guangzhou Smart Cloudex Technology Co., Ltd.
> Business: IOT, API Management
>
> On Oct 7, 2016, at 3:36 PM, 云展智创  wrote:
>
> Hi,
>
> Do you know how to 

Re: [Dev] [Swagger Annotations] How to set example values to property object's using swagger annotations

2016-10-07 Thread Madhawa Perera
Hi,

I raised the issue to swagger core team. Please find the issue Id below.

Issue Id: https://github.com/swagger-api/swagger-core/issues/1964

Thank you
Best Regards,
Madhawa

On Fri, Oct 7, 2016 at 12:28 PM, Madhawa Perera  wrote:

> Added dev@wso2.org and remove engineering
>
> On Fri, Oct 7, 2016 at 12:18 PM, Praminda Jayawardana 
> wrote:
>
>> Hi All,
>>
>> Madhawa is having following issue with his API Implementation.
>>
>> He has an API Model which contains another API Model (nested). In the
>> swagger definition file generated for his web app implementation, annotated
>> example values are available for outer API Model's properties. But
>> annotated example values for nested API Model's  properties are not
>> available.
>>
>> After an offline discussion with Madhawa we came into a conclusion that
>> this might be an issue in swagger-core.
>> Madhawa will raise an issue to swagger core team on this.
>>
>> Thanks,
>> Praminda
>>
>> On Fri, Oct 7, 2016 at 10:46 AM, Madhawa Perera 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm trying to add example values to property object's in swagger
>>> annotations.
>>>
>>> There I'm trying to create the following json schema with some example
>>> values, on Swagger UI. In here, please note that "count" is an integer (I
>>> was able to set an example value to that successfully) and "activities" is
>>> an object. Both these are attributes inside the class "ListActivity".
>>>
>>> {
>>> *"count": 1,*
>>> "*activities*": [{
>>> *"activityId": "string",*
>>> "code": "string",
>>> "createdTimeStamp": "string",
>>> "activityStatus": [{
>>> "deviceIdentifier": {
>>> "id": "string",
>>> "type": "string"
>>> },
>>> "responses": [{
>>> "response": "string",
>>> "receivedTimeStamp": "string"
>>> }],
>>> "updatedTimestamp": "string"
>>> }]
>>> }]
>>> }
>>>
>>> In the above schema, what I wanted to do is instead of keeping "string"
>>> as the values, I need to add example values. Like
>>> *"activityId":"ACTIVITY_1"* instead of "activityId":"string" For that
>>> I'm using following swagger annotations.
>>>
>>> "ListActivity" class is annotated with "@ApiModel" as below.
>>>
>>> @ApiModel(
>>> value = "List of activities",
>>> description = "This contains a set of activities that
>>> matches a given criteria as a collection")
>>> *public class ActivityList*
>>>
>>> Inside the "ListActivity" class I'm defining the model properties using
>>> "@ApiModelProperty" annotation as below.
>>>
>>>  @ApiModelProperty(
>>> value = "Number of total resources.",
>>> *example = "1"*)
>>>  @JsonProperty("count")
>>>  private int *count*;
>>>
>>> @ApiModelProperty(
>>> value = "Returns the list of activities that match the
>>> offset and limit parameter values that were specified.")
>>> @JsonProperty("activities")
>>> private List *activities*;
>>>
>>> Since "Activity" is an object, I'm again creates a model inside the
>>> "Activity" class. I'm annotating it as below.
>>>
>>> @ApiModel(
>>>   value = "Activity",
>>>  description = "An activity instance carries a unique identifier
>>> that can be used to identify a particular operation instance uniquely")
>>> *public class Activity*
>>>
>>> Inside "Activity" class, I'm again defining the model properties as
>>> below.
>>>
>>> @ApiModelProperty(
>>> name = "*activityId*",
>>> value = "Activity identifier",
>>> required = true,
>>> *example = "ACTIVITY_1*")
>>> @JsonProperty("activityId")
>>> private String *activityId*;
>>>
>>> @ApiModelProperty(
>>> name = "code",
>>> value = "Activity code",
>>> required = true,
>>> example = "DEVICE_RING")
>>> @JsonProperty("code")
>>> private String code;
>>>
>>> After that I'm generating the swagger.json file. In the generated file,
>>> example values were set to only to the attribute "count" as I gien in the
>>> annotations. That means the "count" attribute's value is set to "1" as I
>>> annotated. But the all the example values that I set inside the "Activity"
>>> class does not come to the generated swagger.json file. Instead it only
>>> shows "type": "string". Therefore in the swagger UI, i'm getting a json
>>> schema as shown above (Please refer the json shown at the beginning of this
>>> email) with only "count" is set to "1" and other keys are set with their
>>> data types.
>>>
>>> The json generated has the following format.
>>>
>>>  "*List of activities*": {
>>>  "type": "object",
>>>  "properties": {
>>> "*count*": {
>>>"type": "integer",
>>>"format": "int32",
>>>"*example": 1*, *(example values are set here as given
>>> in the annotations)*
>>>"description": "Number of total resources."
>>> },
>>>
>>> "activities": {
>>>"type": "array",
>>>

Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread 云展智创
Hi all,

Could anyone help me? Thanks.

Another error in wsocarbon.log:

[2016-10-07 16:07:27,876] ERROR - OAuth2BasedMQTTAuthenticator Error on 
connecting with the validation endpoint.
org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found
at 
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:331)
at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:196)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at 
org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.validate(OAuth2TokenValidationServiceStub.java:461)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.getAuthenticationInfo(OAuth2BasedMQTTAuthenticator.java:126)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.validateToken(OAuth2BasedMQTTAuthenticator.java:82)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.checkValid(OAuth2BasedMQTTAuthenticator.java:62)
at 
org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.processConnect(ProtocolProcessor.java:256)
at 
org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:160)
at 
org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:47)
at 
com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

--
Zhanwen Zhou (Jason)
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API Management

On Oct 7, 2016, at 4:15 PM, 云展智创  wrote:

> Hi all,
> 
> I got lots of the following errors when startup. I don’t know if it is the 
> cause of the problem:
> 
> [2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on 
> connecting with the validation endpoint.
> org.apache.axis2.AxisFault: Connection refused
>   at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>   at 
> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
>   at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
>   at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
>   at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
>   at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>   at 
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
>   at 
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
>   at 
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
>   at 
> org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.validate(OAuth2TokenValidationServiceStub.java:461)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.getAuthenticationInfo(OAuth2BasedMQTTAuthenticator.java:126)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.validateToken(OAuth2BasedMQTTAuthenticator.java:82)
>   at 
> org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.checkValid(OAuth2BasedMQTTAuthenticator.java:62)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.processConnect(ProtocolProcessor.java:256)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:160)
>   at 
> org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:47)
>   at 
> com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> Caused by: java.net.ConnectException: Connection refused
>   at java.net.PlainSocketImpl.socketConnect(Native 

Re: [Dev] Is OAuth Mediator Specific to WSO2 IS

2016-10-07 Thread Farasath Ahamed
I think it can only be used with Identity Server. Checked the code[1], it
is consuming the SOAP services exposed by IS[2] which we cannot expect from
any OAuth provider.


[1]
https://github.com/wso2/carbon-mediation/tree/master/components/mediators/oauth/org.wso2.carbon.identity.oauth.mediator/src/main/java/org/wso2/carbon/identity/oauth/mediator

[2]
https://github.com/wso2/carbon-mediation/blob/master/components/mediators/oauth/org.wso2.carbon.identity.oauth.mediator/src/main/java/org/wso2/carbon/identity/oauth/mediator/OAuth2TokenValidationServiceClient.java#L31

Farasath Ahamed
Software Engineer, WSO2 Inc.; http://wso2.com
Mobile: +94777603866
Blog: blog.farazath.com
Twitter: @farazath619 




On Fri, Oct 7, 2016 at 1:26 PM, Isuru Haththotuwa  wrote:

> Hi Devs,
>
> $subject? [1] Can it be used with any OAuth provider?
>
> [1]. https://docs.wso2.com/display/ESB500/OAuth+Mediator
>
> --
> Thanks and Regards,
>
> Isuru H.
> +94 716 358 048* *
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread 云展智创
Hi all,

I got lots of the following errors when startup. I don’t know if it is the 
cause of the problem:

[2016-10-07 16:07:26,944] ERROR - OAuth2BasedMQTTAuthenticator Error on 
connecting with the validation endpoint.
org.apache.axis2.AxisFault: Connection refused
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at 
org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub.validate(OAuth2TokenValidationServiceStub.java:461)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.getAuthenticationInfo(OAuth2BasedMQTTAuthenticator.java:126)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.validateToken(OAuth2BasedMQTTAuthenticator.java:82)
at 
org.wso2.carbon.andes.authentication.andes.OAuth2BasedMQTTAuthenticator.checkValid(OAuth2BasedMQTTAuthenticator.java:62)
at 
org.dna.mqtt.moquette.messaging.spi.impl.ProtocolProcessor.processConnect(ProtocolProcessor.java:256)
at 
org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:160)
at 
org.dna.mqtt.moquette.messaging.spi.impl.SimpleMessaging.onEvent(SimpleMessaging.java:47)
at 
com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
at org.apache.commons.ssl.Java14.connectSocket(Java14.java:178)
at org.apache.commons.ssl.Java14.buildSocket(Java14.java:157)
at org.apache.commons.ssl.JavaImpl.createSocket(JavaImpl.java:204)
at org.apache.commons.ssl.SSL.createSocket(SSL.java:580)
at org.apache.commons.ssl.SSLClient.createSocket(SSLClient.java:224)
at 
org.apache.commons.ssl.HttpSecureProtocol.createSocket(HttpSecureProtocol.java:90)
at 
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at 
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at 
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at 
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at 
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:630)
at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
... 18 more


--
Zhanwen Zhou (Jason)
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API Management

On Oct 7, 2016, at 3:36 PM, 云展智创  wrote:

> Hi,
> 
> Do you know how to find the message routing map int he cluster? Could you 
> give me some advices on how to solve the below problems.
> 
> TID: [-1] [] [2016-10-07 15:31:55,578]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
> cluster. Ignoring Message id 47932903411679232 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> TID: [-1] [] [2016-10-07 15:31:55,724]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
> cluster. Ignoring 

[Dev] Is OAuth Mediator Specific to WSO2 IS

2016-10-07 Thread Isuru Haththotuwa
Hi Devs,

$subject? [1] Can it be used with any OAuth provider?

[1]. https://docs.wso2.com/display/ESB500/OAuth+Mediator

-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IoTS] Errors after change the admin password and restart the IoTS server - No routes in cluster. Ignoring Message

2016-10-07 Thread 云展智创
Hi,

Do you know how to find the message routing map int he cluster? Could you give 
me some advices on how to solve the below problems.

TID: [-1] [] [2016-10-07 15:31:55,578]  INFO 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
cluster. Ignoring Message id 47932903411679232 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
TID: [-1] [] [2016-10-07 15:31:55,724]  INFO 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
cluster. Ignoring Message id 47932903449952256 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
TID: [-1] [] [2016-10-07 15:31:55,724]  INFO 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
cluster. Ignoring Message id 47932903449952257 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
TID: [-1] [] [2016-10-07 15:31:55,725]  INFO 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
routing key: carbon.super/fourswitchs/t4flqyju95ye/publisher No routes in 
cluster. Ignoring Message id 47932903450214400 
{org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}


--
Zhanwen Zhou (Jason)
+86 13922218435
zhanwen.z...@smartcloudex.com
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT,API Management

On Oct 5, 2016, at 11:11 PM, 云展智创  wrote:

> Hi all,
> 
> I got these errors after I change the admin password and back to the origin 
> password and restart the IoTS server again. I confirmed that I had create 
> streams to process these messages in the topics. 
> 
> Could anybody help me? Thanks. 
> 
> TID: [-1] [] [2016-10-05 21:51:12,838]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/thgsensors/1ibc0sz4yxsfr/command No routes in 
> cluster. Ignoring Message id 47893570607644672 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> TID: [-1] [] [2016-10-05 21:52:47,340]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/thgsensors/rl7wme4wjw4j/command No routes in 
> cluster. Ignoring Message id 47893595380776960 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> TID: [-1] [] [2016-10-05 21:54:57,263]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/fourswitchs/1ibhl22d1zzg6/command No routes in 
> cluster. Ignoring Message id 47893629439311872 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> 
> TID: [-1] [] [2016-10-05 22:56:16,659]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/thgsensors/1iuy87wofrv3n/bee No routes in cluster. 
> Ignoring Message id 47894593970896898 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> TID: [-1] [] [2016-10-05 22:56:44,202]  INFO 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor} -  Message 
> routing key: carbon.super/thgsensors/1iuy87wofrv3n/alert No routes in 
> cluster. Ignoring Message id 47894601191129088 
> {org.wso2.andes.kernel.disruptor.inbound.MessagePreProcessor}
> 
> --
> Zhanwen Zhou (Jason)
> +86 13922218435
> zhanwen.z...@smartcloudex.com
> Guangzhou Smart Cloudex Technology Co., Ltd.
> Business: IOT, API Management
> 
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Swagger Annotations] How to set example values to property object's using swagger annotations

2016-10-07 Thread Madhawa Perera
Added dev@wso2.org and remove engineering

On Fri, Oct 7, 2016 at 12:18 PM, Praminda Jayawardana 
wrote:

> Hi All,
>
> Madhawa is having following issue with his API Implementation.
>
> He has an API Model which contains another API Model (nested). In the
> swagger definition file generated for his web app implementation, annotated
> example values are available for outer API Model's properties. But
> annotated example values for nested API Model's  properties are not
> available.
>
> After an offline discussion with Madhawa we came into a conclusion that
> this might be an issue in swagger-core.
> Madhawa will raise an issue to swagger core team on this.
>
> Thanks,
> Praminda
>
> On Fri, Oct 7, 2016 at 10:46 AM, Madhawa Perera  wrote:
>
>> Hi,
>>
>> I'm trying to add example values to property object's in swagger
>> annotations.
>>
>> There I'm trying to create the following json schema with some example
>> values, on Swagger UI. In here, please note that "count" is an integer (I
>> was able to set an example value to that successfully) and "activities" is
>> an object. Both these are attributes inside the class "ListActivity".
>>
>> {
>> *"count": 1,*
>> "*activities*": [{
>> *"activityId": "string",*
>> "code": "string",
>> "createdTimeStamp": "string",
>> "activityStatus": [{
>> "deviceIdentifier": {
>> "id": "string",
>> "type": "string"
>> },
>> "responses": [{
>> "response": "string",
>> "receivedTimeStamp": "string"
>> }],
>> "updatedTimestamp": "string"
>> }]
>> }]
>> }
>>
>> In the above schema, what I wanted to do is instead of keeping "string"
>> as the values, I need to add example values. Like
>> *"activityId":"ACTIVITY_1"* instead of "activityId":"string" For that
>> I'm using following swagger annotations.
>>
>> "ListActivity" class is annotated with "@ApiModel" as below.
>>
>> @ApiModel(
>> value = "List of activities",
>> description = "This contains a set of activities that matches
>> a given criteria as a collection")
>> *public class ActivityList*
>>
>> Inside the "ListActivity" class I'm defining the model properties using
>> "@ApiModelProperty" annotation as below.
>>
>>  @ApiModelProperty(
>> value = "Number of total resources.",
>> *example = "1"*)
>>  @JsonProperty("count")
>>  private int *count*;
>>
>> @ApiModelProperty(
>> value = "Returns the list of activities that match the offset
>> and limit parameter values that were specified.")
>> @JsonProperty("activities")
>> private List *activities*;
>>
>> Since "Activity" is an object, I'm again creates a model inside the
>> "Activity" class. I'm annotating it as below.
>>
>> @ApiModel(
>>   value = "Activity",
>>  description = "An activity instance carries a unique identifier
>> that can be used to identify a particular operation instance uniquely")
>> *public class Activity*
>>
>> Inside "Activity" class, I'm again defining the model properties as
>> below.
>>
>> @ApiModelProperty(
>> name = "*activityId*",
>> value = "Activity identifier",
>> required = true,
>> *example = "ACTIVITY_1*")
>> @JsonProperty("activityId")
>> private String *activityId*;
>>
>> @ApiModelProperty(
>> name = "code",
>> value = "Activity code",
>> required = true,
>> example = "DEVICE_RING")
>> @JsonProperty("code")
>> private String code;
>>
>> After that I'm generating the swagger.json file. In the generated file,
>> example values were set to only to the attribute "count" as I gien in the
>> annotations. That means the "count" attribute's value is set to "1" as I
>> annotated. But the all the example values that I set inside the "Activity"
>> class does not come to the generated swagger.json file. Instead it only
>> shows "type": "string". Therefore in the swagger UI, i'm getting a json
>> schema as shown above (Please refer the json shown at the beginning of this
>> email) with only "count" is set to "1" and other keys are set with their
>> data types.
>>
>> The json generated has the following format.
>>
>>  "*List of activities*": {
>>  "type": "object",
>>  "properties": {
>> "*count*": {
>>"type": "integer",
>>"format": "int32",
>>"*example": 1*, *(example values are set here as given in
>> the annotations)*
>>"description": "Number of total resources."
>> },
>>
>> "activities": {
>>"type": "array",
>>"description": "Returns the list of activities that match
>> the offset and limit parameter values that were specified.",
>>"items": {
>>   "$ref": "#/definitions/Activity"
>>}
>> }
>>  },
>>  "description": "This contains a set of activities that matches a
>> given criteria as a collection"
>> },
>>
>>
>> "*Activity*": 

Re: [Dev] [EMM] Registry Exception thrown at EMM publisher/store login

2016-10-07 Thread Dinusha Senanayaka
This happens because two different products trying to share the same config
registry and having conflicting resources.  If products are deployed
separately then we can mount config registry to different paths, but here
EMM needs both features to be install in same product.

One option would be to prefix the resource with product name, so that
resource path will be different. But this won't look nice from product
perspective. Also need migration client for existing users if we are doing
it now.
eg: /_system/config/repository/components/org.wso2.carbon.registry/queries/
*tag-summary-appmgt*

@Nuwan: Any ideas ?

Regards,
Dinusha.

On Thu, Oct 6, 2016 at 3:18 PM, Kamidu Punchihewa  wrote:

> Hi Sameera,
>
> This is a know issue with EMM 2.2.0-beta pack. You can track the progress
> of the issue by following the Jira ticket[1].
>
> [1] https://wso2.org/jira/browse/EMM-1669
>
> Thanks and Best Regards,
>
> Kamidu Sachith Punchihewa
> *Software Engineer*
> WSO2, Inc.
> lean . enterprise . middleware
> Mobile : +94 (0) 770566749 <%2B94%20%280%29%20773%20451194>
>
>
> Disclaimer: This communication may contain privileged or other
> confidential information and is intended exclusively for the addressee/s.
> If you are not the intended recipient/s, or believe that you may have
> received this communication in error, please reply to the sender indicating
> that fact and delete the copy you received and in addition, you should not
> print, copy, retransmit, disseminate, or otherwise use the information
> contained in this communication. Internet communications cannot be
> guaranteed to be timely, secure, error or virus-free. The sender does not
> accept liability for any errors or omissions.
>
> On Thu, Oct 6, 2016 at 3:14 PM, Sameera Gunarathne 
> wrote:
>
>> Hi all,
>>
>> After login to the EMM app publisher/store we can see the following
>> error:
>>
>> [2016-10-03 13:51:00,155] ERROR 
>> {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry}
>> -  Registry Exception occurred while executing the query
>> org.wso2.carbon.registry.core.exceptions.RegistryException: Invalid
>> value "8" for parameter "parameterIndex" [90008-175]
>> at org.wso2.carbon.registry.core.jdbc.dataaccess.SQLQueryProces
>> sor.executeQuery(SQLQueryProcessor.java:239)
>> at org.wso2.carbon.registry.core.jdbc.queries.QueryProcessorMan
>> ager.executeQuery(QueryProcessorManager.java:137)
>> at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.executeQ
>> uery(EmbeddedRegistry.java:2283)
>> at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.ex
>> ecuteQuery(CacheBackedRegistry.java:480)
>> at org.wso2.carbon.registry.core.session.UserRegistry.executeQu
>> eryInternal(UserRegistry.java:1757)
>> at org.wso2.carbon.registry.core.session.UserRegistry.access$35
>> 00(UserRegistry.java:61)
>> at org.wso2.carbon.registry.core.session.UserRegistry$36.run(Us
>> erRegistry.java:1705)
>> at org.wso2.carbon.registry.core.session.UserRegistry$36.run(Us
>> erRegistry.java:1702)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at org.wso2.carbon.registry.core.session.UserRegistry.executeQu
>> ery(UserRegistry.java:1702)
>> at org.wso2.carbon.appmgt.impl.APIConsumerImpl.getAllTags(APICo
>> nsumerImpl.java:843)
>> at 
>> org.wso2.carbon.appmgt.impl.UserAwareAPIConsumer.getAllTags(UserAwareAPIConsumer.java:39)
>> ..
>>
>> After some debugging it seems to be both APIM feature and APPM feature
>> trying to execute same query at the registry path /_system/config/repositor
>> y/components/org.wso2.carbon.registry/queries/tag-summary [1]. Since
>> they are different queries [2] & [3] when loading the APPM publisher/store
>> components it triggers this error. Then I built carbon-appmgt locally by
>> giving a different path to store query scripts. Then the issue is fixed.
>> Seems like if it can be done to either of the components this issue can be
>> fixed. Any help or suggestions highly appreciated.
>>
>> [1]
>>
>> [2] - https://github.com/wso2/carbon-apimgt/blob/d37855ec3551c97
>> c70166d990504801b2d72d18b/components/apimgt/org.wso2.
>> carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/
>> impl/AbstractAPIManager.java#L210
>>
>> [3] - https://github.com/wso2/carbon-appmgt/blob/master/componen
>> ts/org.wso2.carbon.appmgt.impl/src/main/java/org/wso2/
>> carbon/appmgt/impl/AbstractAPIManager.java#L152
>>
>> Thanks & Regards,
>> --
>> Sameera Gunarathne
>> Software Engineer, WSO2 Inc. http://wso2.com
>> 
>> Email: samee...@wso2.com
>> Mobile: +94714155561
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Dinusha Dilrukshi
Associate Technical Lead
WSO2 Inc.: http://wso2.com/
Mobile: +94725255071
Blog: