Thursday, February 20, 2014

Webcenter Update - Plug in Installed. JDeveloper won't work

Hello All,

Sometimes, when you install Webcenter plug-ins through JDeveloper updates from Help menu, you won't be able to start the integrated server after JDeveloper restarts. You may get any of the following error.

java.lang.NoClassDefFoundError: v11/1/1/6\jdeveloper
Caused by: java.lang.ClassNotFoundException: v11.1.1.6\jdeveloper
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
Could not find the main class: v11.1.1.6\jdeveloper.  Program will exit.
Exception in thread "main" Process exited.


The complete log is as follows : 

[Waiting for the domain to finish building...]
[10:26:44 AM] Extending Integrated Weblogic domain...
[10:27:26 AM] Integrated Weblogic domain processing completed successfully.
*** Using port 7101 ***
C:\Users\Mahesh\AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\DefaultDomain\bin\startWebLogic.cmd
[waiting for the server to complete its initialization...]
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=512m
.
WLS Start Mode=Development
.
CLASSPATH=C:\Oracle\MIDDLE~1.6\ORACLE~1\modules\oracle.jdbc_11.1.1\ojdbc6dms.jar;C:\Oracle\MIDDLE~1.6\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1.6\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1.6\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1.6\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1.6\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1.6\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\wcps-lib\derby-10.6.1.0.jar;C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\wcps-lib\derbytools-10.6.1.0.jar;C:\Oracle\Middleware v11.1.1.6\jdeveloper\webcenter\modules\oracle.portlet.server_11.1.1\oracle-portlet-api.jar;C:\Oracle\Middleware v11.1.1.6\jdeveloper\webcenter\modules\wcps_11.1.1.4.0\wcps-connection-mbeans.jar;C:\Oracle\MIDDLE~1.6\ORACLE~1\modules\oracle.jrf_11.1.1\jrf.jar;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\lib\xqrl.jar
.
PATH=C:\Oracle\MIDDLE~1.6\patch_wls1035\profiles\default\native;C:\Oracle\MIDDLE~1.6\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1.6\modules\ORGAPA~1.1\bin;C:\Oracle\MIDDLE~1.6\JDK160~1\jre\bin;C:\Oracle\MIDDLE~1.6\JDK160~1\bin;C:\app\Mahesh\product\11.2.0\dbhome_1\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;;C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\native\win\32\oci920_8
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http:\\hostname:port\console        *
***************************************************
starting weblogic with Java version:
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b50)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode)
Starting WLS with line:
C:\Oracle\MIDDLE~1.6\JDK160~1\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=512m -Dweblogic.Name=DefaultServer -Djava.security.policy=C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server\lib\weblogic.policy "-Djavax.net.ssl.trustStore=C:\Oracle\Middleware v11.1.1.6\wlserver_10.3\server\lib\DemoTrust.jks" -Dweblogic.nodemanager.ServiceEnabled=true  -Xverify:none  -da -Dplatform.home=C:\Oracle\MIDDLE~1.6\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1.6\WLSERV~1.3\server  -Djps.app.credential.overwrite.allowed=true -Dcommon.components.home=C:\Oracle\MIDDLE~1.6\ORACLE~1 -Djrf.version=11.1.1 -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger -Ddomain.home=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1 -Djrockit.optfile=C:\Oracle\MIDDLE~1.6\ORACLE~1\modules\oracle.jrf_11.1.1\jrocket_optfile.txt -Doracle.server.config.dir=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\config\FMWCON~1\servers\DefaultServer -Doracle.domain.config.dir=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\config\FMWCON~1  -Digf.arisidbeans.carmlloc=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\config\FMWCON~1\carml  -Digf.arisidstack.home=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\config\FMWCON~1\arisidprovider -Doracle.security.jps.config=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\config\fmwconfig\jps-config.xml -Doracle.deployed.app.dir=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\servers\DefaultServer\tmp\_WL_user -Doracle.deployed.app.ext=\- -Dweblogic.alternateTypesDirectory=C:\Oracle\MIDDLE~1.6\ORACLE~1\modules\oracle.ossoiap_11.1.1,C:\Oracle\MIDDLE~1.6\ORACLE~1\modules\oracle.oamprovider_11.1.1 -Djava.protocol.handler.pkgs=oracle.mds.net.protocol  -Dweblogic.jdbc.remoteEnabled=false -Dwsm.repository.path=C:\Users\Mahesh\AppData\Roaming\JDEVEL~1\SYSTEM~1.29\DEFAUL~1\oracle\store\gmds  -DUSE_JAAS=false -Djps.policystore.hybrid.mode=false -Djps.combiner.optimize.lazyeval=true -Djps.combiner.optimize=true -Djps.auth=ACC -Doracle.core.ojdl.logging.usercontextprovider=oracle.core.ojdl.logging.impl.UserContextImpl -noverify -Doracle.webcenter.analytics.disable-native-partitioning=false -Doracle.webcenter.tagging.scopeTags=false -XX:+UseParallelGC -XX:+DisableExplicitGC -Dportlet.oracle.home=C:\Oracle\Middleware v11.1.1.6\jdeveloper -Dwc.oracle.home=C:\Oracle\Middleware v11.1.1.6\jdeveloper  -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1.6\patch_wls1035\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1.6\patch_jdev1111\profiles\default\sysext_manifest_classpath  weblogic.Server
java.lang.NoClassDefFoundError: v11/1/1/6\jdeveloper
Caused by: java.lang.ClassNotFoundException: v11.1.1.6\jdeveloper
  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
