Friday, November 11, 2011

Java code in jsp source files is not allowed in ojsp

Applies to:

Oracle JDeveloper - Version:


Your application includes a JSP page with scriptlets like the following:

This page runs correctly in JDeveloper

After having migrated to JDeveloper, running the page fails with the following error:

Java code in jsp source files is not allowed in mode.

You see the following error displayed in the page:

"JSP scriptlets will not work properly if using OJSP".


You upgraded from JDeveloper to

It was working correctly in JDev


The deployment descriptor file weblogic-application.xml is automatically updated '(for performance reasons) with the following lines:

under one of these conditions:

•you use MDS (Metadata Services), that you set up with the option

"Enable user customizations" in "ADF View" in the "Project Properties"

•or you use WebCenter (that automatically turns on the aforementioned option)

•or you use the ADF Library Filter ("ADFLibraryFilter") for your JSP page.

OJSP does not support scriptlets in its 'next' mode,


You need to either adapt your code to remove the scriptlets in your JSP page (that's the only option

if you use WebCenter that forcibly sets that option),

or you can use the following Java option to disable OJSP:


You can add this option -Dadfvdt.disableOjspDeployment=true in your file "ide.conf" in the directory "\jdeveloper\ide\bin".

Alternatively, you can start up JDeveloper with that parameter:

\jdeveloper\jdev\bin\jdev.exe -J-Dadfvdt.disableOjspDeployment=true

For your Production environment, you can have your Managed WLS ignoring the OJSP mode by adding the Java Option -Dadfvdt.disableOjspDeployment=true

•in the "startManagedWebLogic" (if you want to limit it to a specific Managed Server)

•or "setDomainEnv" (for all managed servers in a domain).

1 comment:

Blogger said...

Bluehost is ultimately one of the best web-hosting provider with plans for any hosting requirments.