Monday, February 2, 2015

Exporting Putty sessions

If you want to export your Putty sessions and settings in order to import it into another machine, simply type this command from the Command Prompt (single line):
regedit /e "%userprofile%\desktop\putty-registry.reg" HKEY_CURRENT_USER\Software\Simontatham
Simply transfer the exported file to the new machine and double-click on it to update the Windows Registry settings.


 

Sunday, January 4, 2015

Anybody else confused by Oracle WebCenter?


Let me be blunt. Oracle screwed up when it came up with the whole Oracle WebCenter idea. Oracle WebCenter Suite eventually became Oracle WebCenter with these interlocked products in some senseless jigsaw puzzle, as if they were interconnected or something.

Does this jigsaw puzzle make sense? Not to me!

It was initially touted as a user engagement platform. I'm not sure if it still is. But now WebCenter is comprised of 3 products.

Currently, the 3 primary products included in Oracle WebCenter are: WebCenter Portal, WebCenter Content, and WebCenter Sites. Each of these products has it's own set of features and functionality while still being under the WebCenter name. They are only related by name, though can be integrated together to provide more comprehensive functionality. (Technically, it can be integrated with so many other Oracle products as well.)


Oracle WebCenter Portal

Portlets, which are pluggable windows that are embedded into portals, are useful for users who require an initial dashboard into their numerous intranet applications.

Portals are mostly valuable in intranets, but also in extranets (think Yahoo! where you have access to all mail, financial, news, scores, weather all in a single page).

WebCenter Portal is intended to provide a central place to consume information and services distributed throughout your company's infrastructure. This helps simplify user productivity by providing them with a means to managing their tasks in a single place. Development is primarily is done with ADF and a number of reusable templates.

Oracle WebCenter Portal is not to be confused with Oracle Portal (old and discontinued), BEA WebLogic Portal (acquired from BEA and discontinued), Oracle Sun Portal (acquired from Sun and discontinued), or Oracle WebCenter Suite (the old name).

A screenshot of a portal created with Oracle WebCenter Portal

Some of the key strengths of WebCenter Portal:
  • Quickly create dynamic portals and websites - you can be up and running in 24 hours!
  • Easily expose data from WebCenter Content, which is a repository that hosts structured and unstructured data.
  • Supposedly incorporates the best features from the old Oracle, BEA, and Sun portals combined.


Oracle WebCenter Content

Oracle WebCenter Content provides ECM (Enterprise Content Management) functionality, allowing the storage and retrieval of structured and unstructured data and records management, combined with powerful search and accessibility features.

Formerly known as Oracle UCM (Universal Content Management) and originally acquired from Stellent, Oracle's WebCenter Content is a content management system. The extent of this product lies not simply in the managing of digital documents, but there are also features which allow for the tracking of related physical documents. It can act as a repository for your company's digital assets, create web friendly format for high resolution files and provide a central place for publishing digital assets. There is a supplementary product called WebCenter Imaging which allows for the capture of documents into WebCenter Content. It provides data capture from scanned documents and images, and markup on those documents.

Using Windows Explorer to access Oracle WebCenter Content documents

Some of the key strengths of WebCenter Content:
  • Incredibly powerful search capabilities.
  • Stores unstructured content of all types; documents, images, video, etc.
  • Mobile apps allow access through smartphones and tablets.
  • Desktop integration with Microsoft Office, Microsoft Outlook, and Windows Explorer.


Oracle WebCenter Sites

Business users can easily manage website content without the involvement of a developer, pulling data from any number of data sources.

WebCenter Sites is another acquisition, formerly called FatWire. WebCenter Sites is focused on the easy creation of websites for consumers using drag-and-drop functionality. Integration with WebCenter Content provides the ability to easily publish content that your company has accumulated; and websites can be easily optimized for mobile devices. WebCenter Sites Satellite Server (an additional license) can be used to establish a content delivery network (CDN) for your company.

Easily update website content with Oracle WebCenter Sites

Some of the key strengths of WebCenter Sites:
  • A web content management system designed for business users to easily add and update website content.
  • Mobile enable your website with no coding changes.
  • Provides features such as comments, ratings, reviews, polls, blogs, etc.
  • Segment-based and predictive targeting and analytics is provided.


Summary

The 3 products are unrelated no matter what Oracle says and the statement that "we are running WebCenter" doesn't make too much sense. I have no issues with any of the three WebCenter products. In fact, they are extremely powerful with WebCenter Content being the most mature of the group. My issue is purely with the naming and marketing.


 

Friday, December 26, 2014

The many centers of Oracle WebCenter

The capabilities of a product are the first thing anyone considers when looking at any product. WebCenter like with many products Oracle sells it is really more than one product. The three primary products presented are as follows: WebCenter Portal, WebCenter Content, and WebCenter Sites. Each of these products has it's own set of features and functionality while still being under the WebCenter name.