Could not find the main class: v11.1.1.6\jdeveloper.  Program will exit.
Exception in thread "main" Process exited.



This is mainly because of the spaces in the installation folder name while installing JDeveloper. For example, in this log, my installation path is as follows : "C:\Oracle\Middleware v11.1.1.6". 

Oracle recommends you should never have spaces in the installation folder name. You can either rename the folder name not to contain spaces or re-install JDeveloper without spaces like "C:\Oracle\Middleware_v11.1.1.6" or "C:\Oracle\Middleware6", you won't get any issues even after installing webcenter plug-ins in your JDeveloper. 

Multiple ways for populating DB Sequence to an attribute in an Entity Object

Hello All,

Here in this post, I will show multiple ways to populate DB Sequence to an attribute in an Entity Object.

Technique 1 : Setting Groovy in the default value of the attribute

Set the default value for the attribute as an expression value set as follows : 

(new oracle.jbo.server.SequenceImpl("SEQ_NAME", adf.object.getDBTransaction())).getSequenceNumber()

Note : Make sure you select expression in the "Value Type" property for the attribute.

Technique 2 : Use create() method of the [Entity]Impl class



Then in the corresponding [Entity]Impl class, you need to write these java statements and pass your sequence name. 

protected void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl seq = new SequenceImpl("SEQ_NAME", getDBTransaction());
    setDepartmentId(seq.getSequenceNumber());
}

Technique 3 : Use groovy expression to call customMethod created in [Entity]Impl class

Create a custom Method which again has the same implementation as used in create() method in Technique 2

    public Number createSeq(String seq_name) {
        Number seq_no = new Number(0);
        SequenceImpl seq = new SequenceImpl(seq_name, getDBTransaction());
        seq_no = seq.getSequenceNumber();
        return seq_no;

    }

Then we need to call this method from the value property in the attribute by passing the sequence name and make sure you selected "Expression" in "Value Type" of the attribute.



Technique 4 : Using DBTrigger to populate the Sequence on Commit

First create a trigger on the table. The below screenshot depicts how we create a trigger from SQL Developer declaratively. 


You can also see the script the IDE generates automatically. 


Once you create the trigger, you follow the below steps.
a. First change the attribute type to DBSequence and Refresh after Update for the attribute as shown below.

Now you can run your application and test. 

The advantages of the last technique is that even if the user don't want to continue and if the transaction is rolled back, the sequence number is not wasted unlike the other three techniques. 

Please let me know if you have any questions on this post.