Re: [Dev] NTask coordination issue while cleaning up a Task

2015-02-28 Thread Anjana Fernando
Hi Ravindra,

As I mentioned in our earlier f2f chat also, there is no such listener
mechanism supported in ntask, even though it is supported in Quartz, for
local servers. NTask has a very specific set of features, for distributed
task scheduling, nothing else. And your requirement wasn't one of them. So
we may consider implementing it in the future if it makes sense for
multiple users of the feature, but not now, specially not in a hurry.
Because we have to carefully check the usage and implement/test it
properly. So for now at least, implement your scenario using cluster
messaging, by notifying the required nodes of the state change.

Cheers,
Anjana.

On Fri, Feb 27, 2015 at 5:57 PM, Ravindra Ranwala ravin...@wso2.com wrote:


 Hi Anjana,

 Currently we are implementing Message store - Message processor
 coordination support for ESB in worker-manager cluster mode. When a task is
 deactivated some housekeeping work needs to be done. For an example
 cleaning up JMS consumers etc. Quartz supports several types of Listeners
 which can be registered to get the notifications. But we could not see such
 a listener in our ntask core implementation. An example scenario which
 emphasizes this requirement is given below.


 Suppose that the cluster has one manager and two worker nodes at the
 moment where one message processor is running in one worker. This task is
 having a JMS connection in order to consume JMS messages from a queue. When
 the deactivation occurs in the manager node, the JMS connection is not
 teared off properly in all worker nodes where it runs. Even Though the task
 is deactivated this shows that there is one JMS consumer for the queue and
 which is not the expected behaviour. Is there any support/hook in your
 platform to get this done.





 Thanks  Regards,
 --
 Ravindra Ranwala
 Software Engineer
 WSO2, Inc: http://wso2.com
 http://www.google.com/url?q=http%3A%2F%2Fwso2.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg
 Mobile: +94714198770




-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Ntask throws ResourceNotFoundException when using with different tenants

2015-02-28 Thread Shafreen Anfar
Hi Anjana,

This [1] happens when we schedule tasks with different tenants. When I dug
deep I saw that tasks try to update its state to FINISH state using
TriggerListeners. I believe this is where the problem is. It seems the last
registered listener is getting notified for all the tasks. I think it is
because we are not using a matcher, the registered listener receives events
for all the triggers [2].

Therefore, I changed the code as in the attached diff and I could not
observe the issue any more. When I debugged I could see that all the task's
states are getting updated properly. Can you please help us on this matter ?

[1]

org.wso2.carbon.ntask.common.TaskException: The task 'super_tenent' does
not exist
at
org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:310)
at
org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.setTaskMetadataProp(RegistryBasedTaskRepository.java:323)
at org.wso2.carbon.ntask.core.TaskUtils.setTaskState(TaskUtils.java:109)
at org.wso2.carbon.ntask.core.TaskUtils.setTaskFinished(TaskUtils.java:146)
at
org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager$TaskTriggerListener.triggerComplete(AbstractQuartzTaskManager.java:424)
at
org.quartz.core.QuartzScheduler.notifyTriggerListenersComplete(QuartzScheduler.java:1876)
at
org.quartz.core.JobRunShell.notifyTriggerListenersComplete(JobRunShell.java:377)
at org.quartz.core.JobRunShell.run(JobRunShell.java:254)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by:
*org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException*:
Resource does not exist at path
/_system/governance/repository/components/org.wso2.carbon.tasks/definitions/1/ESB_TASK/super_tenent
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:532)
at
org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getGhostResourceFromCache(CacheBackedRegistry.java:194)
at
org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:167)
at
org.wso2.carbon.registry.core.session.UserRegistry.getInternal(UserRegistry.java:613)
at
org.wso2.carbon.registry.core.session.UserRegistry.access$400(UserRegistry.java:60)
at
org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:596)
at
org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:593)
at java.security.AccessController.doPrivileged(Native Method)
at
org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:593)
at
org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:306)
... 12 more

[2]
http://quartz-scheduler.org/api/2.2.0/org/quartz/ListenerManager.html#addTriggerListener(org.quartz.TriggerListener)

-- 
Regards,
*Shafreen*
Software Engineer
WSO2 Inc
Mobile : 077-556-395-1
diff --git 
a/components/ntask/org.wso2.carbon.ntask.core/src/main/java/org/wso2/carbon/ntask/core/impl/AbstractQuartzTaskManager.java
 
b/components/ntask/org.wso2.carbon.ntask.core/src/main/java/org/wso2/carbon/ntask/core/impl/AbstractQuartzTaskManager.java
index 8bc2521..56eddce 100644
--- 
a/components/ntask/org.wso2.carbon.ntask.core/src/main/java/org/wso2/carbon/ntask/core/impl/AbstractQuartzTaskManager.java
+++ 
b/components/ntask/org.wso2.carbon.ntask.core/src/main/java/org/wso2/carbon/ntask/core/impl/AbstractQuartzTaskManager.java
@@ -20,6 +20,7 @@ import org.apache.commons.logging.LogFactory;
 import org.quartz.*;
 import org.quartz.Trigger.TriggerState;
 import org.quartz.impl.matchers.GroupMatcher;
+import org.quartz.impl.matchers.KeyMatcher;
 import org.quartz.spi.OperableTrigger;
 import org.wso2.carbon.context.PrivilegedCarbonContext;
 import org.wso2.carbon.ntask.common.TaskConstants;