WebCenter Portal
This product is intended to provide your employees and customers with a central place to consume information and services distributed throughout your company's infrastructure. This helps relieve stress by only needing to worry about managing their tasks in a single place. Development is primarily is done with ADF and a number of reusable templates.

WebCenter Content
Formerly known as Universal Content Management, Oracle's WebCenter Content is a content management system as the title might imply. The extent of this product lies not simply in the managing digital documents. There are also features which allow for the tracking of related physical documents. It can act as a repository for your company's digital assets, create web friendly format for high resolution files and provide a central place for publishing digital assets. There is a supplementary product called WebCenter Imaging which allow for the capture of documents into WebCenter Content. It provides data capture from scanned documents and images, and markup on those documents.

WebCenter Sites
Sites is focused on easy creation of websites for consumers, drag-and-drop functionality and integration of WebCenter Content allow help with publishing content that your company has accumulated; sites can also help with optimizing for mobile devices. With an additional license called WebCenter Sites Satellite Server which can be used to establish a content delivery network (CDN) for you company.

Summary
With all of these products combined your company can build its web presence, internal web pages for your employees to complete their daily tasks and manage the many documents that are involved with business. While together the products have the potential to be very powerful, it is always good to take a look at them individually and determine the need for each.



Monday, November 10, 2014

Quickly check and fix the POODLE vulnerability on Apache, WebLogic Server, and OHS

If you are running SSL 3.0, you need to be aware of the POODLE vulnerability:

There are no patches since the POODLE vulnerability is a design flaw in the protocol itself and not an implementation bug. TLS is now the preferred encryption protocol.


Are you vulnerable?

Courtesy of this website, you can check if your website is available over SSLv3 with:
curl -v -3 -X HEAD https://www.raastech.com
If you are not vulnerable, you should not be able to connect, and your output should look something like this:
* SSL peer handshake failed, the server most likely requires a client certificate to connect
If you are vulnerable, you should see normal connection output, including the line:
* SSL 3.0 connection using SSL_NULL_WITH_NULL_NULL


Fix for Apache

1. Edit the ssl.conf and add the following:
SSLProtocol All -SSLv2 -SSLv3


Fix for WebLogic Server

1. Add the following to all the JVMs:
-Dweblogic.security.SSL.protocolVersion=TLS1 
2. Remove the following line if found in the configuration:
-Dweblogic.security.SSL.protocolVersion=SSL3
3. Restart.



Fix for Oracle HTTP Server (OHS)

1. Edit httpd.conf and edit the SSLProtocol directive as follows:
OLD: SSLProtocol ALL –SSLv2
NEW: SSLProtocol ALL –SSLv2 –SSLv3
2. Restart.



References:




 

Thursday, November 6, 2014

WebLogic JMS: Failed to create managed connection due to NullPointerException

Problem:

Our SOA composite is using the JMSAdapter to poll messages from a JMS queue. However, no messages were being polled.

Our JCA file looked like this. Nothing special about it and you can see that our connection factory JNDI is set to eis/jms/Order and our queue JNDI is jms/OrderQueue.
<adapter-config name="ConsumeOrder" adapter="JMS Adapter" wsdlLocation="ConsumeOrder.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  <connection-factory location="eis/jms/Order" UIJmsProvider="WLSJMS" UIConnectionName="EBIZPROD"/>
  <endpoint-activation portType="Consume_Message_ptt" operation="Consume_Message">
    <activation-spec className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
      <property name="PayloadType" value="TextMessage"/>
      <property name="UseMessageListener" value="false"/>
      <property name="DestinationName" value="jms/OrderQueue"/>
    </activation-spec>
  </endpoint-activation>
