Friday, November 2, 2012

Invoking a web service with HTTP Basic authentication – OSB 11g

Invoking a web service with HTTP Basic authentication – OSB 11g:


To invoke the webservice that is protected with basic authentication, the Service account needs to be created and attached to the outbound business service (the service that calls the webservice)
This post explains the steps required to invoke the basic authentication enabled service.

Steps to invoke the basic authentication enabled service

  • Login to sbconsole
  • Create the Service AccountA service account provides a user name and password that proxy services and business services use for outbound authentication or authentication to a local or remote resource, such as an FTP server or a JMS server. For example, if a business service is required to supply a user name and password for transport-level authentication with a Web Service, you create a service account that specifies the user name and password and then you configure the business service to include the service-account credentials in its outbound requests.
  • Select Project Explorer and then select a project or folder in which to add the service account
  •  From the Create Resource drop-down list, select Service Account to display the Create a New Service Account page

Tuesday, October 30, 2012

The server does not support version 3.0 of the J2EE Web module specification - Eclipse

The server does not support version 3.0 of the J2EE Web module specification -  Eclipse

Sometimes we used to receive the following exception when running the web application in latest eclipse version.

The server does not support version 3.0 of the J2EE Web module specification.

The issue is when creating the web project in latest eclipse by default the web version  will be selected as 3.0 but the server what we are having is not supporting the web 3.0.

There is two options to fix this issue.

1. Upgrade your server to latest version
2.Open org.eclipse.wst.common.project.facet.core.xml file from /workspace/<Your project name>/.settings and change jst.web version to 2.5 instead 3.0

<installed facet="jst.web" version="2.5"/>



Monday, October 29, 2012

Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part1


Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part1

Sometimes we used to get the below error message while deploying the composites to theOracle SOA Suite  server.

oracle.fabric.common.wsdl.XSDException: Global element declaration/definition of name '{http://xmlns.oracle.com/GlobalDeclaration/employee}Employee' are duplicated at the following locations:

http://localhost:8000/soa-infra/services/default/EmployeeServer/employeeserver_client_ep?XSD=xsd/EmployeeServer.xsd [line#: 4]
http://localhost:8000/soa-infra/services/default/EmployeeServer/xsd/EmployeeServer.xsd [line#: 3]
file:/reuters/shared/11g/software/soa_deploy/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd [line#: 6]
There are at least two of them looking different:
http://localhost:8000/soa-infra/services/default/EmployeeServer/employeeserver_client_ep?XSD=xsd/EmployeeServer.xsd [difference starting at line#:7]
file:/reuters/shared/11g/software/soa_deploy/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd [difference starting at line#:9]

The exception states the definition of the element Employee with the names spaces “http://xmlns.oracle.com/GlobalDeclaration/employee” differs in the following location.


file:/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd

I am having two composites EmployeeClient and EmployeeServer, EmployeeClient invokes EmployeeServer via parnerlink, EmployeeClient and EmployeeServer composites are defined with the following xsd’s

EmployeeClient/EmployeeClient.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
                elementFormDefault="qualified"
                targetNamespace="http://xmlns.oracle.com/GlobalDeclaration/employee"
                xmlns="http://www.w3.org/2001/XMLSchema">
                <element name="Employee">
                                 <complexType>
                                                 <sequence>
                                                                 <element name="empid" type="string"/>
                                                 </sequence>
                                 </complexType>
                </element>               
</schema>

EmployeeServer/EmployeeServer.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
                elementFormDefault="qualified"
                targetNamespace="http://xmlns.oracle.com/GlobalDeclaration/employee"
                xmlns="http://www.w3.org/2001/XMLSchema">
                <element name="Employee">
                                 <complexType>
                                                 <sequence>
                                                                 <element name="empid" type="string"/>
                                <element name="empname" type="string"/>
                                <element name="contactno" type="string"/>
                                <element name="state" type="string"/>
                                                 </sequence>
                                 </complexType>
                </element>
               
</schema>

Thursday, October 25, 2012

Auto Submitting the HTML page on load

Auto Submitting the HTML page on load - Auto Submitting the HTML page on load:


<html>
<head>
<script>
window.onload = function()
{
 document.login.submit();
}
</script>
</head>
<body>
<FORM name="login" action="http://localhost:7001/analytics/saw.dll?bieehome" method="post">
    <INPUT type="hidden" name="nQUser" value="weblogic">
    <INPUT type="hidden" name="nQPassword" value="weblogic123">
   </FORM>
 </FRAMESET>
 </body>
</html>

Wednesday, October 24, 2012

ResourceLimitException : No resources currently available in pool to allocate to applications – Oracle SOA 11g

ResourceLimitException : No resources currently available in pool to allocate to applications – Oracle SOA 11g

You could have observed the below exception frequently in the weblogic server log file, weblogic server throws the below exception when there is not enough database connections in the pool to serve the incoming requests reporting increasing the connection pool count. This will affect the overall system  performance

java.sql.SQLException: Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool SOADataSource to allocate to applications, please increase the size of the pool and retry..
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:577)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:342)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:329)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:417)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:324)


The above exception is due to there is not enough connections available in the pool to service the requests.

To identify which datasource / connection pool requires more connection do the following.

  • Go to Weblogic Admin console
  • Go to Environment -> Servers
  • Select the server on which the connection pool needs to be monitored
  • Go to Monitoring -> JDBC
  • Customize the table to add the below two properties
This page will list all the datasources/ connection pools targeted to that particular server and how many connections are waiting to get the connection. If more number of connections are waiting, that is not a good which will cause performance impact and also cause stuck threads on the server if the wait time is going to be beyond the thread stuck time (By default it's 10 mins).

(This screen shot taken by reducing the max capacity to 5 for blogging purpose, unfortunately I did not captured the actual screen shot)