Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Wednesday, 15 April 2015

How to find out character set in Oracle database

There is a simple SQL Query which can be used to find out the character set used in Oracle database

select * from nls_database_parameters where parameter='NLS_CHARACTERSET';

When I executed this, I got this below.

NLS_CHARACTERSET    AR8MSWIN1256

Wednesday, 31 December 2014

Configuring proper roles to access ActiveVOS console using standard alone server

ActiveVOS serve that is embedded with designer does not have any login screen and by default you will be able to access the console that shows up dashboards, monitor, catalog and other features. But when you install ActiveVOS server as stand alone, you need to configure the server with
proper user and roles. Otherwise, you would not be able to access your http://localhost:8080/activevos page.

If you are familiar with Tomcat, you can add "admin" as user and role. Now you would be able to login as admin user. But you can't still see any contents as you do not have necessary privilege. You need to add these roles again your "admin" user to see proper contents of ActiveVOS console page.

For your reference, I am pasting contents from ActiveVOS site.

1) tomcat\conf\server.xml (file-based configuration)
<Realm className= "org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>


2) tomcat\conf\tomcat-users.xml file:

<role rolename="abTaskClient"/>
<role rolename="abServiceConsumer"/>
<role rolename="abAdmin"/>
<user username="admin" password="admin" roles="abAdmin, abTaskClient, abServiceConsumer"/>


 For further read, please follow this http://infocenter.activevos.com/infocenter/ActiveVOS/v92/index.jsp?topic=/doc.server_userguide/html/SvrUG3-4.html


ActiveVOS Error deploying BPR: No catalog mapping found for resource

I created a business process (BPEL) in ActiveVOS Designer and deployed in embedded server sucessfully. When I exported the process and deployed in standalone ActiveVOS server, the deployment failed. The ActiveVOS server spit the following error:

[INFO][CommonErrorHandlerProcess.bpr] Starting BPR archive deployment.
ERROR: [CommonErrorHandlerProcess.bpr] [CommonErrorHandlerProcess.pdd] Error deploying BPR: No catalog mapping found for resource "project:/org.activebpel.rt.email.services/wsdl/email.wsdl".
[INFO][CommonErrorHandlerProcess.bpr] Finishing BPR archive deployment.


After googling several times, I found that it was due to license issue. I have uploaded the license and the issue is resolved.

Before confirming it is license issue, you may have to follow the below steps:
1. Check if the server started successfully
2. Logon to ActiveVOS server console (http://localhost:6060/activevos)
3. Check the server status (Home --> Server Status)
4. Check the contribution (Catalog --> Contributions)
5. Check the resources after unchecking "Hide System" (Catalog --> Resources --> All)

Happy Orchestrating!

Thursday, 6 November 2014

Tomcat authentication using Remote Address Filter / Remote Address Valve



Remote Address Filer or Remote Address Valve lets you to check the remote machine IP address and decide whether to allow or deny access. This is really useful when you want to enforce system to system authentication. Filter is nothing but an interceptor which will be used by Tomcat server to check if remote server can access the application. For more information, you can check the original documentation at http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote_Address_Filter. In this post, I am trying to explain the power of regular expressions in configuring IP addresses in allow or deny attribute.

 1. A sample valve configuration that allows access only to localhost is:
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1"/>

2. The "allow" attribute can take comma separated values to support configuring more than one remote IP address. This is useful when you have a few IP addresses. If you need to configure a big list of IP addresses, this is going to be tough for you. In this case, you can configure the filter with wild card character to allow (or deny) multiple IP addresses. Sample is as below:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="10.110.156.*"/>
The above will allow from 10.110.156.0 to 10.110.156.255.

3. Alternatively, Tomcat server allows you to use regular expression to have fine control on the way IP addresses are being configured. Look at the below examples:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="10\.110\.156\.\d{1,3}"/>
The above will allow IP addresses from 10.110.156.0 to 10.110.156.999. This is almost similar to output of wildcard example shown above.

4. You may want to still fine tune the values.
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="10\.110\.156\.[1-2][0-9]"/>
The above will allow IP addresses from 10.110.156.10 to 10.110.156.29 only.

So it is really up to how you write regular expression to achieve proper filtering of IP addresses. This link http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html can provide more detailed information on regular expressions.

Happy securing tomcat server!


Friday, 19 September 2014

Apache Camel - Failed to resolve endpoint: smtps://smtp.gmail.com:465

Problem:

While routing incoming JMS message to send mail using "smtps", camel is spitting this error:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: smtps://smtp.gmail.com:465?debugMode=true&password=bbb&username=aaa%40gmail.com due to: No component found with scheme: smtps
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:534)
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:63)
    at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:192)
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
    at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
    at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
    ... 18 more

Camel configuration:
 
<bean id="myNotificationListener" class="MyNotificationListener"/>
  
<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
   <route id="sendmailnotification">
      <from uri="activemq:queue:AuditQueue"/>
      <bean ref="myNotificationListener" method="onMessage"/>
      <setHeader headerName="subject">
        <constant>new incident reported</constant>
      </setHeader>
      <removeHeader headerName="JMSTimestamp">
      </removeHeader>
      <to uri="smtps://smtp.gmail.com:465?username=aaa@gmail.com&amp;password=bbb&amp;debugMode=true"/>
    </route>



Solution:
Please add camel-mail.jar and mail.jar to your classpath