</adapter-config>
When we enabled the oracle.soa.adapter logger to TRACE:32, not much additional information was revealed, but these are the recurring entries we see in the soa_server1-diagnostic.log file:
[2014-11-06T00:43:18.826-05:00] [soa_server1] [TRACE] [] [oracle.soa.adapter] [tid: [ACTIVE].ExecuteThread: '27' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: 7fecb0f5a423ee5f:-2152fc99:1497985c034:-8000-0000000002803edb,0] [APP: soa-infra] [SRC_CLASS: oracle.integration.platform.blocks.adapter.fw.log.LogManagerImpl] [SRC_METHOD: log] JMSAdapter SOAOrder JMSConnectionFactoryFactory_getConnectionFactory: looking up 'null' 
[2014-11-06T00:43:18.826-05:00] [soa_server1] [ERROR] [] [oracle.soa.adapter] [tid: [ACTIVE].ExecuteThread: '27' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: 7fecb0f5a423ee5f:-2152fc99:1497985c034:-8000-0000000002803edb,0] [APP: soa-infra] JMSAdapter SOAOrder JMSMessageConsumer_init:[destination = JMSServer_1@jms/OrderQueue (payload = 1)]:Failed to create managed connection: java.lang.NullPointerException 
[2014-11-06T00:43:18.826-05:00] [soa_server1] [ERROR] [] [oracle.soa.adapter] [tid: [ACTIVE].ExecuteThread: '27' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: 7fecb0f5a423ee5f:-2152fc99:1497985c034:-8000-0000000002803edb,0] [APP: soa-infra] JMSAdapter SOAOrder [[
javax.resource.spi.ResourceAdapterInternalException: Failed to create managed connection: java.lang.NullPointerException
        at weblogic.connector.outbound.ConnectionFactory.createResource(ConnectionFactory.java:152)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1322)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:428)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:352)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:332)
        at weblogic.connector.outbound.ConnectionPool.reserveResource(ConnectionPool.java:620)
        at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:326)
        at weblogic.connector.outbound.ConnectionManagerImpl.getConnectionInfo(ConnectionManagerImpl.java:380)
        at weblogic.connector.outbound.ConnectionManagerImpl.getConnection(ConnectionManagerImpl.java:320)
        at weblogic.connector.outbound.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:129)
        at oracle.tip.adapter.jms.JmsConnectionFactory.getConnection(JmsConnectionFactory.java:93)
        at oracle.tip.adapter.jms.JMS.JMSMessageConsumer.createConsumer(JMSMessageConsumer.java:321)
        at oracle.tip.adapter.jms.JMS.JMSMessageConsumer.init(JMSMessageConsumer.java:920)
        at oracle.tip.adapter.jms.inbound.JmsConsumer.init(JmsConsumer.java:894)
        at oracle.tip.adapter.jms.JmsDDEndpoint.onDestinationsAvailable(JmsDDEndpoint.java:175)
        at weblogic.jms.extensions.JMSDestinationAvailabilityHelper$DestinationAvailabilityListenerWrapper$2.run(JMSDestinationAvailabilityHelper.java:386)
        at weblogic.jms.extensions.JMSDestinationAvailabilityHelper$DestinationAvailabilityListenerWrapper.callOutListener(JMSDestinationAvailabilityHelper.java:402)
        at weblogic.jms.extensions.JMSDestinationAvailabilityHelper$DestinationAvailabilityListenerWrapper.onDDMembershipChange(JMSDestinationAvailabilityHelper.java:383)
        at weblogic.jms.common.CDS$DD2Listener.run(CDS.java:1279)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.lang.NullPointerException
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at oracle.tip.adapter.jms.JMS.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:132)
        at oracle.tip.adapter.jms.JMS.JMSConnectionFactoryFactory.getQueueConnectionFactory(JMSConnectionFactoryFactory.java:86)
        at oracle.tip.adapter.jms.JMS.JMSConnection.init(JMSConnection.java:156)
        at oracle.tip.adapter.jms.JMS.JMSConnection.<init>(JMSConnection.java:113)
        at oracle.tip.adapter.jms.JMS.WLJMSConnection.<init>(WLJMSConnection.java:76)
        at oracle.tip.adapter.jms.JmsManagedConnectionFactory.createConnection(JmsManagedConnectionFactory.java:311)
        at oracle.tip.adapter.jms.JmsManagedConnectionFactory.createDefaultConnection(JmsManagedConnectionFactory.java:305)
        at oracle.tip.adapter.jms.JmsManagedConnectionFactory.createConnection(JmsManagedConnectionFactory.java:286)
        at oracle.tip.adapter.jms.JmsManagedConnectionFactory.createManagedConnection(JmsManagedConnectionFactory.java:92)
        at weblogic.connector.security.layer.AdapterLayer.createManagedConnection(AdapterLayer.java:803)
        at weblogic.connector.outbound.ConnectionFactory.createResource(ConnectionFactory.java:91)
        ... 20 more

Navigating to the JmsAdapter in the WebLogic Server Administration Console (navigate to Deployments > JmsAdapter > Monitoring > Outbound Connection Pools), we can see that there are considerable "Rejected Connections":

In the Oracle documentation, the definition of a "Rejected Connection" does not yield too much information:
Rejected Connections:
The total number of rejected requests for a Connector connections in this Connector Pool since the pool is instantiated.

Solution:

Looking deeper into the stack trace in the log above, it seems that getting the connection factory is returning 'null'.

1. Log in to the WebLogic Server Administration Console

2. Navigate to Deployments > JmsAdapter > Configuration > Outbound Connection Pools

3. Expand oracle.tip.adapter.jms.IJmsConnectionFactory and click on the JNDI eis/jms/Order

4. The ConnectionFactoryLocation is empty. Populate this with the appropriate value.

5. Save and redeploy the JmsAdapter.


Applicable Versions:
  • Oracle WebLogic Server 11g (10.3.5+)
  • Oracle SOA Suite 11g (11.1.1.5+) 

 

Tuesday, November 4, 2014

