[Dev] [API-M] [1.7.0] Can't create API's with previously used API names.

2014-06-06 Thread Nalin Chandraratne
Hi,

I encountered an issue when trying to create an API with a previously used
but deleted API name. The error actually occurs when trying to generate the
key after subscription.

I wrote a java client using the provided API-M REST API to do the basic
operations and when trying to generate the key, following error occurs.

ERROR - ApiMgtDAO Error occurred while creating an Application Registration
Entry for Application : DefaultApplication
org.h2.jdbc.JdbcSQLException: Unique index or primary key violation:
PRIMARY_KEY_AF ON PUBLIC.AM_APPLICATION_KEY_MAPPING(APPLICATION_ID,
KEY_TYPE); SQL statement:
INSERT INTO AM_APPLICATION_KEY_MAPPING (APPLICATION_ID,KEY_TYPE,STATE)
VALUES(?,?,?) [23001-140]

When trying to do the same thing manually using API-M publisher UI the
console gives the following message.


​

The API manager console prints,

ERROR - UserAwareAPIProvider Failed to get API from :
/apimgt/applicationdata/provider/test-AT-test.com/test/1/api
org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException:
Resource does not exist at path
/_system/governance/apimgt/applicationdata/provider/test-AT-test.com/test/1/api


It seems like although the API got deleted, the associated application key
does not get removed from the AM_APPLICATION_KEY_MAPPING table.

Thanks.




Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ELB Experiment

2014-05-13 Thread Nalin Chandraratne
After changing the cert in the ELB we were able to achieve the mutual auth
between ELB and AS. But the requirement was to get the auth working between
ESB and the AS (bypassing the ELb). For this, the ideal solution would be
SSL Tunneling. So I'll investigate on that topic and see what we can do.

Thanks.


On Mon, May 12, 2014 at 8:17 PM, Amila Maha Arachchi ami...@wso2.comwrote:

 Hi Nalin,

 Good. We need to do one more thing. That is, to change the certificate of
 the ELB and then see what needs to be done to get mutual auth working.


 On Mon, May 12, 2014 at 6:12 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi Shariq,

 Seems like the experiment is successful.

 I put the mutualAuthenticator jar to the AS and invoked an admin service
 of AS, fronted by ELB, from a proxy service of ESB.

 I set the soap header as following in the request.

 inSequence
 header
m:UserName xmlns:m=http://mutualssl.carbon.wso2.org
 admin/m:UserName
 /header
 send
endpoint
   address uri=
 https://localhost:8245/services/ServiceAdmin/
/endpoint
 /send
  /inSequence

 By doing the above, I was able to successfully invoke the admin service.
 Further, I remote debugged the MutualSSLAuthenticator class as you
 mentioned and verified that isAuthenticated() method returns true.

 Thanks.



 On Fri, May 9, 2014 at 6:00 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi Amila,

 I'm still in the process of doing the $subject. As per the discussion
 had with Shariq, even though we enabled the ClientAuth=true in AS, it
 doesn't do what we expect. It uses a Rampart Authenticator and what we want
 is the MutualSSLAuthenticator class to get used. So we have changed the
 experiment.

 Now what we are trying to do is, invoke an admin service in the AS from
 an ESB service. Because as shariq mentioned, this call should invoke the
 above mentioned MutualSSLAuthenticator class. Only after setting this
 environment properly, I can proceed with the ELB experiment.

 Thanks.

 --
 Nalin Chamara
 Software Engineer
 071-56-147-56




 --
 Nalin Chamara
 Software Engineer
 071-56-147-56




 --
 *Amila Maharachchi*
 Senior Technical Lead
 WSO2, Inc.; http://wso2.com

 Blog: http://maharachchi.blogspot.com
 Mobile: +94719371446




-- 
Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Regarding the Integration Tests for ESB Connectors

2014-04-11 Thread Nalin Chandraratne
I also encountered such situations.

One thing we could do is do compare both the direct response and response
through connector with a known value. Example scenario is as follows.
-

knownValue = commentId;

directApiResponse = callApiDirectly();
connectorResponse = callApiThroughConnector();

boolean condition = directApiResponse.contains(knownValue) 
connectorResponse.contains(knownValue);


Assert.assertTrue(condition);

-

So in a situation when we get two values like

comment
commentId/commentId
commentTexthello/commentText
/comment

comment
commentIdy/commentId
commentTexthello/commentText
/comment

we could still be sure that both gave the correct responses because the
knownValue will only contain in a successful response.

if we could log the 2 responses, in an event of test failure, we could
determine whether the test failure is actually due to the connector failure
or the 3rd party back end API failure.

Thanks.




On Fri, Apr 11, 2014 at 5:11 PM, Madhawa Bandara madh...@wso2.com wrote:

 Hi,
 I am implementing the integration test cases for a Google Tasks ESB
 connector.

 We were asked to implement the integration tests in a way that, the
 response of the test case though the ESB connector is asserted against the
 response through a *direct API call*.
 This is opposed to the existing method: asserting against a *known *value.

 Consider an API call that *creates* or *deletes a *resource.
 So how can we assert the connector response against the direct API call
 response in such a case, since the response values of the two requests
 would be different?

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

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




-- 
Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Unexpected behavior with Surefire plugin and TestNG

2014-04-10 Thread Nalin Chandraratne
Hi,

Is there a naming convention when writing the test classes, it has to be
ended with Test postfix, like XxxxXxxTest.java ?

I observed the following peculiar behavior when running test classes.

1. If the test package contain only one test class, it has to be named as
XxxxXxxTest.java

2. If the test package contains more than one test class *at least one of
them have to be* like XxxxXxxTest.java.

If neither of the above requirements are met, surefire plugin *will not
pick* the test classes. I came across this situation because my test class
was named as XxxxXxx*Tests*.java and it was not picked up by the surefire
plugin.

This is mentioned in the Surefire
documentationhttp://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html
.

By default, the Surefire Plugin will automatically include all test
classes with the following wildcard patterns:

   - **/Test*.java - includes all of its subdirectories and all java
   filenames that start with Test.
   - **/*Test.java - includes all of its subdirectories and all java
   filenames that end with Test.
   - **/*TestCase.java - includes all of its subdirectories and all java
   filenames that end with TestCase.

But as we are using the TestNG with Surefire, we are suppose to have any
test class and point to it using testng.xml like below.

test name=Flickr-Connector-Test preserve-order=true verbose=2
classes
class
name=org.wso2.carbon.connector.integration.test.flickr.FlickrConnectorIntegrationTests/
/classes
/test

This is also not working unless we have the above naming conventions.



Is this a known behavior ? Any idea why this is happening ?

-- 
Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB Connector uploading via UI

2014-03-27 Thread Nalin Chandraratne
Hi Malaka,

There is an ambiguity in the message shown when uploading an invalid
connector zip file. It says successfully uploaded although actually
throws an exception in the backend. Cant we show a message like invalid
connector file in the UI in such cases ? Just a thought.

Thanks.


On Thu, Mar 27, 2014 at 9:15 AM, Malaka Silva mal...@wso2.com wrote:

 Hi Nalin,

 What is the error you are getting?

 Usually actual deployment happens when you enable the connector. Not at
 the time of upload.

 Best Regards,
 Malaka


 On Thu, Mar 27, 2014 at 7:34 AM, Nalin Chandraratne na...@wso2.comwrote:

 HI,

 When adding a new connector to ESB via UI, we can upload ANY *.zip file
 and the management console does not verify whether we are actually
 uploading a connector or not. It also prompts a successful message as shown
 below(An exception is printed in the command line.). IMO either a
 verification should be done before showing the successful message or the
 message should be something appropriate.



 WSO2 Carbonhttps://10.100.0.15:9443/carbon/mediation_library/index.jsp#

 Your Application has been uploaded successfully. Please refresh this page
 in a while to see the status of the new Application.
 Thanks.

 --
 Nalin Chamara
 Software Engineer
 071-56-147-56



 ___
 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.




-- 
Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ESB Connector uploading via UI

2014-03-26 Thread Nalin Chandraratne
HI,

When adding a new connector to ESB via UI, we can upload ANY *.zip file and
the management console does not verify whether we are actually uploading a
connector or not. It also prompts a successful message as shown below(An
exception is printed in the command line.). IMO either a verification
should be done before showing the successful message or the message
should be something appropriate.



WSO2 Carbon https://10.100.0.15:9443/carbon/mediation_library/index.jsp#

Your Application has been uploaded successfully. Please refresh this page
in a while to see the status of the new Application.
Thanks.

