Wednesday, March 9, 2011

User cannot find / view any content in UCM from custom WebCenter application

At a customer, we deployed a custom Portal application which is used for an Intranet and Extranet
One user does not see any content in the Portal.

Situation:

Users are registered in an Oracle Virtual Directory (OVD) for authentication.
Users are registered in an Oracle Internet Directory (OID) for authorization.
Groups are registered in the same OID.
The custom Portal application and UCM point to the OID for user store and group membership
WebCenter Framework 11.1.1.3
UCM 10.1.3.5.1

Analysis:

For viewing content, two groups are defined in OID, one for employees (for the Intranet) and one for customers (for the Extranet)
Analysis showed that the user cannot see any content in UCM as well.
The profile of the user does not show that the user is member of the group Employees, to which he is added in OID.
The UCM server log and server output did not show anything which could lead to the cause of the issue.

To be better abled to view what is logged, I added th line UseRedirectedOutput=true to the UCM config.cfg (located in \server\config).
I also check which Active Sections were defined in the System Audit Information page of UCM (Administration | System Audit Information)
Only the sections system, idocscript, requestaudit, resourceloader were active (which is pretty standard I think)
Since we had some problems regarding a specific user account, I added userprofile and userstorage, selected save and restarted UCM to make the changes effective.

Thanks to the UseRedirectedOutput, a IdcServerNT.log was created in the \server\bin folder. After logging in as the defective user, we saw the following:




userstorage  Thread-1  Start user storage query for user john.doe@portal.com.
userstorage  Thread-1  Created user object for user john.doe@portal.com
userstorage  Thread-1  Expired=false isNewUser=true for john.doe@portal.com
userstorage  Thread-1  Loaded record from database for john.doe@portal.com
userstorage  Thread-1  Retrieving attributes (type=EXTERNAL) for john.doe@portal.com
userstorage  Thread-1  Provider PortalLDAPProvider matches dUserSourceOrgPath
userstorage  Thread-1  Checking Default UserProvider PortalLDAPProvider
userstorage  Thread-1  LdapProvider.checkCredentials() started
userstorage  Thread-1  user: john.doe@portal.com
userstorage  Thread-1  authenticateUser: false
userstorage  Thread-1  User is new to this provider.
userstorage  Thread-1  DN cn=john.doe.,cn=Users,dc=PORTAL,dc=COM found in local data.
userstorage  Thread-1  Unable to load extended info for cn=john.doe.,cn=Users,dc=PORTAL,dc=COM. Reason: !csLdapUnableToBindToObject

We noticed a couple of things.
First of all, the DN of the user contains a period after his name. This is not the way the user is registered in OVD or OID. Therefore, the line stating that th extended info cannot be loaded is correct.
Second, UCM states it loaded a record from the database and uses dUserSourceOrgPath in some way.

Solution:
A query on the USERS table in the OCSERVER schema learned that the dUserSourceOrgPath contained the DN with the additional period, which is used by the LDAP Provider.
An update of this column fixed the issue.