Resolving BEA-101216 and MDS-00054 (composite.xml does not exist) at SOA server startup

Problem:

The soa-infra application was causing the soa_server1 to go into ADMIN mode with the following error in the logs:
<Nov 4, 2014 12:43:22 PM EDT> <Error> <oracle.integration.platform.blocks.cluster> <BEA-000000> <Starting in multicast, rather than unicast, mode for SOA/Coherence clustering. This is not the configuration recommended by the Oracle Enterprise Deployment Guide (EDG). If continuing to use multicast you may run into deployment issues if there are multicast address conflicts with other servers on your network. If attempting unicast operation, make sure the unicast well-known addresses (-Dtangosol.coherence.wka1, -Dtangosol.coherence.wka2,..) and ports are set for scaling out to multiple servers per the EDG.>
INFO: FaultPoliciesParser.<init> ------->Constructed Policy parser 
<Nov 4, 2014 12:44:02 PM EDT> <Warning> <oracle.soa.services.notification> <BEA-000000> <<.> With the current setting, only Email notifications will be sent; Notifications via voice, SMS or IM will not be sent. If you would like to enable them, please configure corresponding sdpmessaging driver. Then modify the accounts and set NotificationMode attribute to ALL in workflow-notification-config.xml>
BPMNServiceEngine=> constructed ....
log4j:WARN No appenders could be found for logger (wsif).
log4j:WARN Please initialize the log4j system properly. 
<Nov 4, 2014 12:45:02 PM EDT> <Warning> <oracle.as.jmx.framework.MessageLocalizationHelper> <J2EE JMX-46041> <The resource for bundle "oracle.soa.management.config.identity.mbeans.MessageBundle_en" with key "ProviderMXBean.SearchableUserAttributMapAdd" cannot be found.> 
<Nov 4, 2014 12:45:23 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "FabricInit" failed to preload on startup in Web application: "/soa-infra".
oracle.fabric.common.FabricException: Error in getting XML input stream: oramds:/deployed-composites/HelloWorld_rev1.0/composite.xml: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/deployed-composites/HelloWorld_rev1.0/composite.xml does not exist.
at oracle.fabric.common.metadata.MetadataManagerImpl.getInputStreamFromAbsoluteURL(MetadataManagerImpl.java:288)
at oracle.integration.platform.common.MDSMetadataManagerImpl.getInputStreamFromAbsoluteURL(MDSMetadataManagerImpl.java:624)
at oracle.fabric.common.metadata.MetadataManagerImpl.getDocumentAsInputStream(MetadataManagerImpl.java:164)
at oracle.integration.platform.common.MDSMetadataManagerImpl.getDocumentAsInputStream(MDSMetadataManagerImpl.java:486)
at oracle.integration.platform.kernel.FabricKernelInitializerServlet.deployComposite(FabricKernelInitializerServlet.java:762)
Truncated. see log file for complete stacktrace
Caused By: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/deployed-composites/HelloWorld_rev1.0/composite.xml does not exist.
We are unable to undeploy the faulty composite HelloWorld while the soa-infra application is down.


Solution:

To undeploy a SOA composite application while the soa-infra application is down, perform the following steps.

1. See Oracle Support Doc ID 1380835.1 and download ShareSoaInfraPartition.ear

2. Run the following commands:
cp ShareSoaInfraPartition.ear /u01/app/oracle/middleware/oracle_common/common/bin 
cd /u01/app/oracle/middleware/oracle_common/common/bin 
./wlst.sh 
connect() 
deploy('ShareSoaInfraPartition','ShareSoaInfraPartition.ear',upload='true') 
exportMetadata(application='ShareSoaInfraPartition',server='AdminServer',toLocation='/tmp/ahmed',docs='/deployed-composites/deployed-composites.xml') 
vi /tmp/ahmed/deployed-composites/deployed-composites.xml

3. Delete the lines of that are of the composite you want removed. For example, delete these lines in the file:
<composite-series name="default/HelloWorld" default="default/HelloWorld!1.0"> 
  <composite-revision dn="default/HelloWorld!1.0" state="on" mode="active" location="dc/soa_642a5dc3-5453-447e-b8a8-b707907cb6f6"> 
    <composite dn="default/HelloWorld!1.0*soa_e566512d-69ef-4d29-83dd-c3d38ce14916" deployedTime="2014-02-27T19:02:26.120-05:00"/> 
    <composite dn="default/HelloWorld!1.0*soa_642a5dc3-5453-447e-b8a8-b707907cb6f6" deployedTime="2014-06-23T14:41:03.155-04:00"/> 
  </composite-revision> 
</composite-series>
4. Then run this final command:
importMetadata(application='ShareSoaInfraPartition',server='AdminServer',fromLocation='/tmp/ahmed',docs='/deployed-composites/deployed-composites.xml')

References:
  • Oracle Support Doc ID 1380835.1