@@ -53,11 +54,6 @@ public abstract class AbstractQuartzTaskManager implements 
TaskManager {
 public AbstractQuartzTaskManager(TaskRepository taskRepository) throws 
TaskException {
 this.taskRepository = taskRepository;
 this.scheduler = TasksDSComponent.getScheduler();
-try {
-this.getScheduler().getListenerManager().addTriggerListener(new 
TaskTriggerListener(TASK_TRIGGER_LISTENER_NAME)) ;
-} catch (SchedulerException e) {
-throw new TaskException(Error in initiating task trigger 
listener, Code.UNKNOWN, e);
-}
 }
 
 public TaskRepository getTaskRepository() {
@@ -206,6 +202,15 @@ public abstract class AbstractQuartzTaskManager implements 
TaskManager {
 JobDetail job = JobBuilder.newJob(jobClass).withIdentity(taskName, 
taskGroup).usingJobData(
 this.getJobDataMapFromTaskInfo(taskInfo)).build();
 

Re: [Dev] Ntask throws ResourceNotFoundException when using with different tenants

2015-02-28 Thread Anjana Fernando
Hi Shafreen,

Yeah, that's a bug! .. good catch. The issue is, as you said, we just
having a singe TriggerListener for all the tenants/task-types, where we
should actually be having a single TriggerListener for one TaskManager (per
tenant/task-type). So the correct fix is registering a matcher in the
current code, in the constructor to give the matcher. I've fixed this in
GitHub now, with this commit [1]. Please check and verify.

[1]
https://github.com/wso2/carbon-commons/commit/5df4e830bb7d93d0a85085a5ff21e98d65b88283

Cheers,
Anjana.

On Sat, Feb 28, 2015 at 4:21 PM, Shafreen Anfar shafr...@wso2.com wrote:

 Hi Anjana,

 This [1] happens when we schedule tasks with different tenants. When I dug
 deep I saw that tasks try to update its state to FINISH state using
 TriggerListeners. I believe this is where the problem is. It seems the last
 registered listener is getting notified for all the tasks. I think it is
 because we are not using a matcher, the registered listener receives events
 for all the triggers [2].

 Therefore, I changed the code as in the attached diff and I could not
 observe the issue any more. When I debugged I could see that all the task's
 states are getting updated properly. Can you please help us on this matter ?

 [1]

 org.wso2.carbon.ntask.common.TaskException: The task 'super_tenent' does
 not exist
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:310)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.setTaskMetadataProp(RegistryBasedTaskRepository.java:323)
 at org.wso2.carbon.ntask.core.TaskUtils.setTaskState(TaskUtils.java:109)
 at org.wso2.carbon.ntask.core.TaskUtils.setTaskFinished(TaskUtils.java:146)
 at
 org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager$TaskTriggerListener.triggerComplete(AbstractQuartzTaskManager.java:424)
 at
 org.quartz.core.QuartzScheduler.notifyTriggerListenersComplete(QuartzScheduler.java:1876)
 at
 org.quartz.core.JobRunShell.notifyTriggerListenersComplete(JobRunShell.java:377)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:254)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 Caused by:
 *org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException*:
 Resource does not exist at path
 /_system/governance/repository/components/org.wso2.carbon.tasks/definitions/1/ESB_TASK/super_tenent
 at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:532)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getGhostResourceFromCache(CacheBackedRegistry.java:194)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:167)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.getInternal(UserRegistry.java:613)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.access$400(UserRegistry.java:60)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:596)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:593)
 at java.security.AccessController.doPrivileged(Native Method)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:593)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:306)
 ... 12 more

 [2]
 http://quartz-scheduler.org/api/2.2.0/org/quartz/ListenerManager.html#addTriggerListener(org.quartz.TriggerListener)

 --
 Regards,
 *Shafreen*
 Software Engineer
 WSO2 Inc
 Mobile : 077-556-395-1




-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Reformatted user.api and user.core code for indentation and imports

2015-02-28 Thread Johann Nallathamby
$subject please.

[1] svn revision: 211611
[2] https://github.com/wso2/carbon4-kernel/pull/152

-- 
Thanks  Regards,

*Johann Dilantha Nallathamby*
Associate Technical Lead  Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+9476950*
Blog - *http://nallaa.wordpress.com http://nallaa.wordpress.com*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Please review and mergr PR for IDENTITY-3028

2015-02-28 Thread Johann Nallathamby
Please find comments on PR.

On Fri, Feb 27, 2015 at 11:53 AM, Nuwandi Wickramasinghe nuwan...@wso2.com
wrote:

 Please check updated PR in [1]

 [1] https://github.com/wso2/carbon-identity/pull/102

 Thanks

 On Thu, Feb 26, 2015 at 2:40 PM, Nuwandi Wickramasinghe nuwan...@wso2.com
  wrote:

 Hi,

 Code review feedback can be found in [1]

 [1]
 https://docs.google.com/a/wso2.com/document/d/1KGYP_yX3gXe3HuZmnkjNfnaJCpHsW2bOFoFlnaFLDXE

 On Wed, Feb 25, 2015 at 4:46 PM, Nuwandi Wickramasinghe 
 nuwan...@wso2.com wrote:

 Hi,

 Please find the fix for [1] in PR [2]

 Thanks

 [1] https://wso2.org/jira/browse/IDENTITY-3028
 [2] https://github.com/wso2/carbon-identity/pull/102

 --

 Best Regards,

 Nuwandi Wickramasinghe

 Software Engineer

 WSO2 Inc.

 Web : http://wso2.com

 Mobile : 0719214873




 --

 Best Regards,

 Nuwandi Wickramasinghe

 Software Engineer

 WSO2 Inc.

 Web : http://wso2.com

 Mobile : 0719214873




 --

 Best Regards,

 Nuwandi Wickramasinghe

 Software Engineer

 WSO2 Inc.

 Web : http://wso2.com

 Mobile : 0719214873