But how was the situation created?
Apparently the creation of the user in OID was incorrect once (including the period) but the entry in OID was deleted and recreated correctly.
But in between these changes, the user had logged onto the system, creating the record in the USERS table, with the incorrect dUserSourceOrgPath :(
So if you change the DN of a user (or any other replicated attributes like full name or email address) be aware of the fact that UCM holds that data in a local table.


Friday, January 28, 2011

WHICH statement for Windows

Ok... I know... Not really an ADF post...
But yesterday I got the question 'Which sqlplus is executed?'
The answer was: e:\app\ses\bin\sqlplus.exe
The return question was 'Are you sure it is??'
Lucky for me, I'm positive that there is only one copy of sqlplus.exe on the machine, as SES (Oracle Secure Enterprise Search) is the only product with an Oracle Client with it...

But what if you're not sure?
With Linux you get a nice little utility called which.
By calling which you get the location of the executable that will be executed if you would run

Windows does not have that utility... yet...
If you create the following batch (or command) file and place it somewhere in your path you do have that utility.

Paste the following code into which(.cmd):
@for %%i in ( %1 ) do @echo. %%~$PATH:i

When you enter which sqlplus.exe you'll see something like:

H:\>which sqlplus.exe
 E:\app\ses\BIN\sqlplus.exe
H:\>


See, I was right... e:\app\ses\bin\sqlplus.exe was executed...
This also works with non-executables:

H:\>which orauts.sym
 e:\app\ohs\Oracle_WT1\bin\orauts.sym
H:\>

Drawback: You need to include the extension. So if the file you look for opmnctl and you do not know the extension, you might need to search for opmnctl.exe, opmnctl.cmd and opmnctl.bat


Happy searching!

Sunday, January 23, 2011

Finally: The book review: Web 2.0 Solutions with Oracle WebCenter 11g

First of all, my sincere apologies for letting everyone have to wait so long for the review. I can list the reasons it took so long, but I think it's a better idea to just review the book...

The book is divided in 10 chapters. In these chapters 'only' two major components of WebCenter are described. Fortunately, these happen to be the two most important components, being WebCenter Framework and WebCenter Spaces. With the Oracle WebCenter Framework, developers can build custom applications and add Web 2.0 features to that application. The book guides the developer through the entire process which makes the book a good guide.

The book assumes the latest release of WebCenter as it was written. During the review period, WebCenter 11g PatchSet 3 is released, which made me redo the first 6 chapters. Besiides from some user interface differences and another implementation of the WebCenter Application in JDeveloper, the steps in the book are still very good to follow.

Chapter 1 gives an overview of Web 2.0 concepts and relates them to the enterprise, thereby introducing the term Enterprise 2.0 The chapter also briefly described Oracle WebCenter Suite in retrospect to the previous descriptions of Web 2.0 and Enterprise 2.0

Chapter 2 guides the developer through the installation of WebCenter Suite. This results in an installation which can be used in the remainder of the book and is a nice environment to experiment with the suite.
What I thought was strange is that even though the book mentions to use the SOA Suite and BPA Suite, the necessary schema's for these suites are not selected in the installation steps of the Repository Creation Utility (RCU) Later on in the book, it appears SOA and BPA Suite are not used, which is just fine. It would only make the book lose focus.

Chapter 3 guides the developer through the installation of JDeveloper, the main tool for custom Java development from Oracle.

Chapter 4 helps you to build a simple portlet and integrate the portlet in a custom WebCenter application. You cannot make any mistakes in the process, except when you deliberately deviate from the text and images. Everything is spelled out to such a level, you cannot go wrong. It has similarities with the Oracle Tutorials.

Chapter 5 introduces ADF and design components. The name of the chapter (Design and Personalization) leads to think Personalization is mentioned, but instead, it mentions Database interaction. Perosnilization comes in Chapter 9. Along with the previous chapter, it's a good start to get familiar with JDeveloper and ADF

Chapter 6 explains the different types of portlets (WSRP, JSF, OmnioPortlet, Ensemble etc) and guides you through the creation of your own ADF portlet that displays table data and one that displays a graph. These portlets, of course, a placed on a WebCenter page.

Chapter 7 explains what the Discussions, Wiki and Blog serves are and how to integrate these. Two techniques are described in detail, using an IFrame and using the WebClipping portlet. The final steps (2 or so) of the last technique are missing, but as it's pretty self explanatory, it's no problem.

Chapter 8 describes how to integrate Search capabilities to your pages. Other ways to find content is by means of Tagging, Linking and RSS feeds. All of these are described in this chapter as well. Again, with clear instructions on how to add these services to your page.

Chapter 9 explains Oracle Composer. One of the most comprehensive components in the ADF WebCenter Framework. It enables the end user to customize the application to their own need. This chapter explains how to integrate the Oracle Composer in your application and how to use it at runtime.

Chapter 10 gives a clear overview of WebCenter Spaces. It'll tell you the different type of pages (Personal, Group and Business Role) and how to manage them. The book even explains how to add users and roles and how to enable access to the different page types.

Overall
The book is very detailed and therefore good to follow for people with no experience of WebCenter, JDeveloper, ADF etc. For the bit experienced developers, it's a good reference.
I wish I had this book when I started with Oracle WebCenter Suite. It would have been a great time saver...
As mentioned previously, the setup is a bit like Oracle Tutorials as in the great detail and screenshots to support the text.
Drawback of the book is the fact that in a number of chapters a new JDeveloper application is created to hold the functionality of that chapter. If a single (or at least a minimum) of application would have been used, you would end up with an application that holds all the features discussed. However, after reading the book, it's a good exercise to integrate all features into one application.
For the (now) latest release of WebCenter (11g PS3, 11.1.1.4) this is still a very usefull book.

Friday, October 29, 2010

Errors running ADF application due to spaces in path or long path names.

At some point, you might run into the problem that you get all kind of 'weird' errors while running your ADF / WebCenter application.
One minute it works fine, the next it fails.

When you run into problems without any obvious cause, you might want to try this.

In the jdeveloper\jdev\jdev\bin folder is a file called jdev.boot.
This file contains a setting named ide.user.dir.var:

#
# The ide.user.dir.var specifies the name of the environment
# variable that points to the root directory for user files.
# The system and mywork directories will be created there. 
# If not defined, the IDE product will use its base directory 
# as the user directory.
#
ide.user.dir.var = JDEV_USER_HOME,JDEV_USER_DIR

It tells JDev what environment variables to use for the default user directory.
If these variables are not set, it defaults to the user directory.
In Windows, this happens to be Documents and settings. The path might look something like this:

C:\Documents and Settings\Application Data\JDeveloper\system11.1.1.2.36.55.36

Besides the fact that the folder contains spaces (which is more than once quite annoying) it's quite long as well.
You can add the two environment variables to the system to change the location of this folder.
Be aware: Any settings done before changing the variables are 'lost' as the folder structure is recreated.
This can be fixed of course by copying / moving the old structure to the new one.
You can change the variables by:
  1. Right click on My Computer
  2. Select Properties
  3. Click Advanced
  4. Click Environment Variables
  5. Add a User variable or System variable called JDEV_USER_HOME and point it to e.g. d:\oracle\jdev_home
  6. Add a User variable or System variable called JDEV_USER_DIR and point it to e.g. d:\oracle\jdev_home
  7. Click OK, OK and OK
  8. Start JDeveloper



Wednesday, October 27, 2010

Invitation for a book review.

Yesterday, I was approached by someone from Packt Publishing with the question if I would like to review a book.
The book in question is called Web 2.0 Solutions with Oracle WebCenter 11g.
As I'm into Web 2.0 (or better yet Enterprise 2.0) and into WebCenter, my interest was raised immediately.
After reading the overview and detailed info from this link, I was convinced to read and review it.

Today, I received a copy of the book and started reading.
Hopefully I can finish it this week and let you know what it's like.

Tuesday, October 12, 2010

Linking WebCenter Spaces to UCM and Discussions

I'm working for a day now on linking the three products together (WCS, UCM and Discussions)
Unfortunately, still no luck :(
Problem:
When I start all processes (HTTP server for UCM, UCM, WLS Admin server, WLS_Services and WLS_Spaces), navigate to WebCenter Spaces and login as weblogic all seems fine.
However, when I try to upload a document, I get the following error in my WLS_Spaces log:

(System Error: Could not find the parameter 'dDocType'.)
oracle.webcenter.doclib.internal.view.DoclibIdcException: Oracle Content Server error: Unable to execute service COLLECTION_CHECKIN_NEW and function validateCheckinData.
(System Error: Could not find the parameter 'dDocType'.)
at oracle.webcenter.doclib.internal.view.CISRepositoryLogic.createDocument(CISRepositoryLogic.java:615)
.

.
.


Followed by some stack trace I'll won't bother you with.
In the browser I see the message:
Messages for this page are listed below.
Unable to upload the document.
The document no longer exists.
Click the Refresh icon to see the latest content.

The problem for this problem was (as always?!?!?) a small thing:
There was no default value defined for the document type.
With a fresh install, UCM gets shipped with a number of ACME Example document types.
WebCenter adds a document type named DOCUMENT
However, no document type is selected as default. Therefore, like the error states, there is no dDocType during the checkin.
The solution is simple:

  • Go to the UCM site
  • Open Administration
  • Open Folder Configuration
  • Click System Default Information Field Configuration
  • Set the Type to DOCUMENT - Document type
  • While you're there, set the Security Group to Personal Spaces


Second issue:
When I click on the discussion forums icon (in the left navigation) i get the message in the browser:
failure to authenticate the user weblogic, due to: Session is locked for user weblogic

which might be caused by the WARNING in the spaces diagnostics log:

[2010-09-30T11:56:36.348+02:00] [WLS_Spaces] [WARNING] [] [oracle.webcenter.collab.forum.internal.model.gateway.ForumGatewayManager] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [ecid: 0000IhY4KrZFg4WFLzRL8A1Cd5uA000000,0] [APP: webcenter] oracle.webcenter.collab.share.LoginFailedException: failure to authenticate the user weblogic, due to: service 'oracle.webcenter.collab.forum' disabled by 1 hung threads[[
service : oracle.webcenter.collab.forum
resource : null
source : oracle.webcenter.collab.share.Session$1@1b7e45 (oracle.webcenter.collab.share.Session$1)
submission : 3
]]

This issue was a bit more complex.
It had to do with the configuration of the Web Service Security between WebCenter and the Discussion application.
I can supply the solution in the post, but perhaps it's better to point you to the original blog post from Andrejus Baranovskis that I followed.
Beware for all the parameters you need in the different steps.
Easiest is to only change the passwords ;)

I'ld like to thank George Maggessy for thinking along with me.

Wednesday, September 1, 2010

Debugging across pojects

We're developing a large ADF / WebCenter application.
And since we're not surgeons, we make mistakes.
To investigate what goes wrong, you can use debugging.
But how can you debug source that is created not in the main project, but in another project, which deployment is included as a library?

1: Open the main project
2: Select Navigate | Go to Javatype (or press CTRL-Minus)
3: Enter the name of the class you want to debug and that is coded in an included project
4: Set the breakpoint
5: Debug the application

When the breakpoint is reached, your application will stop and control is handed to JDev for debugging.