Applicable Versions:
  • Oracle SOA Suite 11g (11.1.1.5+) 

 

Wednesday, October 29, 2014

JCA FTP Adapter limited to 4MB in OSB

Problem:

If you are using the FTPAdapter with OSB 11g (specifically 11.1.1.7), you may experience the following Java exception in the osb_server1.out log file:
####<Oct 29, 2014 3:04:41 AM EDT> <Warning> <JCA_FRAMEWORK_AND_ADAPTER> <soahost1> <osb_server1> <[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <0000K^N1fyV8t1RMyYqYMG1JKBeB0000uE> <1413443141803> <BEA-000000> <onReject: The resource adapter 'FTP Adapter' requested handling of a malformed inbound message. However, the following activation property has not been defined: 'rejectedMessageHandlers'. Please define it and redeploy. Will use the default Rejection Directory file://jca/Get/rejectedMessages for now.>

Solution:

The default properties in the JCA FTP Adapter limits files to 4MB when polling for inbound messages.

1. Edit the FTPAdapter and add the following property:
<property name="SupportsScalableDOM" value="false"/>

References:

  • Oracle Document Id: PayloadSizeThreshold not Working for Files Larger than 4MB (Doc ID 1628065.1)


Applicable Versions:
  • Oracle Service Bus (OSB) 11g (11.1.1.7) 

 

Tuesday, October 28, 2014

Oracle OpenWorld 2014 Opening Keynote

The week of Oracle OpenWorld 2014 started out Sunday, September 28th, 2014 in true Oracle fashion. Safra Catz, one of the two newly appointed CEO's of Oracle, who has been with Oracle for 15 years started out the afternoon Keynote by saying that even though he has stepped down as CEO, "Larry Ellison’s vision is more alive today than ever." Then, Catz introduced her friend and fellow industry leader Renee James, and, after the two leading females snagged a quick hug from one another, James took the stage to share her keynote on "The Future of the Data Center in a Software-Defined World."


Renee, President of Intel Corporation, described her excitement of being the "opening act" for Larry Ellison and how this year marks a 20-year partnership between Oracle and Intel. She began her keynote by trying to convey the massive quantities in which data is being used today, and how much data will be being used in the future. She says making sense of all the data is the key to providing meaningful insights into the human condition.


In her keynote, James talked about "Big Bang" of data, private cloud vs. public cloud, the Next Generation firewall, the first Silicon photonics chip, and something called the Nile-o-Meter. She explained that 90% of the data today, was produced in the last 2 years. She described the partnership between Intel and Oracle, and how the two companies are working together to provide value in the areas of private cloud, in many cases exceeding that of the public cloud. Also, she spoke about the future of private and public clouds, saying that it is possible for private clouds to have similar costs to public clouds, and how 47% of workloads are expected to be running in a hybrid mode by 2017. Lastly, she gave the crowd a sneak peak at Intel's new silicon photonics chip, which is able to move data faster than traditional copper over longer distances.

Renee introduced Larry Ellison, donning his new title of Chief Technology Officer and Executive Chairman of the Board at Oracle. Ellison stepped down as CEO in the weeks prior to Oracle OpenWorld 2014. Ellison took the stage and welcomed the OOW 14 attendees. He began the opening keynote by describing 2014 as a turning point for Oracle. He explained that this year, Oracle built a lot of technology for the cloud and gained momentum in the cloud business. Several years ago Oracle realized that they will had no choice but to deliver services at all 3 layers of the cloud. The reason is because of a promise he made to Oracle's customers 30 years ago. A promise that compelled him to deliver Saas, Paas, and Iaas together, and better than the competitor. He explains that Oracle has more applications than anybody, and Oracle's upgrade to platform allows you to move any database to the cloud by pushing a button.


Between swigs from his glass bottle of Coca-Cola, he explained how three decades ago, Oracle customers were wanting to move from minicomputer and mainframe database to the next generation of architecture without re-writing everything. Oracle made a promise to make this easy. Customers expect Oracle to move databases to the next generation without changing a single line of code. Therefore, the big announcement for the day was the "massively" upgraded Oracle Database Platform as a Service. Database is Oracle's largest software business, and Larry confidently declares that database will be by far their largest cloud business. Customers have been waiting for the opportunity to take advantage of lower cost and higher reliability, but they want to move to the cloud gracefully and easily. Oracle allows them to move and modernize. However, Ellison maintained that Oracle is just getting started in the Cloud. Ellison closed the keynote by saying that "there is nothing more important in the modern cloud than securing your data" and delivered another 30 year promise, that discovering and stopping programs with malicious intent is top priority at Oracle.

Sunday, September 21, 2014

Using the Camera In iOS 8 with Swift

There are many examples out there that solidly explain how to use a camera using Objective-C. They can be found here, here, and many other places. The one thing I had not yet seen was how exactly to use it when using the new Swift Language that Apple recently released.