-- 
Thanks  Regards,

*Johann Dilantha Nallathamby*
Associate Technical Lead  Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+9476950*
Blog - *http://nallaa.wordpress.com http://nallaa.wordpress.com*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] NTask coordination issue while cleaning up a Task

2015-02-28 Thread Malaka Silva
Hi Ravindra,

The deactivation happens from Message Processor. User won't be deactivating
the task.

Can't we close the connection at MP level rather than Task level?


On Sat, Feb 28, 2015 at 3:16 PM, Anjana Fernando anj...@wso2.com wrote:

 Hi Ravindra,

 As I mentioned in our earlier f2f chat also, there is no such listener
 mechanism supported in ntask, even though it is supported in Quartz, for
 local servers. NTask has a very specific set of features, for distributed
 task scheduling, nothing else. And your requirement wasn't one of them. So
 we may consider implementing it in the future if it makes sense for
 multiple users of the feature, but not now, specially not in a hurry.
 Because we have to carefully check the usage and implement/test it
 properly. So for now at least, implement your scenario using cluster
 messaging, by notifying the required nodes of the state change.

 Cheers,
 Anjana.

 On Fri, Feb 27, 2015 at 5:57 PM, Ravindra Ranwala ravin...@wso2.com
 wrote:


 Hi Anjana,

 Currently we are implementing Message store - Message processor
 coordination support for ESB in worker-manager cluster mode. When a task is
 deactivated some housekeeping work needs to be done. For an example
 cleaning up JMS consumers etc. Quartz supports several types of Listeners
 which can be registered to get the notifications. But we could not see such
 a listener in our ntask core implementation. An example scenario which
 emphasizes this requirement is given below.


 Suppose that the cluster has one manager and two worker nodes at the
 moment where one message processor is running in one worker. This task is
 having a JMS connection in order to consume JMS messages from a queue. When
 the deactivation occurs in the manager node, the JMS connection is not
 teared off properly in all worker nodes where it runs. Even Though the task
 is deactivated this shows that there is one JMS consumer for the queue and
 which is not the expected behaviour. Is there any support/hook in your
 platform to get this done.





 Thanks  Regards,
 --
 Ravindra Ranwala
 Software Engineer
 WSO2, Inc: http://wso2.com
 http://www.google.com/url?q=http%3A%2F%2Fwso2.comsa=Dsntz=1usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg
 Mobile: +94714198770




 --
 *Anjana Fernando*
 Senior Technical Lead
 WSO2 Inc. | http://wso2.com
 lean . enterprise . middleware

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




-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
http://wso2.com/about/team/malaka-silva/

Save a tree -Conserve nature  Save the world for your future. Print this
email only if it is absolutely necessary.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] OAuthServerConfiguration implementation

2015-02-28 Thread Johann Nallathamby
Looks its an error. Only successfully initialized handlers should be added
to the list. For the ones that failed we have to log the error and continue
initializing the rest.

On Sat, Feb 28, 2015 at 11:17 PM, Nuwandi Wickramasinghe nuwan...@wso2.com
wrote:

 Hi,

 Is there any particular reason for hiding some exceptions
 in OAuthServerConfiguration class? For an example,

 *public ListClientAuthenticationHandler
 getSupportedClientAuthHandlers() {*
 *if (supportedClientAuthHandlers == null) {*
 *synchronized (this) {*
 *if (supportedClientAuthHandlers == null) {*
 *supportedClientAuthHandlers = new
 ArrayListClientAuthenticationHandler();*
 *for (String entry :
 supportedClientAuthHandlerClassNames) {*
 *ClientAuthenticationHandler
 clientAuthenticationHandler = null;*
 *try {*
 *clientAuthenticationHandler =
 (ClientAuthenticationHandler) Class.forName(entry).newInstance();*
 *clientAuthenticationHandler.init();*
 *} catch (InstantiationException e) {*
 *log.error(Error instantiating  + entry);*
 *} catch (IllegalAccessException e) {*
 *log.error(Illegal access to  + entry);*
 *} catch (ClassNotFoundException e) {*
 *log.error(Cannot find class:  + entry);*
 *} catch (IdentityOAuth2Exception e) {*
 *log.error(Error while initializing  +
 entry);*
 *}*
 *
 supportedClientAuthHandlers.add(clientAuthenticationHandler);*
 *}*
 *}*
 *}*
 *}*
 *return supportedClientAuthHandlers;*
 *}*



 Returned *supportedClientAuthHandlers *has a potential of
 a NullPointerException in run time.

 --

 Best Regards,

 Nuwandi Wickramasinghe

 Software Engineer

 WSO2 Inc.

 Web : http://wso2.com

 Mobile : 0719214873




-- 
Thanks  Regards,

*Johann Dilantha Nallathamby*
Associate Technical Lead  Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+9476950*
Blog - *http://nallaa.wordpress.com http://nallaa.wordpress.com*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Problem with sending Attachment in Gmail API

2015-02-28 Thread Malaka Silva
Hi

Can we do similar approach to dropbox [1]?

Here we are just passing the request MTOM attachment to api.

[1]
https://github.com/wso2/esb-connectors/blob/master/dropbox/dropbox-connector/dropbox-connector-1.0.0/org.wso2.carbon.connector/src/main/resources/operation/uploadFile.xml

On Sat, Feb 28, 2015 at 1:06 PM, Sriashalya Srivathsan asha...@wso2.com
wrote:

 Hi All,
 I'm working with Gmail API Connector. I'm struggling on send mail with
 attachment through REST.Can any one please help me to create a POST request
 with JSON payload for send attachment through REST client.

 Regards
 --
 S.Sriashalya,
 Associate Software Engineer,
 WSO2.




-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
http://wso2.com/about/team/malaka-silva/

Save a tree -Conserve nature  Save the world for your future. Print this
email only if it is absolutely necessary.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [IS] OAuthServerConfiguration implementation

2015-02-28 Thread Nuwandi Wickramasinghe
Hi,

Is there any particular reason for hiding some exceptions
in OAuthServerConfiguration class? For an example,

*public ListClientAuthenticationHandler
getSupportedClientAuthHandlers() {*
*if (supportedClientAuthHandlers == null) {*
*synchronized (this) {*
*if (supportedClientAuthHandlers == null) {*
*supportedClientAuthHandlers = new
ArrayListClientAuthenticationHandler();*
*for (String entry :
supportedClientAuthHandlerClassNames) {*
*ClientAuthenticationHandler
clientAuthenticationHandler = null;*
*try {*
*clientAuthenticationHandler =
(ClientAuthenticationHandler) Class.forName(entry).newInstance();*
*clientAuthenticationHandler.init();*
*} catch (InstantiationException e) {*
*log.error(Error instantiating  + entry);*
*} catch (IllegalAccessException e) {*
*log.error(Illegal access to  + entry);*
*} catch (ClassNotFoundException e) {*
*log.error(Cannot find class:  + entry);*
*} catch (IdentityOAuth2Exception e) {*
*log.error(Error while initializing  +
entry);*
*}*
*
supportedClientAuthHandlers.add(clientAuthenticationHandler);*
*}*
*}*
*}*
*}*
*return supportedClientAuthHandlers;*
*}*



Returned *supportedClientAuthHandlers *has a potential of
a NullPointerException in run time.

-- 

Best Regards,

Nuwandi Wickramasinghe

Software Engineer

WSO2 Inc.

Web : http://wso2.com

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


Re: [Dev] Ntask throws ResourceNotFoundException when using with different tenants

2015-02-28 Thread Shafreen Anfar
Hi Anjana,

Understood. It has to be per TaskManager. I tried out the fix and it works
as expected. Thank you very much for the prompt response.

On Sat, Feb 28, 2015 at 2:52 PM, Anjana Fernando anj...@wso2.com wrote:

 Hi Shafreen,

 Yeah, that's a bug! .. good catch. The issue is, as you said, we just
 having a singe TriggerListener for all the tenants/task-types, where we
 should actually be having a single TriggerListener for one TaskManager (per
 tenant/task-type). So the correct fix is registering a matcher in the
 current code, in the constructor to give the matcher. I've fixed this in
 GitHub now, with this commit [1]. Please check and verify.

 [1]
 https://github.com/wso2/carbon-commons/commit/5df4e830bb7d93d0a85085a5ff21e98d65b88283

 Cheers,
 Anjana.

 On Sat, Feb 28, 2015 at 4:21 PM, Shafreen Anfar shafr...@wso2.com wrote:

 Hi Anjana,

 This [1] happens when we schedule tasks with different tenants. When I
 dug deep I saw that tasks try to update its state to FINISH state using
 TriggerListeners. I believe this is where the problem is. It seems the last
 registered listener is getting notified for all the tasks. I think it is
 because we are not using a matcher, the registered listener receives events
 for all the triggers [2].

 Therefore, I changed the code as in the attached diff and I could not
 observe the issue any more. When I debugged I could see that all the task's
 states are getting updated properly. Can you please help us on this matter ?

 [1]

 org.wso2.carbon.ntask.common.TaskException: The task 'super_tenent' does
 not exist
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:310)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.setTaskMetadataProp(RegistryBasedTaskRepository.java:323)
 at org.wso2.carbon.ntask.core.TaskUtils.setTaskState(TaskUtils.java:109)
 at
 org.wso2.carbon.ntask.core.TaskUtils.setTaskFinished(TaskUtils.java:146)
 at
 org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager$TaskTriggerListener.triggerComplete(AbstractQuartzTaskManager.java:424)
 at
 org.quartz.core.QuartzScheduler.notifyTriggerListenersComplete(QuartzScheduler.java:1876)
 at
 org.quartz.core.JobRunShell.notifyTriggerListenersComplete(JobRunShell.java:377)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:254)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 Caused by:
 *org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException*:
 Resource does not exist at path
 /_system/governance/repository/components/org.wso2.carbon.tasks/definitions/1/ESB_TASK/super_tenent
 at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:532)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getGhostResourceFromCache(CacheBackedRegistry.java:194)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:167)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.getInternal(UserRegistry.java:613)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.access$400(UserRegistry.java:60)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:596)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:593)
 at java.security.AccessController.doPrivileged(Native Method)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:593)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:306)
 ... 12 more

 [2]
 http://quartz-scheduler.org/api/2.2.0/org/quartz/ListenerManager.html#addTriggerListener(org.quartz.TriggerListener)

 --
 Regards,
 *Shafreen*
 Software Engineer
 WSO2 Inc
 Mobile : 077-556-395-1




 --
 *Anjana Fernando*
 Senior Technical Lead
 WSO2 Inc. | http://wso2.com
 lean . enterprise . middleware