-- 
Nalin Chamara
Software Engineer
071-56-147-56
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception when running the ESB Sample 153

2014-02-19 Thread Nalin Chandraratne
Hi Madhawa,

I also had an exception as follows when running the sample 153 with ESB
4.8.0. The exception was thrown at the axis2Client side.

[java] 14/02/19 20:18:42 INFO jms.JMSSender: JMS Sender started
 [java] 14/02/19 20:18:42 INFO jms.JMSSender: JMS Transport Sender
initialized...
 [java] Using WS-Security
 [java] org.apache.axis2.AxisFault: Error in encryption
 [java] at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:76)
 [java] at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
 [java] at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
 [java] at
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
 [java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
 [java] at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398)
 [java] at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
 [java] at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
 [java] at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
 [java] at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
 [java] at samples.userguide.StockQuoteClient.executeClient(Unknown
Source)
 [java] at samples.userguide.StockQuoteClient.main(Unknown Source)
 [java] Caused by: org.apache.rampart.RampartException: Error in
encryption
 [java] at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:612)
 [java] at
org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:97)
 [java] at
org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
 [java] at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
 [java] ... 11 more
 [java] Caused by: org.apache.ws.security.WSSecurityException: An
unsupported signature or encryption algorithm was used (unsupported key
transport encryption algorithm: No such algorithm:
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p); nested exception is:
 [java] java.security.NoSuchAlgorithmException: Cannot find any
provider supporting RSA/ECB/OAEPPadding
 [java] at
org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:785)
 [java] at
org.apache.ws.security.message.WSSecEncryptedKey.prepareInternal(WSSecEncryptedKey.java:205)
 [java] at
org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:259)
 [java] at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:578)
 [java] ... 14 more
 [java] Caused by: java.security.NoSuchAlgorithmException: Cannot find
any provider supporting RSA/ECB/OAEPPadding
 [java] at javax.crypto.Cipher.getInstance(DashoA13*..)
 [java] at
org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(WSSecurityUtil.java:777)
 [java] ... 17 more

When checked with TCPMon, client doesn't send any messages out (The
exception may occur while generating the message from the client).

So I used a different client (The axis2Client shipped with ESB 4.7.0) and
the sample executed successfully. AFAIU there is an issue with the
axis2Client shipping with the ESB 4.8.0.




On Wed, Feb 19, 2014 at 8:12 PM, Madhawa Bandara madh...@wso2.com wrote:

 I was running the following sample.


 http://docs.wso2.org/display/ESB481/Sample+250%3A+Introduction+to+Switching+Transports

 In the *client* I got the following exception.

  [java] 14/02/19 17:57:43 INFO mail.MailTransportSender: MAILTO Sender
 started
  [java] 14/02/19 17:57:43 INFO jms.JMSSender: JMS Sender started
  [java] 14/02/19 17:57:43 INFO jms.JMSSender: JMS Transport Sender
 initialized...
  [java] Using WS-Security
  [java] 14/02/19 17:57:44 ERROR engine.AxisEngine: Must Understand
 check failed for header
 http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:
  Security
  [java] org.apache.axis2.AxisFault: Must Understand check failed for
 header
 http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:
  Security
  [java] at
 org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:104)
  [java] at
 org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:170)
  [java] at
 org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:356)
  [java] at
 org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:413)
  [java] at
 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
  [java] at
 org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
  [java] at
 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
  [java] at
 

[Dev] org.wso2.carbon.discovery.ui.feature:4.2.0 not available in nexus

2013-10-16 Thread Nalin Chandraratne
Hi,

$subject is in chunk-01 feature list(/features/ws-discovery)[1], but it's
not available in the nexus repo[2]. This cause build breaks when building
on a clean repo. AFAIK whatever the features listed in the chunk-01 should
be available in the nexus repo. Please check this.

1.
https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.2.0/product-releases/chunk-01/features/pom.xml

2.
http://maven.wso2.org/nexus/content/groups/wso2-public/org/wso2/carbon/org.wso2.carbon.discovery.ui.feature/

Thanks,
Nalin.

-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB integration test hangs and stop running after a while

2013-10-14 Thread Nalin Chandraratne
Hi Subash,

The reason for this is the newly added wrong JMS test case
ESBJAVA2464TestCase.java. It tries to setup a JMS broker within the test
case while one is already available, hence the failure. Will look in to it.

Thanks,
Nalin.




On Mon, Oct 14, 2013 at 11:38 AM, Subash Chaturanga sub...@wso2.com wrote:


 Hi ESB team
 This happens after about 45mins.
 Did you also come across with such recently ? I happened to see this in
 the builder machine.


 [2013-10-14 05:38:07,535]  INFO
 {org.wso2.carbon.automation.core.PlatformTestManager} -  On test success..
 [2013-10-14 05:38:08,011]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -  waiting 3
 millis for Undeployment Endpoint messageStoreTargetEndpoint
 [2013-10-14 05:38:08,043]  INFO
 {org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
  [2013-10-14 05:38:08,043]  INFO - DeploymentInterceptor Removing Axis2
 Service: messageStoreTargetEndpointFormatTestProxy {super-tenant}
 [2013-10-14 05:38:08,044]  INFO
 {org.wso2.carbon.automation.api.clients.proxy.admin.ProxyServiceAdminClient}
 -  Proxy Deleted
 [2013-10-14 05:38:08,044]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -  waiting 3
 millis for Proxy undeployment
 [2013-10-14 05:38:08,095]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -
  messageStoreTargetEndpointFormatTestProxy Proxy undeployed in 0 millis
 [2013-10-14 05:38:08,141]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -  waiting 3
 millis for Undeployment Message Store TargetEndpointTestMessageStore
 [2013-10-14 05:38:10,171]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -  waiting 3
 millis for Undeployment Message Processor MessageProcessorTEPT
 [2013-10-14 05:38:10,178]  INFO
 {org.wso2.carbon.automation.utils.esb.ESBTestCaseUtils} -  Synapse
 configuration  unDeployed
 [2013-10-14 05:38:10,212]  INFO
 {org.wso2.carbon.automation.core.utils.coreutils.InputStreamHandler} -
  [2013-10-14 05:38:10,212]  INFO - CarbonAuthenticationUtil
 'testuser2@carbon.super [-1234]' logged in at [2013-10-14
 05:38:10,212+]
 [2013-10-14 05:38:10,214]  INFO
 {org.wso2.carbon.automation.api.clients.authenticators.AuthenticatorClient}
 -  Login Successful
 [2013-10-14 05:38:10,215]  INFO
 {org.wso2.carbon.automation.core.utils.jmsbrokerutils.controller.JMSBrokerController}
 -  JMSServerController: Preparing to start JMS Broker: localhost
 [2013-10-14 05:38:10,215]  INFO
 {org.wso2.carbon.automation.core.utils.jmsbrokerutils.controller.JMSBrokerController}
 -  activemq-data/testBroker
 [2013-10-14 05:38:10,216]  INFO {org.apache.activemq.broker.BrokerService}
 -  Using Persistence Adapter:
 AMQPersistenceAdapter(/build/branches/platform/products/esb/4.8.0/modules/integration/tests/target/carbontmp1381725711368/wso2esb-4.8.0/activemq-data/testBroker/testBroker)
 [2013-10-14 05:38:10,216]  INFO {org.apache.activemq.broker.BrokerService}
 -  Using Persistence Adapter:
 AMQPersistenceAdapter(/build/branches/platform/products/esb/4.8.0/modules/integration/tests/target/carbontmp1381725711368/wso2esb-4.8.0/activemq-data/testBroker/testBroker)
 [2013-10-14 05:38:10,216]  WARN
 {org.apache.activemq.store.amq.AMQPersistenceAdapter} -  Waiting to Lock
 the Store
 /build/branches/platform/products/esb/4.8.0/modules/integration/tests/target/carbontmp1381725711368/wso2esb-4.8.0/activemq-data/testBroker/testBroker
 [2013-10-14 05:38:10,216]  WARN
 {org.apache.activemq.store.amq.AMQPersistenceAdapter} -  Waiting to Lock
 the Store
 /build/branches/platform/products/esb/4.8.0/modules/integration/tests/target/carbontmp1381725711368/wso2esb-4.8.0/activemq-data/testBroker/testBroker




 --
 Thanks
 /subash

 *Subash Chaturanga*
 Senior Software Engineer :Integration TG; WSO2 Inc. http://wso2.com

 email: sub...@wso2.com
 blog:  http://subashsdm.blogspot.com/
 twitter: @subash89
 phone: +9477 2225922
 Lean . Enterprise . Middleware

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




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Build Failure][Clean Repo] P2 Profile Gen