Below is the code that can be used, and there are a two changes to note that have come with the iOS 8 SDK.  The first is UIImagePickerControllerSourceType  where before you would access it by calling UIImagePickerControllerSourceTypeCamera now you call  UIImagePickerControllerSourceType.Camera . The second has more to do with strings different types, CFString vs NSString so to deal with this little issue the following code exists:

let compResult:CFComparisonResult = CFStringCompare(mediaType as NSString!, kUTTypeImageCFStringCompareFlags.CompareCaseInsensitive)
        if ( compResult == CFComparisonResult.CompareEqualTo ) {

Other than that there are the obvious differences between Objective-C and Swift. I hope this helps.

Example Code:

import UIKit
import CoreData
import MobileCoreServices


class CameraVC: UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate {


    @IBOutlet weak var cameraView: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        

        // Do any additional setup after loading the view, typically from a nib.
    }
    
    override func viewWillAppear(animated: Bool) {
        
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    // MARK: - Action Methods
    
    @IBAction func takePhoto(sender: AnyObject) {
        if (UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera)){
            var picker = UIImagePickerController()
            picker.delegate = self
            picker.sourceType = UIImagePickerControllerSourceType.Camera
            var mediaTypes: Array<AnyObject> = [kUTTypeImage]
            picker.mediaTypes = mediaTypes
            picker.allowsEditing = true
            self.presentViewController(picker, animated: true, completion: nil)
            
            
        }
        else{
            NSLog("No Camera.")
        }
    }
    
    // MARK: - Delegate Methods
    
    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: NSDictionary!) {
        NSLog("Did Finish Picking")
        let mediaType = info[UIImagePickerControllerMediaType] as String
        var originalImage:UIImage?, editedImage:UIImage?, imageToSave:UIImage?
        
        // Handle a still image capture
        let compResult:CFComparisonResult = CFStringCompare(mediaType as NSString!, kUTTypeImage, CFStringCompareFlags.CompareCaseInsensitive)
        if ( compResult == CFComparisonResult.CompareEqualTo ) {
                
                editedImage = info[UIImagePickerControllerEditedImage] as UIImage?
                originalImage = info[UIImagePickerControllerOriginalImage] as UIImage?
                
                if ( editedImage == nil ) {
                    imageToSave = editedImage
                } else {
                    imageToSave = originalImage
                }
                NSLog("Write To Saved Photos")
                cameraView.image = imageToSave
                cameraView.reloadInputViews()
            
                // Save the new image (original or edited) to the Camera Roll
                UIImageWriteToSavedPhotosAlbum (imageToSave, nil, nil , nil)
            
        }

        picker.dismissViewControllerAnimated(true, completion: nil)
        
    }
    
    func imagePickerControllerDidCancel(picker: UIImagePickerController) {
        picker.dismissViewControllerAnimated(true, completion: nil)
    }
    
    

}





Mule: No SQL Strategy found Issue in SQL Server


Problem

I was working on a Mule ESB process, when I came upon an error.

Root Exception stack trace:
java.lang.IllegalArgumentException: No SQL Strategy found for SQL statement: USE XXX_ServiceNow; SELECT LastEventId,LastEventTime FROM dbo.EVENTS_TRACKING;
at com.mulesoft.mule.transport.jdbc.sqlstrategy.EESqlStatementStrategyFactory.create(EESqlStatementStrategyFactory.java:109)
at org.mule.transport.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:69)
at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:81)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)


I will admit this was one of the first times I had worked with SQL Server. I typically use everything except it, but I digress. I was attempting a simple query from a table, but getting back "No SQL Strategy..."

Solution

I had seen this error before, and what it means is that there essentially no SQL plan to be executed. In the original state. I was technically performing two operations.
1. Specifying which database to use.
2. Querying the table.
To solve my problem I needed to combine these two statements into a single statement.

The resulting code looked something like this:
SELECT <FieldName1>, <FieldName2>
FROM <DatabaseName>.<SchemaName>.<TableName>


Friday, August 22, 2014

JCA-11622 using the DbAdapter with OSB 11g

Problem:

If you are using the DbAdapter with OSB 11g (specifically 11.1.1.7), you may experience the following Java exception in the osb_server1.out log file:
jca-transport-application-error xmlns="http://www.bea.com/wli/sb/transports/jca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><jca-transport-error-message>Invoke JCA outbound service failed with application error</jca-transport-error-message><jca-runtime-fault-detail><eis-error-code xsi:nil="true"/><eis-error-message xsi:nil="true"/><exception>com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: servicebus:/WSDL/CreateOrderProvABCSImpl/WSDL/ShipmentOrder [ Order_ptt::insert(OmOrderCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: Could not create/access the TopLink Session.This session is used to connect to the datastore.Caused by java.lang.NullPointerException.; nested exception is:BINDING.JCA-11622Could not create/access the TopLink Session.This session is used to connect to the datastore.Caused by java.lang.NullPointerException.You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.at com.bea.wli.sb.transports.jca.binding.JCATransportOutboundOperationBindingServiceImpl.invokeOneWay(JCATransportOutboundOperationBindingServiceImpl.java:114)at com.bea.wli.sb.transports.jca.JCATransportEndpoint.sendOneWay(JCATransportEndpoint.java:191)