-- 
Regards,
*Shafreen*
Software Engineer
WSO2 Inc
Mobile : 077-556-395-1
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] How to start wso2sever with wso2server.sh start after ciphertoo is executed

2015-02-28 Thread Nuwan Wimalasekara
Hi
Once ciphertool is executed, server start  ask to provide the keystore
password Enter KeyStore and Private Key Password : from command line. So
if the server is start ./wso2server.sh start, the password can not be
provided. Is there any command lime parameter to pass the password when
server start up?

Thanks,
Nuwanw

-- 
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB] [Carbon-Mediation] Failure to find ui feature in nexus

2015-02-28 Thread Shakila Sivagnanarajah
Hi Maheeka,

To avoid this kind of issue, use stable versions. For this, you can use
4.3.0 as the version. That will automatically find the snapshots.

On Thu, Jan 29, 2015 at 5:38 PM, Maheeka Jayasuriya mahe...@wso2.com
wrote:

 Hi,

 This has been due to a change in snapshot version in parent pom. This is
 resolved now.


 Thanks,

 Maheeka Jayasuriya
 Software Engineer
 Mobile : +9450661

 On Mon, Jan 26, 2015 at 9:05 PM, Maheeka Jayasuriya mahe...@wso2.com
 wrote:

 I am using 4.3.0-SNAPSHOT as the version.


 Thanks,

 Maheeka Jayasuriya
 Software Engineer
 Mobile : +9450661

 On Mon, Jan 26, 2015 at 7:29 PM, Firzhan Naqash firz...@wso2.com wrote:

 Hi,

 You can use the 4.3.0-SNAPSHOT as dependency version.

 Regards,
 Firzhan

 On Mon, Jan 26, 2015 at 6:40 PM, Pulasthi Mahawithana 
 pulast...@wso2.com wrote:

 Hi,

 This might be due to using version 4.3.0 in 
 org.wso2.carbon:org.wso2.carbon.mediator.foreach.ui
 instead of 4.3.0-SNAPSHOT. Try changing the version.

 On Mon, Jan 26, 2015 at 6:01 PM, Maheeka Jayasuriya mahe...@wso2.com
 wrote:

 @Firzhan, Can you let know how I could test this feature while it is
 still under development, without it trying retrieving from nexus ? And 
 what
 could be the reason it was not an issue before fetching?

 @Hasitha, This will only reactor the ui.feature right? I did try with
 -U with no luck.

 Should a feature be implemented in carbon-mediation? and/or should I
 wait for the feature to be added to nexus?


 Thanks,

 Maheeka Jayasuriya
 Software Engineer
 Mobile : +9450661

 On Mon, Jan 26, 2015 at 5:02 PM, Hasitha Aravinda hasi...@wso2.com
 wrote:

 Try to build using

 mvn clean install -rf :org.wso2.carbon.mediators.ui.feature -U

 Thanks,
 Hasitha.

 On Mon, Jan 26, 2015 at 4:46 PM, Maheeka Jayasuriya mahe...@wso2.com
  wrote:

 Hi All,

 I have developed a new mediator (ForEach mediator) and have it
 working successfully in an ESB snapshot. I have created a module
 mediation-ui/mediators-ui/org.wso2.carbon.mediator.foreach.ui for the UI
 bundle for the mediator in carbon-mediation.

 After the latest fetch from wso2/carbon-mediation, I get the
 following error [1] when building carbon-mediation. Should this UI 
 bundle
 be added to nexus? If so why was this not an issue earlier?

 Please find the full stack trace available at [2]

 [1]
 [ERROR] Failed to execute goal on project
 org.wso2.carbon.mediators.ui.feature: Could not resolve dependencies for
 project 
 *org.wso2.carbon:org.wso2.carbon.mediators.ui.feature:pom:4.3.0-SNAPSHOT:
 Failure to find
 org.wso2.carbon:org.wso2.carbon.mediator.foreach.ui:jar:4.3.0 in
 http://maven.wso2.org/nexus/content/groups/wso2-public/
 http://maven.wso2.org/nexus/content/groups/wso2-public/ *was
 cached in the local repository, resolution will not be reattempted until
 the update interval of wso2-nexus has elapsed or updates are forced -
 [Help 1]

 [2]
 [INFO]

 [INFO]
 
 [INFO] Building WSO2 Carbon - All Mediators UI Feature 4.3.0-SNAPSHOT
 [INFO]
 
 [WARNING] The POM for
 org.wso2.carbon:org.wso2.carbon.mediator.foreach.ui:jar:4.3.0 is 
 missing,
 no dependency information available
 [INFO]
 
 [INFO] Reactor Summary:
 [INFO]
 [INFO] WSO2 Carbon - Platform Aggregator Pom . SUCCESS
 [0.160s]
 [INFO] WSO2 Carbon - Inbound Endpoint Module . SUCCESS
 [1.068s]
 [INFO] org.wso2.carbon.inbound.endpoint.persistence .. SUCCESS
 [2.188s]
 [INFO] WSO2 Carbon - Clustering Integration .. SUCCESS
 [0.684s]
 [INFO] org.wso2.carbon.inbound.endpoint .. SUCCESS
 [1.015s]
 [INFO] inbound-endpoints-feature . SUCCESS
 [0.007s]
 [INFO] WSO2 Carbon - Inbound Endpoint Server Feature . SUCCESS
 [0.354s]
 [INFO] WSO2 Carbon - Mediation Initializer Feature ... SUCCESS
 [0.122s]
 [INFO] WSO2 Carbon - Business Adaptors Aggregator Module . SUCCESS
 [0.010s]
 [INFO] WSO2 Carbon - HL7 Store Stub .. SUCCESS
 [2.726s]
 [INFO] WSO2 Carbon - Endpoint Editor Stub  SUCCESS
 [2.382s]
 [INFO] WSO2 Carbon - localentry Stub . SUCCESS
 [1.890s]
 [INFO] WSO2 Carbon - Synapse Artifact Uploader Stub .. SUCCESS
 [1.533s]
 [INFO] WSO2 Carbon - Synapse Configuration Service Administrator
 Stub  SUCCESS [1.831s]
 [INFO] WSO2 Carbon - Mediation Library (Synapse) Management Stub
 SUCCESS [3.120s]
 [INFO] WSO2 Carbon - Mediation Security Stub . SUCCESS
 [1.489s]
 [INFO] WSO2 Carbon - Template Editor Service Administrator Stub
 SUCCESS [3.526s]
 [INFO] WSO2 Carbon - BAM Mediator Configuration Stub . SUCCESS
 [1.827s]
 [INFO] WSO2 Carbon - Class Mediator Admin Stub ... SUCCESS
 [1.501s]
 [INFO] WSO2 Carbon - Command Mediator Admin Stub . SUCCESS
 [1.619s]
 [INFO] 

[Dev] SurefireExecutionException error in unit tests for axis2 transports

2015-02-28 Thread Kalpa Welivitigoda
Hi,

I am writing a unit test for the jms module of wso2 axis2 transports [1]. I
followed [2] and added the testng dependency (version 6.1.1) to jms module.

When I run the test I get the following error. What could have gone wrong
here?

---
 T E S T S
---
org.apache.maven.surefire.booter.SurefireExecutionException:
org.testng.xml.XmlSuite.setParallel(Z)V; nested exception is
java.lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
java.lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
at
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:123)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
[INFO]

[INFO] BUILD FAILURE
[INFO]



[1] https://github.com/wso2/wso2-axis2-transports
[2] https://docs.wso2.com/display/TA430/Unit+Testing

-- 
Best Regards,

Kalpa Welivitigoda
Software Engineer, WSO2 Inc. http://wso2.com
Email: kal...@wso2.com
Mobile: +94776509215
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to start wso2sever with wso2server.sh start after ciphertoo is executed

2015-02-28 Thread Nuwan Wimalasekara
Great Thanks Nirodha. It works

Thanks,
Nuwanw

On Sat, Feb 28, 2015 at 6:39 PM, Nirodha Pramod niro...@wso2.com wrote:

 Hi Nuwan,

 You have to create a text file called password-tmp (no extenstion) and
 set the keystore password in it, and save the file in the carbon_home
 folder. When the server is started it reads the password from that file and
 deletes the file. So if you are restarting again you will have to create
 the file again.

 -Nirodha

 On Sun, Mar 1, 2015 at 8:04 AM, Nuwan Wimalasekara nuw...@wso2.com
 wrote:

 Hi
 Once ciphertool is executed, server start  ask to provide the keystore
 password Enter KeyStore and Private Key Password : from command line. So
 if the server is start ./wso2server.sh start, the password can not be
 provided. Is there any command lime parameter to pass the password when
 server start up?

 Thanks,
 Nuwanw

 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




 --

 *Nirodha Gallage*
 Senior Software Engineer, QA.
 WSO2 Inc.: http://wso2.com/
 Mobile: +94716429078




-- 
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Start Tenant Flow Code sample should need to be changed in 4.2.0 documentation

2015-02-28 Thread Shashika Karunatilaka
Hi,

Start Tenant Flow Code sample should need to be changed in 4.2.0
documentation[1]. currently in the documentation its getting CarbonContext
from the PrivilegedCarbonContext.getCurrentContext().
getCurrentContext() is deprecated in the 4.2.0, no longer available in
4.3.0. This is fixed in 4.3.0 documentation[2]. It should need to be
changed to get from getThreadLocalCarbonContext().

try{
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext privilegedCarbonContext =
   PrivilegedCarbonContext*.getCurrentContext();*
*change to* *-PrivilegedCarbonContext.getThreadLocalCarbonContext();*
   privilegedCarbonContext.setTenantId(tenantId);
   privilegedCarbonContext.setTenantDomain(tenantDomain);
   // set other stuff like registry etc. if needed

  doSomething();
} finally {
   PrivilegedCarbonContext.endTenantFlow();
}

[1] https://docs.wso2.com/display/Carbon420/CarbonContext+API
[2] https://docs.wso2.com/display/Carbon430/CarbonContext+API
-- 
Shashika Prabath Karunatilaka,
Software Engineer,
WSO2, Inc: http://wso2.com/
mobile : +94 77 7487792
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to start wso2sever with wso2server.sh start after ciphertoo is executed

2015-02-28 Thread Udara Rathnayake
Adding to Nirodha, if this is purely for local dev/testing you can create
this file as password-persist so it will persists even after server start