2013-10-10 Thread Nalin Chandraratne
Hi Subash,

The org.wso2.carbon.discovery.ui.feature:420 is there in the chunk-01
feature list. Its under the features/ws-discovery. All though its there in
the chunk-01 feature list, somehow its not deployed in the nexus repo,
hence the build failure. Will do the needful.

Thanks,
Nalin.


On Wed, Oct 9, 2013 at 4:26 PM, Subash Chaturanga sub...@wso2.com wrote:

 Yes Kasun, the feature has not been released (accordingly to ch-1 features
 pom)!.


 On Wed, Oct 9, 2013 at 3:40 PM, Kasun Gajasinghe kas...@wso2.com wrote:

 Seems like even though the discovery.ui 4.2.0 component is available in
 nexus, the discovery.ui.feature 4.2.0 is not.


 On Wed, Oct 9, 2013 at 3:29 PM, Subash Chaturanga sub...@wso2.comwrote:

 Hi folks.
 This fails still. And it is NOT in 4.2.0/chunk-01/ feature list. Please
 add this to the build.


 On Tue, Oct 8, 2013 at 12:08 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi Subash,

 org.wso2.carbon.discovery.ui.feature:4.2.0 is in chunk-01 feature list.
 Which means its released and should be available in the nexus repository.

 Thanks,
 Nalin.


 On Mon, Oct 7, 2013 at 11:45 PM, Subash Chaturanga sub...@wso2.comwrote:

 Hi ESB team
 Please fix $subject.


 [INFO] ESB test Module ... SKIPPED
 [INFO]
 
 [INFO] BUILD FAILURE
 [INFO]
 
 [INFO] Total time: 45.962s
 [INFO] Finished at: Mon Oct 07 18:14:47 UTC 2013
 [INFO] Final Memory: 53M/884M
 [INFO]
 
 [ERROR] Failed to execute goal
 org.wso2.maven:carbon-p2-plugin:1.5.3:p2-repo-gen (2-p2-repo-generation) 
 on
 project wso2esb-p2-profile: Error occured when processing the Feature
 Artifact: org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:4.2.0:
 ERROR: Could not find artifact
 org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:zip:4.2.0 in
 wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/)
 [ERROR]
 [ERROR] Try downloading the file manually from the project website.
 [ERROR]
 [ERROR] Then, install it using the command:
 [ERROR] mvn install:install-file -DgroupId=org.wso2.carbon
 -DartifactId=org.wso2.carbon.discovery.ui.feature -Dversion=4.2.0
 -Dpackaging=zip -Dfile=/path/to/file
 [ERROR]
 [ERROR] Alternatively, if you host your own repository you can deploy
 the file there:
 [ERROR] mvn deploy:deploy-file -DgroupId=org.wso2.carbon
 -DartifactId=org.wso2.carbon.discovery.ui.feature -Dversion=4.2.0
 -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
 [ERROR]
 [ERROR]
 [ERROR] org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:zip:4.2.0
 [ERROR]
 [ERROR] from the specified remote repositories:
 [ERROR] wso2-nexus (
 http://maven.wso2.org/nexus/content/groups/wso2-public/,
 releases=true, snapshots=true),
 [ERROR] central (http://repo.maven.apache.org/maven2, releases=true,
 snapshots=false)
 [ERROR] - [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with
 the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
 [ERROR] For more information about the errors and possible solutions,
 please read the following articles:
 [ERROR] [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 [ERROR]
 [ERROR] After correcting the problems, you can resume the build with
 the command


 --
 Thanks
 /subash

 *Subash Chaturanga*
 Senior Software Engineer :Integration TG; WSO2 Inc. http://wso2.com

 email: sub...@wso2.com
 blog:  http://subashsdm.blogspot.com/
 twitter: @subash89
 phone: +9477 2225922
 Lean . Enterprise . Middleware




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Thanks
 /subash

 *Subash Chaturanga*
 Senior Software Engineer :Integration TG; WSO2 Inc. http://wso2.com

 email: sub...@wso2.com
 blog:  http://subashsdm.blogspot.com/
 twitter: @subash89
 phone: +9477 2225922
 Lean . Enterprise . Middleware

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




 --
 *Kasun Gajasinghe*
 Software Engineer;
 WSO2 Inc.; http://wso2.com


  ,
 *email: **kasung AT spamfree wso2.com


 ** cell: **+94 (77) 678-0813*
 *linked-in: *http://lk.linkedin.com/in/gajasinghe


 *
 *
 *blog: **http://kasunbg.org* http://kasunbg.org


 *
 twitter: **http://twitter.com/kasunbg* http://twitter.com/kasunbg


 *
 *




 --
 Thanks
 /subash

 *Subash Chaturanga*
 Senior Software Engineer :Integration TG; WSO2 Inc. http://wso2.com

 email: sub...@wso2.com
 blog:  http://subashsdm.blogspot.com/
 twitter: @subash89
 phone: +9477 2225922
 Lean . Enterprise . Middleware




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] WSO2 ESB 4.8.0 Milestone 4 released!

2013-10-09 Thread Nalin Chandraratne
Hi,

*WSO2 ESB 4.8.0 Milestone 4 released*!

WSO2 ESB M4 pack is released and it can be downloaded from here[1] and the
latest builds of the connectors can be downloaded from here[2].

1. http://svn.wso2.org/repos/wso2/people/isuruu/480release/packs/M4/
2. https://svn.wso2.org/repos/wso2/people/isuruu/480release/connectors/


Following are the resolved Jira issues in this milestone.

Bug

   - [ESBJAVA-2293 https://wso2.org/jira/browse/ESBJAVA-2293] - Search a
   sequence not working
   - [ESBJAVA-2329 https://wso2.org/jira/browse/ESBJAVA-2329] - Change
   default axis2.xml location in Callout Mediator and MessageProcessor
   - [ESBJAVA-2454 https://wso2.org/jira/browse/ESBJAVA-2454] -
   Deployment of Java Mediator fails
   - [ESBJAVA-2462 https://wso2.org/jira/browse/ESBJAVA-2462] - ESB
   4.8-M2 not starting on AIX 7 with ibm jdk1.7
   - [ESBJAVA-2479 https://wso2.org/jira/browse/ESBJAVA-2479] - Jira
   connector update method not working
   - [ESBJAVA-2481 https://wso2.org/jira/browse/ESBJAVA-2481] - Message
   body get appended as query parameters when doing a GET
   - [ESBJAVA-2485 https://wso2.org/jira/browse/ESBJAVA-2485] - Template
   Endpoints not editable
   - [ESBJAVA-2488 https://wso2.org/jira/browse/ESBJAVA-2488] - [Twilio
   Connector] Description need to be changed
   - [ESBJAVA-2495 https://wso2.org/jira/browse/ESBJAVA-2495] - MTOM MIME
   boundaries does not match
   - [ESBJAVA-2499 https://wso2.org/jira/browse/ESBJAVA-2499] - Callout
   mediator not enabling MTOM
   - [ESBJAVA-2500 https://wso2.org/jira/browse/ESBJAVA-2500] - Twilio
   Connector deployment issue
   - [ESBJAVA-2501 https://wso2.org/jira/browse/ESBJAVA-2501] - Hot
   deployment fails for sequences having connectors
   - [ESBJAVA-2504 https://wso2.org/jira/browse/ESBJAVA-2504] - [PTT]
   Invalid messages being passing to BE even though the Build is failed for
   content aware true scenario
   - [ESBJAVA-2511 https://wso2.org/jira/browse/ESBJAVA-2511] - Jira
   Search functionality not working
   - [ESBJAVA-2519 https://wso2.org/jira/browse/ESBJAVA-2519] - [JIRA
   CONNECTOR] getRolesOfProject not working
   - [ESBJAVA-2523 https://wso2.org/jira/browse/ESBJAVA-2523] - CAR
   Deplyment from a tenant fails.

Improvement

   - [ESBJAVA-2472 https://wso2.org/jira/browse/ESBJAVA-2472] - Secure
   Vault Tool - Error message when secret-conf.properties not present needs to
   be refactored
   - [ESBJAVA-2512 https://wso2.org/jira/browse/ESBJAVA-2512] - Jira
   Connector - need a operation to make transitions

New Feature

   - [ESBJAVA-2502 https://wso2.org/jira/browse/ESBJAVA-2502] - Add a log
   for subsequent empty POST requests when using failover endpoint with binary
   relay


Thanks.
Nalin.



-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Build Failure][Clean Repo] P2 Profile Gen

2013-10-08 Thread Nalin Chandraratne
Hi Subash,

org.wso2.carbon.discovery.ui.feature:4.2.0 is in chunk-01 feature list.
Which means its released and should be available in the nexus repository.

Thanks,
Nalin.


On Mon, Oct 7, 2013 at 11:45 PM, Subash Chaturanga sub...@wso2.com wrote:

 Hi ESB team
 Please fix $subject.


 [INFO] ESB test Module ... SKIPPED
 [INFO]
 
 [INFO] BUILD FAILURE
 [INFO]
 
 [INFO] Total time: 45.962s
 [INFO] Finished at: Mon Oct 07 18:14:47 UTC 2013
 [INFO] Final Memory: 53M/884M
 [INFO]
 
 [ERROR] Failed to execute goal
 org.wso2.maven:carbon-p2-plugin:1.5.3:p2-repo-gen (2-p2-repo-generation) on
 project wso2esb-p2-profile: Error occured when processing the Feature
 Artifact: org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:4.2.0:
 ERROR: Could not find artifact
 org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:zip:4.2.0 in
 wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/)
 [ERROR]
 [ERROR] Try downloading the file manually from the project website.
 [ERROR]
 [ERROR] Then, install it using the command:
 [ERROR] mvn install:install-file -DgroupId=org.wso2.carbon
 -DartifactId=org.wso2.carbon.discovery.ui.feature -Dversion=4.2.0
 -Dpackaging=zip -Dfile=/path/to/file
 [ERROR]
 [ERROR] Alternatively, if you host your own repository you can deploy the
 file there:
 [ERROR] mvn deploy:deploy-file -DgroupId=org.wso2.carbon
 -DartifactId=org.wso2.carbon.discovery.ui.feature -Dversion=4.2.0
 -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
 [ERROR]
 [ERROR]
 [ERROR] org.wso2.carbon:org.wso2.carbon.discovery.ui.feature:zip:4.2.0
 [ERROR]
 [ERROR] from the specified remote repositories:
 [ERROR] wso2-nexus (
 http://maven.wso2.org/nexus/content/groups/wso2-public/, releases=true,
 snapshots=true),
 [ERROR] central (http://repo.maven.apache.org/maven2, releases=true,
 snapshots=false)
 [ERROR] - [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with the
 -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
 [ERROR] For more information about the errors and possible solutions,
 please read the following articles:
 [ERROR] [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 [ERROR]
 [ERROR] After correcting the problems, you can resume the build with the
 command


 --
 Thanks
 /subash

 *Subash Chaturanga*
 Senior Software Engineer :Integration TG; WSO2 Inc. http://wso2.com

 email: sub...@wso2.com
 blog:  http://subashsdm.blogspot.com/
 twitter: @subash89
 phone: +9477 2225922
 Lean . Enterprise . Middleware




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Build issue - hive-root 0.8.1-wso2v8

2013-09-12 Thread Nalin Chandraratne
Hi,

Please fix the build issue @
420/platform/4.2.0/dependencies/hive/0.8.1-wso2v8. This occurs when
building from chunk-03.

Thanks.
Nalin.

-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Ayashkantha

2013-09-06 Thread Nalin Chandraratne
Congratzz Machan! :)


On Fri, Sep 6, 2013 at 12:36 PM, Udara Liyanage ud...@wso2.com wrote:

 Congrats Ayash


 On Fri, Sep 6, 2013 at 9:24 AM, Chamath Gunawardana chama...@wso2.comwrote:

 Congrats Ayashkantha .. !!


 On Thu, Sep 5, 2013 at 6:30 PM, Malintha Adikari malin...@wso2.comwrote:

 Congratz..


 On Thu, Sep 5, 2013 at 5:20 PM, Rajeev Sampath raje...@wso2.com wrote:

 Congrats!!!


 On Thu, Sep 5, 2013 at 2:13 PM, Anjana Fernando anj...@wso2.comwrote:

 Hi everyone,

 It's my pleasure to announce Ayashkantha as a WSO2 commiter.
 Ayashkantha has done many contributions to the BAM product, and I'm sure 
 he
 will continue to be a valuable member to the team. Ayashkantha, welcome
 aboard and keep up the good work! ..


 Cheers,
 Anjana.

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

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




 --
 Rajeev Sampath
 Senior Software Engineer
 WSO2, Inc.; http://www.wso2.com.

 Mobile:* +94716265766
 *

 ___
 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




 --
 Best Regards,
 Chamath Gunawardana
 Technical Lead; WSO2 Inc.
 Mobile : +94776322240

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




 --
 Udara Liyanage
 Software Engineer
 WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 web: http://udaraliyanage.wordpress.com
 phone: +94 71 443 6897

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




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB Integration test failure [org.wso2.carbon.esb.proxyservice.test.passThroughProxy]

2013-09-02 Thread Nalin Chandraratne
Hi Nuwan,

As I mentioned above, while debugging, I did notice that a previously
deployed stockQuoteService was not undeployed when trying to update a new
synapse configuration which had the same service in it. However, after
calling loadEsbConfigurationFromClasspath (path) method, new configuration
got applied successfully (can observe in the carbon log) and no issue
occurred. None of the after class methods got skipped either.

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


Re: [Dev] JSON format issue with paypal connector

2013-08-29 Thread Nalin Chandraratne
Hi,

If the request is JSON and you want to send JSON out, you may use stream
builder and formatter for JSON. But this may affect any other scenario
which is not mentioned here.

Thanks.


On Thu, Aug 29, 2013 at 10:57 AM, Ishan Jayawardena is...@wso2.com wrote:

 Hi Malaka,
 What formatter and builder are you using? Unless you use the default
 builder, the JSON-XML-JSON conversion must not happen, AFAIU.
 Thanks,
 Ishan.


 On Thu, Aug 29, 2013 at 5:41 AM, Malaka Silva mal...@wso2.com wrote:

 Hi,

 I have the following issue when sending a json.

 following is the required format

 {
   intent:sale,
   payer:{
 payment_method:credit_card,
 funding_instruments:[
   {
 credit_card:{
   number:4417119669820331,
   type:visa,
   expire_month:11,
   expire_year:2018,
   cvv2:874,
   first_name:Joe,
   last_name:Shopper,
   billing_address:{
 line1:52 N Main ST,
 city:Johnstown,
 country_code:US,
 postal_code:43210,
 state:OH
   }
 }
   }
 ]
   },
   transactions:[
 {
   amount:{
 total:7.47,
 currency:USD,
 details:{
   subtotal:7.41,
   tax:0.03,
   shipping:0.03
 }
   },
   description:This is the payment transaction description.
 }
   ]
 }

 So I set the payload using following configuration

  payloadFactory media-type=json

 format{intent:sale,payer:{payment_method:credit_card,funding_instruments:[{credit_card:{number:4417119669820331,type:visa,expire_month:11,expire_year:2018,cvv2:874,first_name:Joe,last_name:Shopper,billing_address:{line1:52
 N Main
 ST,city:Johnstown,country_code:US,postal_code:43210,state:OH}}}]},transactions:[{amount:{total:0.47,currency:USD,details:{subtotal:0.41,tax:0.03,shipping:0.03}},description:This
 is the payment transaction description.}]}/format
 args/
  /payloadFactory


 However following is the actual wire log when sending.

 {intent:sale,payer:{payment_method:credit_card,funding_instruments:{credit_card:{number:4417119669820331,type:visa,expire_month:11,expire_year:2018,cvv2:874,first_name:Joe,last_name:Shopper,billing_address:{line1:52
 N Main
 ST,city:Johnstown,country_code:US,postal_code:43210,state:OH,transactions:{amount:{total:0.47,currency:USD,details:{subtotal:0.41,tax:0.03,shipping:0.03}},description:This
 is the payment transaction description.}}[\r][\n]


 I noticed that the '[' and ']'  are missing when sending to paypal. I
 guess this is because it transforms the JSON to XML and XML to JSON before
 sending. It is causing this.

 Any idea to solve this?

 thx

 --
 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 T: +1 408 754 7388
 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/




 --
 Ishan Jayawardena
 Software Engineer
 Mobile: +94 (77) 408 2330




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DEV]svn commit r181648 breaks security scenarios.

2013-08-27 Thread Nalin Chandraratne
Hi Geeth,

Below commit result in security scenario failures in ESB 4.8.0.

Please fix this ASAP as this is critical to the M2 release.


Author: ge...@wso2.com
Date: Fri Aug 16 23:37:36 2013
New Revision: 181648
URL: http://wso2.org/svn/browse/wso2?view=revrevision=181648

Log:
Fixing https://wso2.org/jira/browse/WSAS-1473

Modified:
   carbon/platform/branches/4.2.0/components/security/org.
wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/
POXSecurityHandler.java

Modified: carbon/platform/branches/4.2.0/components/security/org.
wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/
POXSecurityHandler.java
URL:
http://wso2.org/svn/browse/wso2/carbon/platform/branches/4.2.0/components/security/org.wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java?rev=181648r1=181647r2=181648view=diff

==
--- carbon/platform/branches/4.2.0/components/security/org.
wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java
   (original)
+++ carbon/platform/branches/4.2.0/components/security/org.
wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java
   Fri Aug 16 23:37:36 2013
@@ -94,7 +94,7 @@

  //this handler only intercepts
 if (!(msgCtx.isDoingREST() || isSOAPWithoutSecHeader(msgCtx)) ||
-   !msgCtx.getIncomingTransportName().equals(https) ||
(basicAuthHeader == null)) {
+   !msgCtx.getIncomingTransportName().equals(https)) {
 return InvocationResponse.CONTINUE;
 }


Below exception is thrown when running UT security scenario.

org.apache.axis2.AxisFault: Transport error: 401 Error: OK
at 
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:308)
at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
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:398)
at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
at 
org.wso2.carbon.automation.utils.axis2client.SecureAxisServiceClient.sendReceive(SecureAxisServiceClient.java:136)
at 
org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredRequest(SecureServiceClient.java:72)
at 
org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredStockQuoteRequest(SecureServiceClient.java:43)
at 
org.wso2.carbon.esb.proxyservice.test.secureProxy.SecurityTransformationProxyForPolicy2BackEndTestCase.securityPolicy1(SecurityTransformationProxyForPolicy2BackEndTestCase.java:80)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
at 
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
at org.testng.TestRunner.privateRun(TestRunner.java:757)
at org.testng.TestRunner.run(TestRunner.java:608)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
at org.testng.TestNG.run(TestNG.java:999)
at 

Re: [Dev] [DEV]svn commit r181648 breaks security scenarios.

2013-08-27 Thread Nalin Chandraratne
Yes, Simply securing the proxy with the UTOverTransport policy.


On Tue, Aug 27, 2013 at 1:30 PM, Kasun Gajasinghe kas...@wso2.com wrote:

 Hi Nalin,

 I had a look at the test case. It seems you are doing a UT secured SOAP
 requests?


 On Tue, Aug 27, 2013 at 11:38 AM, Nalin Chandraratne na...@wso2.comwrote:

 Hi Geeth,

 Below commit result in security scenario failures in ESB 4.8.0.

 Please fix this ASAP as this is critical to the M2 release.


 Author: ge...@wso2.com
 Date: Fri Aug 16 23:37:36 2013
 New Revision: 181648
 URL: http://wso2.org/svn/browse/wso2?view=revrevision=181648

 Log:
 Fixing https://wso2.org/jira/browse/WSAS-1473

 Modified:
carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java

 Modified: carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java
 URL:
 http://wso2.org/svn/browse/wso2/carbon/platform/branches/4.2.0/components/security/org.wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java?rev=181648r1=181647r2=181648view=diff
 
 ==
 --- carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java(original)
 +++ carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.javaFri Aug 16 23:37:36 2013
 @@ -94,7 +94,7 @@

   //this handler only intercepts
  if (!(msgCtx.isDoingREST() || isSOAPWithoutSecHeader(msgCtx)) ||
 -   !msgCtx.getIncomingTransportName().equals(https) ||
 (basicAuthHeader == null)) {
 +   !msgCtx.getIncomingTransportName().equals(https)) {
  return InvocationResponse.CONTINUE;
  }


 Below exception is thrown when running UT security scenario.

 org.apache.axis2.AxisFault: Transport error: 401 Error: OK
  at 
 org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:308)
  at 
 org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
  at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
  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:398)
  at 
 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
  at 
 org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
  at 
 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
  at 
 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
  at 
 org.wso2.carbon.automation.utils.axis2client.SecureAxisServiceClient.sendReceive(SecureAxisServiceClient.java:136)
  at 
 org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredRequest(SecureServiceClient.java:72)
  at 
 org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredStockQuoteRequest(SecureServiceClient.java:43)
  at 
 org.wso2.carbon.esb.proxyservice.test.secureProxy.SecurityTransformationProxyForPolicy2BackEndTestCase.securityPolicy1(SecurityTransformationProxyForPolicy2BackEndTestCase.java:80)
  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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
  at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
  at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
  at 
 org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
  at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
  at org.testng.TestRunner.privateRun(TestRunner.java:757)
  at org.testng.TestRunner.run(TestRunner.java:608)
  at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
  at org.testng.SuiteRunner.run(SuiteRunner.java:240

Re: [Dev] [DEV]svn commit r181648 breaks security scenarios.

2013-08-27 Thread Nalin Chandraratne
Hi Geeth,

It seemed the issue was not with the fix you gave. However a minor change
had to be done in the axis2.xml to cater the change you made. (
RelaySecuirtyMessageBuilderDispatchandler was brought before
SOAPActionBasedDispatcher in transport phase).

Thanks,
Nalin.


On Tue, Aug 27, 2013 at 2:06 PM, Nalin Chandraratne na...@wso2.com wrote:

 Yes, Simply securing the proxy with the UTOverTransport policy.


 On Tue, Aug 27, 2013 at 1:30 PM, Kasun Gajasinghe kas...@wso2.com wrote:

 Hi Nalin,

 I had a look at the test case. It seems you are doing a UT secured SOAP
 requests?


 On Tue, Aug 27, 2013 at 11:38 AM, Nalin Chandraratne na...@wso2.comwrote:

 Hi Geeth,

 Below commit result in security scenario failures in ESB 4.8.0.

 Please fix this ASAP as this is critical to the M2 release.


 Author: ge...@wso2.com
 Date: Fri Aug 16 23:37:36 2013
 New Revision: 181648
 URL: http://wso2.org/svn/browse/wso2?view=revrevision=181648

 Log:
 Fixing https://wso2.org/jira/browse/WSAS-1473

 Modified:
carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java

 Modified: carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java
 URL:
 http://wso2.org/svn/browse/wso2/carbon/platform/branches/4.2.0/components/security/org.wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java?rev=181648r1=181647r2=181648view=diff
 
 ==
 --- carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.java(original)
 +++ carbon/platform/branches/4.2.0/components/security/org.
 wso2.carbon.security.mgt/4.2.0/src/main/java/org/wso2/
 carbon/security/pox/POXSecurityHandler.javaFri Aug 16 23:37:36 2013
 @@ -94,7 +94,7 @@

   //this handler only intercepts
  if (!(msgCtx.isDoingREST() || isSOAPWithoutSecHeader(msgCtx))
 ||
 -   !msgCtx.getIncomingTransportName().equals(https) ||
 (basicAuthHeader == null)) {
 +   !msgCtx.getIncomingTransportName().equals(https)) {
  return InvocationResponse.CONTINUE;
  }


 Below exception is thrown when running UT security scenario.

 org.apache.axis2.AxisFault: Transport error: 401 Error: OK
 at 
 org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:308)
 at 
 org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
 at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
 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:398)
 at 
 org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
 at 
 org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
 at 
 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
 at 
 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:530)
 at 
 org.wso2.carbon.automation.utils.axis2client.SecureAxisServiceClient.sendReceive(SecureAxisServiceClient.java:136)
 at 
 org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredRequest(SecureServiceClient.java:72)
 at 
 org.wso2.carbon.esb.util.SecureServiceClient.sendSecuredStockQuoteRequest(SecureServiceClient.java:43)
 at 
 org.wso2.carbon.esb.proxyservice.test.secureProxy.SecurityTransformationProxyForPolicy2BackEndTestCase.securityPolicy1(SecurityTransformationProxyForPolicy2BackEndTestCase.java:80)
 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
 at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
 at 
 org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
 at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
 at org.testng.TestRunner.privateRun(TestRunner.java:757

Re: [Dev] Status of ESB 4.8.0 on kernal 4.2.0

2013-08-13 Thread Nalin Chandraratne
Hi,

As the security tests tend to fail when running integration tests, I ran
the security scenarios manually. Below shows the observations I got. The
exceptions thrown in each failed test is given at the latter part.

Test class : SecurityTransformationProxyForPolicy8BackEndTestCase

Security Scenario Status.

1Passed
2Failed (The exception occurs in the
response path. )
3Passed
4Passed
5Failed (The exception occurs in the
response path. )
6Passed
7Passed
8Passed
9Passed
10  Passed
11  Passed
12  Passed
13  Passed
14  Passed
15  Passed

Note that all the security policies were applied to a single proxy service.
The policies successfully get applied and removed when changing. However
when running integration tests, sometimes it doesn't remove the previous
policies and  hence some tests failed (They pass when run in isolation or a
separate proxy service is created for each security policy).

Whn debugging the failed tests it showed that in response path, when trying
to retrieve the cacheManager, an NPE is thrown. These tests get passed
successfully in ESB 4.7.0. The exception thrown at the failed tests:


[2013-08-14 07:31:36,366] ERROR - ServicePasswordCallbackHandler Tenant
domain has not been set in CarbonContext
java.lang.NullPointerException: Tenant domain has not been set in
CarbonContext
at
org.wso2.carbon.caching.impl.CacheManagerFactoryImpl.getCacheManager(CacheManagerFactoryImpl.java:79)
at
org.wso2.carbon.registry.core.utils.RegistryUtils.getCacheManager(RegistryUtils.java:289)
at
org.wso2.carbon.registry.core.utils.RegistryUtils.getResourceCache(RegistryUtils.java:272)
at
org.wso2.carbon.registry.core.caching.CacheBackedRegistry.getCache(CacheBackedRegistry.java:62)
at
org.wso2.carbon.registry.core.caching.CacheBackedRegistry.resourceExists(CacheBackedRegistry.java:246)
at
org.wso2.carbon.registry.core.session.UserRegistry.resourceExists(UserRegistry.java:629)
at
org.wso2.carbon.security.util.ServicePasswordCallbackHandler.getPrivateKeyPassword(ServicePasswordCallbackHandler.java:247)
at
org.wso2.carbon.security.util.ServicePasswordCallbackHandler.handle(ServicePasswordCallbackHandler.java:93)
at
org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:316)
at
org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:263)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:717)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:414)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:90)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)
at org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:161)
at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:308)
at
org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:92)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:239)
at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:443)
at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:166)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:222)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2013-08-14 07:31:36,521] ERROR - ServicePasswordCallbackHandler Tenant
domain has not been set in CarbonContext
java.lang.NullPointerException: Tenant domain has not been set in
CarbonContext
at
org.wso2.carbon.caching.impl.CacheManagerFactoryImpl.getCacheManager(CacheManagerFactoryImpl.java:79)
at

[Dev] Invitation: Code Review - ESB - PayloadFactory @ Thu Aug 1, 2013 2:30pm - 3:30pm (na...@wso2.com)

2013-08-01 Thread Nalin Chandraratne
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20130801T09Z
DTEND:20130801T10Z
DTSTAMP:20130801T061024Z
ORGANIZER;CN=na...@wso2.com:mailto:na...@wso2.com
UID:qsveqt8qujt05m60cg8qqsg...@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE
 ;CN=Nalin Chandraratne;X-NUM-GUESTS=0:mailto:na...@wso2.com
ATTENDEE;CUTYPE=RESOURCE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TR
 UE;CN=LK #58 5th Floor - Meeting room;X-NUM-GUESTS=0:mailto:wso2.com_323831
 3439343838343...@resource.calendar.google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=
 TRUE;CN=dev@wso2.org;X-NUM-GUESTS=0:mailto:dev@wso2.org
CREATED:20130801T061024Z
DESCRIPTION:View your event at http://www.google.com/calendar/event?action=
 VIEWeid=cXN2ZXF0OHF1anQwNW02MGNnOHFxc2dvZ2sgZGV2QHdzbzIub3Jntok=MTQjbmFsa
 W5Ad3NvMi5jb21jODI2OWJhOGZkMjQxY2NiZTFjYzM0YzJkYWIzOWY5ZDZiNWFlNWE1ctz=Asi
 a/Colombohl=en.
LAST-MODIFIED:20130801T061024Z
LOCATION:LK #58 5th Floor - Meeting room
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Code Review - ESB - PayloadFactory
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR


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


Re: [Dev] Welcome Susankha Nirmala as a WSO2 Committer

2013-07-28 Thread Nalin Chandraratne
congratz buddy!


On Mon, Jul 29, 2013 at 8:41 AM, Vanjikumaran Sivajothy va...@wso2.comwrote:

 Congrats Susankha


 On Fri, Jul 26, 2013 at 11:36 AM, Harshana Martin harsh...@wso2.comwrote:

 Hi All,

 It is my distinct pleasure to welcome Susankha Nirmala as a WSO2
 Committer.

 Susankha has made some great contributions to WSO2 Developer Studio and
 the Carbon Platform during the last couple of months and in recognition of
 his commitment and contributions, he has been voted as a Committer for
 WSO2.

 Susankha, Congratulations and Welcome Aboard!

 Keep up the good work!!

 Thanks and Regards,
 Harshana
  --

 Harshana Martin
 Associate Technical Lead
 WSO2 Inc. : http://wso2.com

 Mobile: +94 775 998 115
 Profile: https://www.google.com/profiles/harshana05
 Blog: http://harshana05.blogspot.com
 Twitter: http://twitter.com/harshana05


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




 --
 Sivajothy Vanjikumaran
 *Senior Software Engineer*
 *Integration Technologies Team*
 *WSO2 Inc. http://wso2.com/*
 *Mobile:(+94)777219209**
 *[image: Facebook] https://www.facebook.com/vanjikumaran [image:
 Twitter] https://twitter.com/vanjikumaran [image: 
 LinkedIn]http://www.linkedin.com/pub/vanjikumaran-sivajothy/25/b31/293 
 [image:
 Blogger] http://vanjikumaran.blogspot.com/ [image: 
 SlideShare]http://www.slideshare.net/vanjikumaran

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




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB 4.7.0 payloadFactory -- Some problems - Needs clarification