Solution:

Even though the references in the OSB project were correct, the references in the actual .JCA file were not. I’m not sure why the original developer had incorrect references in the actual .JCA file, but OSB 11.1.1.4 was more tolerant and did not seem to care. OSB 11.1.1.7 does care.

1. Ensure that the highlighted references below are valid and correct in your .JCA file:
<?xml version="1.0" encoding="UTF-8"?><con:jcaEntry xmlns:con="http://www.bea.com/wli/sb/resources/config">    WRONG: <con:jca><![CDATA[<adapter-config name="Order" adapter="Database Adapter" wsdlLocation="Order.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    RIGHT: <con:jca><![CDATA[<adapter-config name="Order" adapter="Database Adapter" wsdlLocation="ShipmentOrder.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">

  <connection-factory location="eis/DB/EBS" UIConnectionName="InstanceDetails" adapterRef=""/>  <endpoint-interaction portType="Order_ptt" operation="insert">    <interaction-spec className="oracle.tip.adapter.db.DBWriteInteractionSpec">      <property name="DescriptorName" value="Order.OmOrder"/>      <property name="DmlType" value="insert"/>      WRONG: <property name="MappingsMetaDataURL" value="Order-or-mappings.xml"/>
      RIGHT: <property name="MappingsMetaDataURL" value="ShipOrderToplink.xml"/>
      <property name="DetectOmissions" value="true"/>      <property name="GetActiveUnitOfWork" value="false"/>    </interaction-spec>  </endpoint-interaction> </adapter-config>]]></con:jca>    <con:jcaDependency>        WRONG: <con:wsdlRef wsdlLocation="ShipOrder.wsdl" ref="OrderConfirmProvABCSImpl/WSDL/ShipmentOrder"/>
        RIGHT: <con:wsdlRef wsdlLocation="ShipmentOrder.wsdl" ref="OrderConfirmProvABCSImpl/WSDL/ShipmentOrder"/>
        WRONG: <con:toplinkRef toplinkFile="ShipOrder-or-mappings.xml" ref="OrderConfirmProvABCSImpl/Toplink/ShipOrderToplink"/>
        RIGHT: <con:toplinkRef toplinkFile="ShipOrderToplink.xml" ref="OrderConfirmProvABCSImpl/Toplink/ShipOrderToplink"/>
    </con:jcaDependency></con:jcaEntry>


Applicable Versions:

  • Oracle Service Bus (OSB) 11g (11.1.1.7) 

 

Sunday, August 10, 2014

"java.lang.OutOfMemoryError: PermGen space" when starting SOA Suite 11g with Java 7

Problem:

When starting up SOA Suite 11g running Java 7, you may experience multiple errors in the .out file:
<Aug 9, 2014 9:26:32 PM EDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.OutOfMemoryError: PermGen space
Exception in thread "Timer-1"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Timer-1"Exception in thread "[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'"Exception in thread "[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'"Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "[STANDBY] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'"

<Aug 9, 2014 10:18:10 PM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "CoordinatorPortTypeServlethttp" failed to preload on startup in Web application: "wls-wsat.war".java.lang.OutOfMemoryError: PermGen space        at java.lang.ClassLoader.defineClass1(Native Method)        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)        Truncated. see log file for complete stacktrace>

Solution:

The PermGen needs to be increased if you are running SOA Suite 11g on Java 7 (e.g., java.runtime.version = 1.7.0_60-b19).

1. Log in to the WebLogic Server Administration Console

2. Navigate to "Server > soa_server1 > Configuration > Server Start"

3. Under the 'Arguments' field, add the following:
-XX:PermSize=1024M -XX:MaxPermSize=1024M
4. Save, apply changes, and restart the SOA server.


Applicable Versions:

  • Oracle WebLogic Server 11g (10.3.x)
  • Oracle SOA Suite 11g (11.1.1.x)
  • Java 7 (1.7.x)


References:




Thursday, July 24, 2014

Limit number of retained log files in WebLogic Server 11g

There are numerous log files in Oracle WebLogic Server 11g and ideally what you would want to do is ensure that the number of rotated log files are controlled. For example, you may have already taken the steps to rotate the log files as they grow to a certain size. This is a great first step, but what you also want to do is control how many of those rotated files you wish to retain, otherwise your file system will likely get filled up over time if you don't manually delete them.

1. Log in to the WebLogic Server Administration Console

2. Repeat the instructions below for all managed servers

3. Navigate to "Server > (managed server) > Logging > General"

4. Set the following values:
Limit number of retained files: Enabled
Files to retain: 30

Minimum severity to log: Warning

Severity Level (Log File): Warning

Severity Level (Standard Out): Error

Severity Level (Domain Log Broadcaster): Error

Severity Level (Memory Buffer): Error
5. Navigate to "Server > (managed server) > Logging > HTTP"

6. Set the following values:
Limit number of retained files: Enabled
Files to retain: 30
7. Navigate to "Server > (managed server) > Logging > Data Source" (new in option in current releases)

8. Set the following values:
Limit number of retained files: Enabled
Files to retain: 30
9. For domain level logging properties, navigate to "soa_domain > Configuration > Logging"

10. Set the following values:
Limit number of retained files: Enabled
Files to retain: 30

Applicable Versions:
  • Oracle WebLogic Server 11g (10.3.x)


Friday, June 20, 2014

BEA-387026 encountered after upgrading to OSB 11g (11.1.1.7)

Problem:

When you have an OWSM policy attached to an OSB 11g proxy service, this typically works fine. But after upgrading to OSB 11g PS6 (11.1.1.7), you may experience the following error in the logs:
<Jun 19, 2014 6:34:21 PM EDT> <Error> <OSB Security> <BEA-387026> <An internal web service security error occurred [error-code: InternalError, message-id: 5630667683963361529-6593aaf0.146aae8a55c.-4741, proxy: SalesOrder/ProxyService/SalesOrder, target: null, operation: null]--- Error message:nulljava.lang.NoSuchMethodError: com/bea/wli/sb/security/wss/WssInboundContext.setRequestMessage(Ljavax/xml/soap/SOAPMessage;Ljava/lang/Class;Ljavax/xml/soap/MessageFactory;)V        at com.bea.wli.sb.security.wss.wsm.WsmInboundHandler.processRequest(WsmInboundHandler.java:181)        at com.bea.wli.sb.security.wss.WssHandlerImpl.doInboundRequest(WssHandlerImpl.java:228)        at com.bea.wli.sb.context.BindingLayerImpl.addRequest(BindingLayerImpl.java:291)

Solution:

1. Log in to the WebLogic Server Administration Console

2. Untarget "OWSM Policy Support in OSB Initializer Aplication" from the osb_cluster and AdminServer

3. Shutdown osb_server1, osb_server2, and AdminServer

4. Run these commands on the first node of your cluster (modify directories accordingly):
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server1/tmp 
rm -rf * 
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server1/cache 
rm -rf *
5. Run these commands on the second node of your cluster (modify directories accordingly):
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server2/tmp 
rm -rf * 
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server2/cache 
rm -rf *
6. Startup Admin_Server, osb_server1, osb_server2

7. Target "OWSM Policy Support in OSB Initializer Aplication" from osb_cluster and AdminServer

8. Shutdown osb_server1, osb_server2, and AdminServer

9. Run these commands again on the first node of your cluster (modify directories accordingly):
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server1/tmp 
rm -rf * 
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server1/cache 
rm -rf *
10. Run these commands again on the second node of your cluster (modify directories accordingly):
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server2/tmp 
rm -rf * 
cd /u01/app/oracle/middleware/user_projects/domains/osb_domain/servers/osb_server2/cache 
rm -rf *
11. Startup Admin_Server, osb_server1, osb_server2


Applicable Versions:

  • Oracle Service Bus (OSB) 11g (11.1.1.7)


References:




Thursday, June 19, 2014

Unable to retrieve composite detail in EM Fusion Middleware Control

Problem:

When logging in to the Oracle Enterprise Manager 11g Fusion Middleware Control console to view the details of the SOA composite, you might receive the following error when you click on the composite:
Unable to retrieve composite detail.
The composite X is not available. This could happen because either the composite has been undeployed or soa-infra has not yet loaded this composite.

The soa_server1.out log file will show this error:
<Jun 19, 2014 12:00:23 PM EDT> <Error> <Default> <J2EE JMX-46336> <MBean operation access denied.
  MBean: oracle.soa.config:name=soa-infra,j2eeType=CompositeLifecycleConfig,Application=soa-infra
  Operation: getDefaultComposite(java.lang.String)
 
Detail: Access denied. Required roles: Admin, Operator, Monitor, executing subject: principals=[]
java.lang.SecurityException: Access denied. Required roles: Admin, Operator, Monitor, executing subject: principals=[]
        at oracle.as.jmx.framework.wls.spi.security.WLSMBeanSecurityHelper.isInWlsGlobalSecurityRoles(WLSMBeanSecurityHelper.java:245)
Resolution:

Even though the stack trace above claims otherwise, in Oracle SOA Suite 11g (11.1.1.7), you must grant the user 'Administrators' role to the user. Could be a bug.


Applicable Versions:

  • Oracle SOA Suite 11g (11.1.1.7.0)