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.

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 :(
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(


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] [] [] [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 '' disabled by 1 hung threads[[
service :
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.

Wednesday, June 16, 2010

External tools in JDeveloper

With External tools, you can easily perform tasks based on external programs.
One of the 'default' external tools is 'Explore Directory'

To enable the standard tools, simply click the Tools menu and select external tools.
JDev offers to search for popular tools. It'll offer tools like expore directory, notepad (yeah, right...) Word etc.

Specifically, the tool Explore Directory is interesting since the structure of the project in JDev is not always the structure on disk.

You can also define your own external tools, based on Apache Ant or an external program.
Simply specify the program to execute, the arguments how the tools should be integrated and when the tool must be available.

Calling custom Javascript.

Sometimes, you just NEED to call a custom Javascript function...
If so, you can do the following:

Of course you save the Javascript function in a seperate file.
Include that file using:
<trh:script source="../skins/script/accessibility.js">

For this, include the following namespace to your jsp:root tag:

Place a commandToolbarButton (or some other component) on the page:
<af:commandtoolbarbutton partialsubmit="true" text="A" id="pt_cl6">
<af:clientlistener method="changeFontSize" type="action">

Assuming there is a function called changeFontSize, this will be executed when you click the button.