2013-07-17 Thread Nalin Chandraratne
Hi Susinda,

Please find comment inline.


 Suppose we have a sample payloadFactory configuration as follows

 payloadFactory media-type=json
 formatjson body/format
 args
 arg evaluator=xml expression=/person/gender/
 arg value=2013/
 arg evaluator=json expression=$fname/
 /args
 /payloadFactory


 1. Is there any use cases such that *media-type=json* and *arg
 evaluator=xml*  will be used

 media-type is to specify the type which will be used to compose the
outgoing payload (json/xml) and evaluator is used to specify the type of
the expression (JsonPath/Xpath) used. UseCase : Incoming XML and need to
send a Different Json payload to BE which consist of some values extracted
from the incoming XML.

2. Possible use case of *media-type=xml* and *arg
evaluator=json*(opposite of the question one)


UseCase: when incoming payload is json and Steam Builders and Formatters
are used, we use evaluator=json. The reason is, when the stream builders
are enabled, content is set to a property JSON_STREAM and we have to
extract the payload from that instead of taking it from the soap body.
There we are using JsonPath to traverse the json object.


 And some synapse code problems
 payloadFactoryMediator has has methods called getJsonPathArgumentList()
 and getXPathArgumentList(). I used these methods to access arguments, issue
 was the value type argument (arg value=2013/) is returned from both
 methods.

 3. Is this a bug or intended behavior.