On Sun, Mar 1, 2015 at 8:18 AM, Nuwan Wimalasekara nuw...@wso2.com wrote:

 Great Thanks Nirodha. It works

 Thanks,
 Nuwanw

 On Sat, Feb 28, 2015 at 6:39 PM, Nirodha Pramod niro...@wso2.com wrote:

 Hi Nuwan,

 You have to create a text file called password-tmp (no extenstion) and
 set the keystore password in it, and save the file in the carbon_home
 folder. When the server is started it reads the password from that file and
 deletes the file. So if you are restarting again you will have to create
 the file again.

 -Nirodha

 On Sun, Mar 1, 2015 at 8:04 AM, Nuwan Wimalasekara nuw...@wso2.com
 wrote:

 Hi
 Once ciphertool is executed, server start  ask to provide the keystore
 password Enter KeyStore and Private Key Password : from command line. So
 if the server is start ./wso2server.sh start, the password can not be
 provided. Is there any command lime parameter to pass the password when
 server start up?

 Thanks,
 Nuwanw

 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




 --

 *Nirodha Gallage*
 Senior Software Engineer, QA.
 WSO2 Inc.: http://wso2.com/
 Mobile: +94716429078




 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




-- 
*Udara Rathnayake*
Software Engineer
WSO2 Inc. : http://wso2.com

Mobile : 1 4087864651 | 94 772207239
Twitter : http://twitter.com/udarakr
Blog: http://udarakr.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] SurefireExecutionException error in unit tests for axis2 transports

2015-02-28 Thread Krishantha Samaraweera
Hi Kalpa,

What is your surefire version. Can you use surefire 2.12 and check again.

Thanks,
Krishantha.

On Sun, Mar 1, 2015 at 11:06 AM, Kalpa Welivitigoda kal...@wso2.com wrote:

 Hi,

 I am writing a unit test for the jms module of wso2 axis2 transports [1].
 I followed [2] and added the testng dependency (version 6.1.1) to jms
 module.

 When I run the test I get the following error. What could have gone wrong
 here?

 ---
  T E S T S
 ---
 org.apache.maven.surefire.booter.SurefireExecutionException:
 org.testng.xml.XmlSuite.setParallel(Z)V; nested exception is
 java.lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
 java.lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
 at
 org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:123)
 at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
 at
 org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
 [INFO]
 
 [INFO] BUILD FAILURE
 [INFO]
 


 [1] https://github.com/wso2/wso2-axis2-transports
 [2] https://docs.wso2.com/display/TA430/Unit+Testing

 --
 Best Regards,

 Kalpa Welivitigoda
 Software Engineer, WSO2 Inc. http://wso2.com
 Email: kal...@wso2.com
 Mobile: +94776509215




-- 
Krishantha Samaraweera
Senior Technical Lead - Test Automation
Mobile: +94 77 7759918
WSO2, Inc.; http://wso2.com/
lean . enterprise . middlewear.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to start wso2sever with wso2server.sh start after ciphertoo is executed

2015-02-28 Thread Nirodha Pramod
Hi Nuwan,

You have to create a text file called password-tmp (no extenstion) and
set the keystore password in it, and save the file in the carbon_home
folder. When the server is started it reads the password from that file and
deletes the file. So if you are restarting again you will have to create
the file again.

-Nirodha

On Sun, Mar 1, 2015 at 8:04 AM, Nuwan Wimalasekara nuw...@wso2.com wrote:

 Hi
 Once ciphertool is executed, server start  ask to provide the keystore
 password Enter KeyStore and Private Key Password : from command line. So
 if the server is start ./wso2server.sh start, the password can not be
 provided. Is there any command lime parameter to pass the password when
 server start up?

 Thanks,
 Nuwanw

 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




-- 

*Nirodha Gallage*
Senior Software Engineer, QA.
WSO2 Inc.: http://wso2.com/
Mobile: +94716429078
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Best Way to find two files are equal in test cases.

2015-02-28 Thread Tharindu Dharmarathna
Hi all,

I wrote test case on APIDocDownload for the API Manager .When I Run the
tests It gives me two md5sums for equal files .

here's the code sample I write to get md5 value from the files

private String readMD5(InputStream inputStream) throws
 NoSuchAlgorithmException, IOException {
 MessageDigest md = MessageDigest.getInstance(MD5);
 byte[] dataBytes = new byte[1024];
 int read;
 try {
 while ((read = inputStream.read(dataBytes)) != -1) {
 md.update(dataBytes, 0, read);
 }
 } catch (IOException e) {
 log.error(File couldn't found to read md5, e);
 throw e;
 } finally {
 inputStream.close();
 }
 byte[] mdBytes = md.digest();
 //convert the byte to hex format
 StringBuilder sb = new StringBuilder();
 for (byte mdByte : mdBytes) {
 sb.append(Integer.toString((mdByte  0xff) + 0x100, 16).substring(1));
 }
 return sb.toString();
 }

Is there any best way to get two files are identical ?.

Thanks

-- 

*Tharindu Dharmarathna*Associate Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94779109091 %2B94779109091*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Ntask throws ResourceNotFoundException when using with different tenants

2015-02-28 Thread Anjana Fernando
Great! :) ..

Cheers,
Anjana.

On Sat, Feb 28, 2015 at 10:00 PM, Shafreen Anfar shafr...@wso2.com wrote:

 Hi Anjana,

 Understood. It has to be per TaskManager. I tried out the fix and it works
 as expected. Thank you very much for the prompt response.

 On Sat, Feb 28, 2015 at 2:52 PM, Anjana Fernando anj...@wso2.com wrote:

 Hi Shafreen,

 Yeah, that's a bug! .. good catch. The issue is, as you said, we just
 having a singe TriggerListener for all the tenants/task-types, where we
 should actually be having a single TriggerListener for one TaskManager (per
 tenant/task-type). So the correct fix is registering a matcher in the
 current code, in the constructor to give the matcher. I've fixed this in
 GitHub now, with this commit [1]. Please check and verify.

 [1]
 https://github.com/wso2/carbon-commons/commit/5df4e830bb7d93d0a85085a5ff21e98d65b88283

 Cheers,
 Anjana.

 On Sat, Feb 28, 2015 at 4:21 PM, Shafreen Anfar shafr...@wso2.com
 wrote:

 Hi Anjana,

 This [1] happens when we schedule tasks with different tenants. When I
 dug deep I saw that tasks try to update its state to FINISH state using
 TriggerListeners. I believe this is where the problem is. It seems the last
 registered listener is getting notified for all the tasks. I think it is
 because we are not using a matcher, the registered listener receives events
 for all the triggers [2].

 Therefore, I changed the code as in the attached diff and I could not
 observe the issue any more. When I debugged I could see that all the task's
 states are getting updated properly. Can you please help us on this matter ?

 [1]

 org.wso2.carbon.ntask.common.TaskException: The task 'super_tenent' does
 not exist
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:310)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.setTaskMetadataProp(RegistryBasedTaskRepository.java:323)
 at org.wso2.carbon.ntask.core.TaskUtils.setTaskState(TaskUtils.java:109)
 at
 org.wso2.carbon.ntask.core.TaskUtils.setTaskFinished(TaskUtils.java:146)
 at
 org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager$TaskTriggerListener.triggerComplete(AbstractQuartzTaskManager.java:424)
 at
 org.quartz.core.QuartzScheduler.notifyTriggerListenersComplete(QuartzScheduler.java:1876)
 at
 org.quartz.core.JobRunShell.notifyTriggerListenersComplete(JobRunShell.java:377)
 at org.quartz.core.JobRunShell.run(JobRunShell.java:254)
 at
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)
 Caused by:
 *org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException*:
 Resource does not exist at path
 /_system/governance/repository/components/org.wso2.carbon.tasks/definitions/1/ESB_TASK/super_tenent
 at
 org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:532)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getGhostResourceFromCache(CacheBackedRegistry.java:194)
 at
 org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:167)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.getInternal(UserRegistry.java:613)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.access$400(UserRegistry.java:60)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:596)
 at
 org.wso2.carbon.registry.core.session.UserRegistry$5.run(UserRegistry.java:593)
 at java.security.AccessController.doPrivileged(Native Method)
 at
 org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:593)
 at
 org.wso2.carbon.ntask.core.impl.RegistryBasedTaskRepository.getTaskMetadataPropResource(RegistryBasedTaskRepository.java:306)
 ... 12 more

 [2]
 http://quartz-scheduler.org/api/2.2.0/org/quartz/ListenerManager.html#addTriggerListener(org.quartz.TriggerListener)

 --
 Regards,
 *Shafreen*
 Software Engineer
 WSO2 Inc
 Mobile : 077-556-395-1




 --
 *Anjana Fernando*
 Senior Technical Lead
 WSO2 Inc. | http://wso2.com
 lean . enterprise . middleware




 --
 Regards,
 *Shafreen*
 Software Engineer
 WSO2 Inc
 Mobile : 077-556-395-1




-- 
*Anjana Fernando*
Senior Technical Lead
WSO2 Inc. | http://wso2.com
lean . enterprise . middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How to start wso2sever with wso2server.sh start after ciphertoo is executed

2015-02-28 Thread Irham Iqbal
Hi Nuwan,

This blog post[1] might help you. There is a patch created by Jayanga that
ll provide the facility to pass the password as a parameter(i.e
./ciphertool.sh, -Dconfigure, -Dpassword=password)

[1] http://charithaka.blogspot.com/2013/06/how-to-use-securevault-when-wso2-
carbon.html

Thanks
Iqbal

On Sun, Mar 1, 2015 at 9:44 AM, Udara Rathnayake uda...@wso2.com wrote:

 Adding to Nirodha, if this is purely for local dev/testing you can create
 this file as password-persist so it will persists even after server start

 On Sun, Mar 1, 2015 at 8:18 AM, Nuwan Wimalasekara nuw...@wso2.com
 wrote:

 Great Thanks Nirodha. It works

 Thanks,
 Nuwanw

 On Sat, Feb 28, 2015 at 6:39 PM, Nirodha Pramod niro...@wso2.com wrote:

 Hi Nuwan,

 You have to create a text file called password-tmp (no extenstion) and
 set the keystore password in it, and save the file in the carbon_home
 folder. When the server is started it reads the password from that file and
 deletes the file. So if you are restarting again you will have to create
 the file again.

 -Nirodha

 On Sun, Mar 1, 2015 at 8:04 AM, Nuwan Wimalasekara nuw...@wso2.com
 wrote:

 Hi
 Once ciphertool is executed, server start  ask to provide the keystore
 password Enter KeyStore and Private Key Password : from command line. So
 if the server is start ./wso2server.sh start, the password can not be
 provided. Is there any command lime parameter to pass the password when
 server start up?

 Thanks,
 Nuwanw

 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




 --

 *Nirodha Gallage*
 Senior Software Engineer, QA.
 WSO2 Inc.: http://wso2.com/
 Mobile: +94716429078




 --
 Nuwan Wimalasekara
 Senior Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 phone: +94 71 668 4620




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




 --
 *Udara Rathnayake*
 Software Engineer
 WSO2 Inc. : http://wso2.com

 Mobile : 1 4087864651 | 94 772207239
 Twitter : http://twitter.com/udarakr
 Blog: http://udarakr.blogspot.com


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




-- 
Irham Iqbal
Software Engineer - Test Automation
 WSO2, Inc.: http://wso2.com
lean. enterprise. middleware
phone: +94 777888452
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev