Friday 30 August 2013

SQLDeveloper Nifty Tricks

A Nifty little Trick for SQLDeveloper


using SQLDeveloper -Version 4.0.0.12




















Using this, once you have connected, your worksheet will have a red border

Note:
The colors are Persistent to the connection
AND are not refreshed if connection is changed on worksheet

JDeveloper Basics - Extension Download

JDeveloper Basics - Extension Download from Oracle Website for Future use.

If you are like me, and like to have everything I download, or don't have a very fast internet connection, and your whole company needs a package, ie: SOA or Webcenter?

This is how to download the file from Oracle.
Go to About.
You can see how to do this here.
or {Help > About}

Once there click on the second tab,

Click on the row and copy it.

Oracle IDE
11.1.2.3.39.62.76.1
What you need is the 
11.1.2.3.39.62.76.1
Then google for
jdeveloper download extensions {IDE Version}
You should get a result from oracle pages
http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml
or something to that extent.
If you dont find anything, decrease the versions.
As oracle uses min max values for their downloads.

Once there, search on the page for extension you want. ie: Extension SDK.
Once you have found that
Look for your version

Note: You might have to look between
oracle.jdeveloper (min= xxx , max= yyy ) 
X and Y

#bearMan

JDeveloper Basics - Getting Version

JDeveloper Basics- Getting the exact Version of JDeveloper you are using.

Firstly Open JDeveloper:

Click on Help and then About.

You will then see your JDeveloper Generic Version (Studio Version)


and your JDeveloper Build Version (Build JDEVADF)

Wednesday 28 August 2013

JDeveloper + Weblogic Error PermGen space

When I was starting my Weblogic I got an Error:
The WebLogic Server encountered a critical failure
Reason: PermGen space
The solution can be found on the oracle Forums here:
https://forums.oracle.com/thread/881103

or you can Follow this guide:
You must install JRockit onto your computer.
Here is a guide for linux:
JRockit Installation on Linux

Once JRocket has been installed

You should change the "setDomainEnv" file. Which can be found in
Windows under"
<JDEV_HOME>/jdeveloper/system/system11.1.1.0.31.51.88/DefaultDomain/bin/setDomainEnv.cmd
in Linux:
 cd ~/.jdeveloper/system11.1.1.0.31.51.88/DefaultDomain/bin/setDomainEnv.sh

Note: the "system11.1.1.0.31.51.88" is variable and will change depending on what version of JDeveloper you are running.

Once inside there, you must find the lines where they are setting "JAVA_HOME"

There is a comment
"We need to reset the value of JAVA_HOME to get it shortened AND"
What you can do, is after that set JAVA_HOME to where you installed JRockit.
Mine was:
JAVA_HOME="/u01/app/oracle/middleware/jrockit-jdk1.6.0_45-R28.2.7-4.1.0"
# We need to reset the value of JAVA_HOME to get it shortened AND
# we can not shorten it above because immediate variable expansion will blank it
This will set your Weblogic to use JRockit.

#bearMan out

JDeveloper MEMORY

Today my JDeveloper gave me an error, and said it had Low Memory.
This happens when there are many objects in memory.

To fix this error you have to edit JDevelopers "ide.conf" file. This can be found in
{Middleware Path}\jdeveloper\ide\bin
  Once in there you can find the command that says:
AddVMOption  -Xmx
and then change from the default value to
AddVMOption  -Xmx1024M
or Any value, the comments in the file says
something greater, like 1024M or 1250M
This should sort your problem out and if not, you can add more.

In Linux you can find the file by running
find ./ -iname ide.conf
 or

sudo find ./ -iname ide.conf

#bearMan.

Monday 26 August 2013

Uninstalling JDeveloper 12c from my OpenSUSE.

Uninstalling JDeveloper 12c from my OpenSUSE.

What you can do to find the uninstall file is type this

cd /{path to Middleware}
find -iname deinstall
When I ran that command I found 3 results:
./Oracle_Home/oui/bin/deinstall.sh
./Oracle_Home/inventory/deinstall
./Oracle_Home/inventory/deinstall/deinstall-info.xml

you want to run the"deinstall.sh"

This can be done using these commands

cd /
./u01/Oracle/Middleware12c/Oracle_Home/oui/bin/deinstall.sh

or you can cd to
cd /{path to Middleware}/Oracle_Home/oui/bin/
and then run
./deinstall.sh


#bearMan out.

Saturday 24 August 2013

Please install the GNU compiler.

I installed OpenSuse 12.3

When I wanted to install Oracle VBox I got the error
 Please install the GNU compiler
I used the command
zypper install make gcc  gcc-c++ kernel-source kernel-syms
It looks to be working 100%

bearMan out.

Thursday 22 August 2013

ADF - JDeveloper Tuning - View Objects

In this post I will be Discussing the how to optimize your ADF View Objects,  using JDeveloper before project start. (I will only be discussing View Objects fetching rows in Batches of)
This is a general Tuning guide, specifically used for when creating a new Project.

The discussion will help you Tune your ADF application from the word go.

Firstly we need to go to JDevelopers preferences. This can be done by going to tools -> Preferences


The defaults for a view object are:
The Rows are fetched in batches of one, and only when needed.
Thus if there are many Rows that need to be collected, this will be heavy on both the network and the Framework. This is due to ADF fetching each new ROW, rather than fetching 5 or 10 at any time. Although, when setting 5 or 10 at a time, this could use to much, depending on the use case.
In my case I like to set 10 at a time as in most cases, this is the most appropriate, although I have had cases of needing more, and less. SO before just jumping to decisions, thing about what your client wants.

Below is a screen shot of my Default Settings.

When Tuning View Objects before you start your application, I would recommend understanding what your business needs are before setting the Values.


A use case of needing to fetch more than 10 in a batch:
I have a client that needs a user to view every row in the DB on load and I know there will always be more than 50 Rows to display, thus for that View Object I set 50 Rows.


Note: At a later stage I will be displaying the results on server side.
 

Monday 19 August 2013

ADF - JDeveloper Tuning - Application Module

In this post I will be Discussing the difference between Application Modules Lazy Loading and Non-Lazy Loading,  using JDeveloper before project start. 
This is a general Tuning guide, specifically used for when creating a new Project.

The discussion will help you Tune your ADF application from the word go.

Firstly we need to go to JDevelopers preferences. This can be done by going to tools -> Preferences

Once that is completed you can choose two ADF Tuning tips.
Firstly Application Modules Tuning:
The default for Application Modules is Non-Lazy Loading. This means that when a Business Component is loaded, all child components are filtered as well, thus extra page load time.
This load time might only be a few milliseconds per Entity, but when you have a few more than one Entity, they add up, and users can quickly get despondent and or feel the page has broken and close the page. This is ultimately not what we want.

Thus in order to fix this we use the Lazy Loading which takes this initial Page load away.

ADF - Programmatically Show Popup

Just a quick bit of code:

Note there are 4 Message Types namely

  1. Error
  2. Fatal
  3. Info
  4. Warning

Friday 16 August 2013

Unable to load descriptor

My Stacktrace
Warning: <May 26, 2013 7:47:48 AM CAT> <Error> <J2EE> <BEA-160197> <Unable to load descriptor {path}\ViewController\public_html/WEB-INF/weblogic.xml of module public_html. The error is weblogic.descriptor.DescriptorException: Unmarshaller failed at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:161) at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323) at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788) at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409) at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759) at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768) at weblogic.servlet.internal.WebAppDescriptor.getWeblogicWebAppBean(WebAppDescriptor.java:170) at weblogic.servlet.utils.WarUtils.getWlWebAppBean(WarUtils.java:110) at weblogic.application.compiler.WARModule.processLibraries(WARModule.java:385) at weblogic.application.compiler.WARModule.compile(WARModule.java:237) at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.java:18) at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36) at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36) at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26) at weblogic.application.compiler.WARCompiler.compile(WARCompiler.java:29) at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:112) at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:37) at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52) at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36) at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26) at weblogic.application.compiler.Appc.runBody(Appc.java:203) at weblogic.utils.compiler.Tool.run(Tool.java:158) at weblogic.utils.compiler.Tool.run(Tool.java:115) at weblogic.application.compiler.Appc.main(Appc.java:262) at weblogic.appc.main(appc.java:14)Caused by: com.bea.xml.XmlException: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists: "weblogic.j2ee.descriptor.wl.SecurityRoleAssignmentBeanImpl@563d3221(/SecurityRoleAssignments[valid-users])" at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:54) at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty.setValue(RuntimeBindingType.java:539) at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType$QNameRuntimeProperty.fillCollection(AttributeRuntimeBindingType.java:381) at com.bea.staxb.runtime.internal.MultiIntermediary.getFinalValue(MultiIntermediary.java:52) at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType.getFinalObjectFromIntermediary(AttributeRuntimeBindingType.java:140) at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:200) at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:169) at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65) at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:150) ... 27 moreCaused by: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists: "weblogic.j2ee.descriptor.wl.SecurityRoleAssignmentBeanImpl@563d3221(/SecurityRoleAssignments[valid-users])" at weblogic.descriptor.internal.ReferenceManager.registerBean(ReferenceManager.java:231) at weblogic.j2ee.descriptor.wl.WeblogicWebAppBeanImpl.setSecurityRoleAssignments(WeblogicWebAppBeanImpl.java:317) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:48) ... 35 more.>


In essence, the error was that I had two of the same library references in my weblogic-application.xml 


you can get there by going to your Application Resources in your resource pallet

Thursday 15 August 2013

ADF - Train: Custom Train Button

ADF: Custom Train Button

OK so recently I have been working with trains and playing around with some of the basic functionality around them.

Long story short, I needed to invoke train button actions, next/previous using custom buttons.
In order for me to do this I used this code within my page:

<af:commandButton text="Train Next" id="cbN"
                          action="controllerContext.currentViewPort.taskFlowContext.trainModel.next"/>

<af:commandButton text="Train Previous" id="cbP"
                          action="controllerContext.currentViewPort.taskFlowContext.trainModel.previous"/>

A college of mine helped me solve this namely, Stafford Wright