This is an intended behavior. We only read the arguments in the synapse
config once, when the PF initialize. Then keep the two argument types
separately in two Lists and use the appropriate one for the scenarios
accordingly.
Eg: if xml - PF - xml, we use getXpath..
  if json - PF - json and stream BnF are enabled, we use getJsonPath..
Values has to be there in both lists since it's common for both.


 And a suggestion
 4 .How about giving the config something like follows (omitting the
 evaluator because in code level it is handled in that way). Hope this
 simplifies coding and understandability.
 args
 arg expression=/person/gender/
 arg value=2013/
 arg jsonpath=$fname/
 /args


evaluator is used to distinguish different expression types. suppose we
add more expression types in future, what makes more sense is keeping the
arg type as expression and keep adding the different evaluator types.


Thanks.

-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] axis2-transport-jms_1.1.0.wso2v?

2013-05-23 Thread Nalin Chandraratne
Hi,

I'm trying to create a patch for [1]. I want to rebuild the
axis2-transport-jms_1.1.0.wso2v?.jar and add it to the esb and run. The esb
4.7.0 pack comes with axis2-transport-jms_1.1.0.wso2v7. But when I get the
4.1.0 branch from the svn, it only has
the axis2-transport-jms_1.1.0.wso2v8[2]. Please advice.

1. https://wso2.org/jira/browse/ESBJAVA-1821
2. /home/nalin/svn-4.1.0/kernel/4.1.0/dependencies/transports/1.1.0-wso2v8

Thanks.

-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Available message Builders and Formatters

2013-04-18 Thread Nalin Chandraratne
Hi,

How to identify all the *AVAILABLE* message builders and formatters in run
time ?
As an example, I want to know whether jsonOmBuilder or JsonStreamBuilder is
active.

-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Available message Builders and Formatters

2013-04-18 Thread Nalin Chandraratne
Hi,

@Sagara : The flag strategy only works if the content actually comes
through the specific builder. Suppose the content came through a xml
builder and we want to find out if the jsonStreamBuilder is active.. Then
this method wouldn't work.

@Nirmal : Couldn't find the builders from the axis2config. Appreciate if
you could elaborate :)


On Thu, Apr 18, 2013 at 4:09 PM, Sagara Gunathunga sag...@wso2.com wrote:




 On Thu, Apr 18, 2013 at 3:11 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 How to identify all the *AVAILABLE* message builders and formatters in
 run time ?
 As an example, I want to know whether jsonOmBuilder or JsonStreamBuilder
 is active.


 AFAIK JsonStreamBuilder is a custom builder cerated for ESB usages. Within
 the processDocument() method  of JsonStreamBuilder class set a flag to MC.
 Now whenever required you can check above flag from MC and determine
 whether message was build by JsonStreamBuilder or not, if the flag found on
 MC means message came through JsonStreamBuilder if flag is not found
 message didn't come through JsonStreamBuilder.

 Thanks !



 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Available message Builders and Formatters

2013-04-18 Thread Nalin Chandraratne
Hi

@sagara : active means the builders/formaters which are uncommented in the
axis2.xml. (if the Content-Type is application/json either jsomOmBuilder or
jsonStreamBuilder is uncommented. want to know which is uncommented in a
given time)


On Thu, Apr 18, 2013 at 5:08 PM, Sagara Gunathunga sag...@wso2.com wrote:




 On Thu, Apr 18, 2013 at 5:01 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 @Sagara : The flag strategy only works if the content actually comes
 through the specific builder. Suppose the content came through a xml
 builder and we want to find out if the jsonStreamBuilder is active.. Then
 this method wouldn't work.


 What does you mean as active here ?

 Thanks !



 @Nirmal : Couldn't find the builders from the axis2config. Appreciate if
 you could elaborate :)


 On Thu, Apr 18, 2013 at 4:09 PM, Sagara Gunathunga sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 3:11 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 How to identify all the *AVAILABLE* message builders and formatters in
 run time ?
 As an example, I want to know whether jsonOmBuilder or
 JsonStreamBuilder is active.


 AFAIK JsonStreamBuilder is a custom builder cerated for ESB usages.
 Within the processDocument() method  of JsonStreamBuilder class set a flag
 to MC. Now whenever required you can check above flag from MC and determine
 whether message was build by JsonStreamBuilder or not, if the flag found on
 MC means message came through JsonStreamBuilder if flag is not found
 message didn't come through JsonStreamBuilder.

 Thanks !



 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Available message Builders and Formatters

2013-04-18 Thread Nalin Chandraratne
Hi,

Thanks guys. I could do it with

MessageFormatter messageFormatter =
axis2MessageContext.getConfigurationContext().getAxisConfiguration().getMessageFormatter(JSON_CONTENT);

(Earlier I was using getMessageContext instead of .getConfigurationContext,
thats y i couldn't find the correct method. My bad  )

Really appriciate your help.

UseCase:

Its for an enhancement of PayloadFactory mediator. Suppose we have an
incoming xml message and we want to send a json output. Depending on the
active json formatter, we either attach the transformed json message to the
payload or to the message context as a property.

Nalin.


On Thu, Apr 18, 2013 at 5:33 PM, Sagara Gunathunga sag...@wso2.com wrote:




 On Thu, Apr 18, 2013 at 5:21 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi

 @sagara : active means the builders/formaters which are uncommented in
 the axis2.xml. (if the Content-Type is application/json either
 jsomOmBuilder or jsonStreamBuilder is uncommented. want to know which is
 uncommented in a given time)


 For this you can follow what Nirmal suggested. BTW can you please explain
 your complete use case   ? I mean why you want to find what is the active
 builder etc ?  And the place you want to have above check ?

 Thanks !




 On Thu, Apr 18, 2013 at 5:08 PM, Sagara Gunathunga sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 5:01 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 @Sagara : The flag strategy only works if the content actually comes
 through the specific builder. Suppose the content came through a xml
 builder and we want to find out if the jsonStreamBuilder is active.. Then
 this method wouldn't work.


 What does you mean as active here ?

 Thanks !



 @Nirmal : Couldn't find the builders from the axis2config. Appreciate
 if you could elaborate :)


 On Thu, Apr 18, 2013 at 4:09 PM, Sagara Gunathunga sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 3:11 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 How to identify all the *AVAILABLE* message builders and formatters
 in run time ?
 As an example, I want to know whether jsonOmBuilder or
 JsonStreamBuilder is active.


 AFAIK JsonStreamBuilder is a custom builder cerated for ESB usages.
 Within the processDocument() method  of JsonStreamBuilder class set a flag
 to MC. Now whenever required you can check above flag from MC and 
 determine
 whether message was build by JsonStreamBuilder or not, if the flag found 
 on
 MC means message came through JsonStreamBuilder if flag is not found
 message didn't come through JsonStreamBuilder.

 Thanks !



 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




-- 
Nalin Chamara
Software Engineer
na...@wso2.com
+94715614756
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Available message Builders and Formatters

2013-04-18 Thread Nalin Chandraratne
Hi Sagara,

The method you suggest was what I was doing initially.

Builder messageBuilder = MessageProcessorSelector.getMessageBuilder(*JSON_**
**CONTENT*, axis2MessageContext);

The problem I had with that was, even though I just want to know the
available builder for a given ContentType, above method replace the
original ContentType with the parameter I send (*JSON_CONTENT*). So I had
to hv the original ContentType backed up, then after the above method call
I had to reassign it with
msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE,
ORIGINAL_CONTENT_TYPE).

Anyway If this is the most legit way, I'll proceed with this.

Thanks.



On Thu, Apr 18, 2013 at 9:39 PM, Sagara Gunathunga sag...@wso2.com wrote:




 On Thu, Apr 18, 2013 at 5:45 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 Thanks guys. I could do it with

 MessageFormatter messageFormatter =
 axis2MessageContext.getConfigurationContext().getAxisConfiguration().getMessageFormatter(JSON_CONTENT);


 This way of direct accessing MessageFormatters and Builders are
 discouraged  in Axis2 instead you should use provided factory methods to
 get an instance of MessageFormatter/Builder. Instead of above method please
 use following code.

 Builder messageBuilder =
 MessageProcessorSelector.getMessageBuilder(JSON_CONTENT,
 axis2MessageContext);

 MessageFormatter messageFormatter =
 MessageProcessorSelector.getMessageFormatter(axis2MessageContext);

 Note : Before you call getMessageFormatter() method make sure to check
 Constants.Configuration.MESSAGE_TYPE is set on the axis2MessageContext
 object. If it not there you can add it like below deepening on your use
 case.

 axis2MessageContext.setProperty(Constants.Configuration.MESSAGE_TYPE,
 JSON_CONTENT);

 Thanks !



 (Earlier I was using getMessageContext instead of
 .getConfigurationContext, thats y i couldn't find the correct method. My
 bad  )

 Really appriciate your help.

 UseCase:

 Its for an enhancement of PayloadFactory mediator. Suppose we have an
 incoming xml message and we want to send a json output. Depending on the
 active json formatter, we either attach the transformed json message to the
 payload or to the message context as a property.

 Nalin.


 On Thu, Apr 18, 2013 at 5:33 PM, Sagara Gunathunga sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 5:21 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi

 @sagara : active means the builders/formaters which are uncommented in
 the axis2.xml. (if the Content-Type is application/json either
 jsomOmBuilder or jsonStreamBuilder is uncommented. want to know which is
 uncommented in a given time)


 For this you can follow what Nirmal suggested. BTW can you please
 explain your complete use case   ? I mean why you want to find what is the
 active builder etc ?  And the place you want to have above check ?

 Thanks !




 On Thu, Apr 18, 2013 at 5:08 PM, Sagara Gunathunga sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 5:01 PM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 @Sagara : The flag strategy only works if the content actually comes
 through the specific builder. Suppose the content came through a xml
 builder and we want to find out if the jsonStreamBuilder is active.. Then
 this method wouldn't work.


 What does you mean as active here ?

 Thanks !



 @Nirmal : Couldn't find the builders from the axis2config. Appreciate
 if you could elaborate :)


 On Thu, Apr 18, 2013 at 4:09 PM, Sagara Gunathunga 
 sag...@wso2.comwrote:




 On Thu, Apr 18, 2013 at 3:11 PM, Nalin Chandraratne 
 na...@wso2.comwrote:

 Hi,

 How to identify all the *AVAILABLE* message builders and
 formatters in run time ?
 As an example, I want to know whether jsonOmBuilder or
 JsonStreamBuilder is active.


 AFAIK JsonStreamBuilder is a custom builder cerated for ESB usages.
 Within the processDocument() method  of JsonStreamBuilder class set a 
 flag
 to MC. Now whenever required you can check above flag from MC and 
 determine
 whether message was build by JsonStreamBuilder or not, if the flag 
 found on
 MC means message came through JsonStreamBuilder if flag is not found
 message didn't come through JsonStreamBuilder.

 Thanks !



 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http://ssagara.blogspot.com




 --
 Nalin Chamara
 Software Engineer
 na...@wso2.com
 +94715614756




 --
 Sagara Gunathunga

 Technical Lead; WSO2, Inc.;  http://wso2.com
 V.P Apache Web Services;http://ws.apache.org/
 Linkedin; http://www.linkedin.com/in/ssagara
 Blog ;  http

Re: [Dev] [ESB] Enhancing PayloadFactory Mediator

2013-04-04 Thread Nalin Chandraratne
Specifying an evaluator attribute means we expect that the incoming
payload type should be known in advance. I'll go ahead with the approach u
suggested and try to finish it off EOD today.

Thanks.


On Fri, Apr 5, 2013 at 10:07 AM, Kasun Indrasiri ka...@wso2.com wrote:

 Lets go ahead with this approach and finish it off.
 Can we complete backend with above changes by today itself.. and send the
 required patches/samples so that we can do local testing?


 -- Forwarded message --
 From: Kasun Indrasiri ka...@wso2.com
 Date: Fri, Apr 5, 2013 at 7:45 AM
 Subject: Re: [ESB] Enhancing PayloadFactory Mediator
 To: Nalin Chandraratne na...@wso2.com
 Cc: support-dev-group support-dev-gr...@wso2.com, Miyuru Wanninayaka 
 miy...@wso2.com, Dushan Abeyruwan dus...@wso2.com


 The scenario here is that, based on the incoming message format we have to
 selectively extract data. There is no standard language currently for
 querying JSON as we do with XPath for XML.
 So, if the incoming type is XML then obviously we can use xpath, while
 when the incoming type is json, we need to use some thing similar
 to following. [1]  [2]

 For XML : /store/book[1]/title
 JSON : x.store.book[0].title


 Therefore we need a way to specify the incoming message format in payload
 factory mediator. So, how about specifying an evaluator  as part of the PF
 declaration.

  payloadFactory media-type=application/json evaluator=json
 format
 {“a” : c, “b” : “$1”}
 /format
 args
 arg expression=x.store.book[0].title/
 /args
 /payloadFactory

 As per the offline discussion we had yesterday, we could use JSON-Path
 which is under Apache License 2.0.

 (This discussion should take place in architecture or dev :))

 [1] http://code.google.com/p/json-path/
 [2] http://goessner.net/articles/JsonPath/



 On Fri, Apr 5, 2013 at 12:44 AM, Nalin Chandraratne na...@wso2.comwrote:

  http://code.google.com/p/json-path/

 A suggestion by Dushan.


 On Fri, Apr 5, 2013 at 12:38 AM, Nalin Chandraratne na...@wso2.comwrote:

 Hi,

 I'm currently working on $subject and we are adding the json support to
 PF. Currently, to extract values from the incoming

 xml payload, we use xpath. But now we have incoming json payload as well
 and there is no standard method or notations to

 extract the content from json payload. For the time being we are using
 something like /root/parent/child to traverse

 through the hierachy. We have to consider json arrays as well.

 [1] Please suggest a solid way to do this.

 Next thing is, for a given PF, expressions to extract values from the
 incoming payload are defined assuming we know the  content-type in advance.
 (Because for xml it would be xpath and for json its [1]).

 [2] Does a given PF need to be compatible with both the content-types?
 [3] if so, how can we define expressions that would be compliant with
 both xml and json?
  [4] Is it ok to define 2 expressions one for each content-type?

 Your comments and suggestions on 1,2,3,4 are welcome.

 Thanks,
 Nalin.





 --
 Kasun Indrasiri
 Associate Technical Lead
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 71 536 4128
 Blog : http://kasunpanorama.blogspot.com/



 --
 Kasun Indrasiri
 Associate Technical Lead
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 71 536 4128
 Blog : http://kasunpanorama.blogspot.com/

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


Re: [Dev] Payload Factory to support multiple message formats

2013-03-19 Thread Nalin Chandraratne
Hi Kasun,

Now the payload factory is being improved to support following cases
without intermediate conversions.

XML-JSON
JSON-JSON
JSON-XML

Its almost done. I'll attach configs and samples when the feature is
finished.

Thanks.


On Tue, Mar 19, 2013 at 9:28 AM, Kasun Indrasiri ka...@wso2.com wrote:

 Hi Nalin,

 Please update with the status of the Payload Factory improvements to
 support multiple content types. (currently XML/JSON).

 Thanks.
 --
 Kasun Indrasiri
 Associate Technical Lead
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 71 536 4128
 Blog : http://kasunpanorama.blogspot.com/

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


[Dev] Compilation failure on project org.wso2.carbon.usage:

2012-12-05 Thread Nalin Chandraratne
[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 59.527s
[INFO] Finished at: Wed Dec 05 16:02:57 IST 2012
[INFO] Final Memory: 331M/1228M
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project org.wso2.carbon.usage: Compilation failure
[ERROR]
/home/nalin/svn-checkouts/platform/components/stratos/usage/org.wso2.carbon.usage/2.0.5/src/main/java/org/wso2/carbon/usage/api/TenantUsageRetriever.java:[431,32]
error: name clash: convertListToArray(ListRequestStatistics) and
convertListToArray(ListBandwidthStatistics) have the same erasure
[ERROR] - [Help 1]
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] platform build error

2012-12-04 Thread Nalin Chandraratne
[INFO] BUILD FAILURE
[INFO]

[INFO] Total time: 39:58.580s
[INFO] Finished at: Tue Dec 04 16:10:39 IST 2012
[INFO] Final Memory: 289M/1133M
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default) on project
hive-deploy: An Ant BuildException has occured: The following error
occurred while executing this line:
[ERROR]
/home/nalin/svn-checkouts/platform/dependencies/hive/0.8.1-wso2v5/build.xml:297:
The following error occurred while executing this line:
[ERROR]
/home/nalin/svn-checkouts/platform/dependencies/hive/0.8.1-wso2v5/build.xml:151:
The following error occurred while executing this line:
[ERROR]
/home/nalin/svn-checkouts/platform/dependencies/hive/0.8.1-wso2v5/jdbc/build.xml:61:
Compile failed; see the compiler error output for details.
[ERROR] around Ant part ...ant
antfile=/home/nalin/svn-checkouts/platform/dependencies/hive/0.8.1-wso2v5/deploy/../build.xml
target=package... @ 4:121 in
/home/nalin/svn-checkouts/platform/dependencies/hive/0.8.1-wso2v5/deploy/target/antrun/build-main.xml
[ERROR] - [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the
command
[ERROR]   mvn goals -rf :hive-deploy

Plz look in to this.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Error when building kernel/patch-releases/4.0.5

2012-11-22 Thread Nalin Chandraratne
INFO] --- maven-antrun-plugin:1.1:run (source-code-generation) @
org.wso2.carbon.user.mgt.stub ---
[INFO] Executing tasks
 [java] Retrieving document at 'src/main/resources/UserAdmin.wsdl'.
 [java] Exception in thread main java.lang.NoClassDefFoundError:
org/apache/axiom/om/OMNode
 [java] at
org.apache.axis2.description.WSDLToAxisServiceBuilder.init(WSDLToAxisServiceBuilder.java:103)
 [java] at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.init(WSDL11ToAxisServiceBuilder.java:217)
 [java] at
org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.init(WSDL11ToAllAxisServicesBuilder.java:63)
 [java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerationEngine.java:166)
 [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
 [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
 [java] Caused by: java.lang.ClassNotFoundException:
org.apache.axiom.om.OMNode
 [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 [java] at java.security.AccessController.doPrivileged(Native Method)
 [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
 [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
 [java] ... 6 more
 [java] Java Result: 1
[INFO] Executed tasks
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev