cactus usage note

By W.ZH July 2010

Note: This in fact partly learn from my colleague usage.

0. Of coz, you need know how to write test for Junit, coz this one based on that.

1. you put your code in two commenting sentences, then when u try to create test case again, your code will not be overwritten.

 // JUnitDoclet begin method **************

your code here

// JUnitDoclet end method  ****************

 

2. if u have too many test cases to write, you can create one by one, they are not depends on each other. Because you will face compile error for test method’s return if you first create a lot test cases.

3. Some times it will create some duplicate methods for you, you just need to remove that to compile.

4. cactus has Junit 3 and 4 difference for created test case, you need to notice that.

.

Advertisements

foreach in table

By W.ZH

In the table of ADF,  sometime you want to have a smal list a each of a table’s row data, when you try to use foreach, you will get error, coz ti can not link to row data.

so what tag can help on this request?

<af:iterator

JAVA FX 1.3 Usage Notes – By W.ZH

By W.ZH — From July 2010 to ….0. Although I can start use FX from June 2010, and Oracle has done the merge with Sun, but jdeveloper still can not used to develop the FX, Not sure are they going to support this or not. So current we can only use eclipse or netbean to develop the FX UI latest is 1.3.1.

1. How to deploy the FX into a jsp page?

You can deploy that as an applet and insert applet into the jspx. You need insert the js(fx’s js ) in jspx page to start the main call in your applet. And netbean can create js and alos the jnlp( you know, java web start tech) file for you , Inside the jnlp, you can see how the applet is config and set.

Link to here to see how a jnlp is composed:

http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/javaws/developersguide/syntax.html

http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/guide/jws/developersguide/syntax.html

http://lopica.sourceforge.net/ref.html

2. Can I run a jnlp directly from URL?

Sometimes you can, it will trigger the IE/FF to start the web start and show your app. But sometimes can not…

Such as for jx applet, seems need to trigger from a html/jsp page with js of fx to start it. If I try from jnlp directly it will give you many exceptions that not meet in the un-straight way.

3.
MissingFieldException [ The following required field is missing from the launch file: <jnlp>] ???

This a very common error for jnlp, refer the 2 for the solve,   if you really have this error, even after try the point 2, ti might be your jnlp utf-8 issue.  http://www.coderanch.com/t/200623/JNLP-Web-Start/java/missing-launch-file-jnlp

Normally other exception will clearly say what problem is, will be easier to solve, only this exception is hard to deal with. This in fact used to be a jnlp bug , might still be.

4. ADF and jspx fx page.

Such as for my experience, if my jspx is a html format, not a ADF format,,, this means that my jspx not use any ADF.. the i can access my page use the

http://myhost:myport/root/faces/page.jspx

or

http://myhost:myport/root/page.jspx

but in link of
http://myhost:myport/root/faces/page.jspx, applet for fx will failed with that
issingFieldException exception, link 2 works in fact. I think adf faces filter has some impact to the FX applet. This part should be solved in future in ADF. Or i need to check my web app config or sec config, there might a way to solve this.

5. 2.0 road map impact Sept 2010-

After I haved developed a small prject with javaFX , Oracle in the OW announced that 2.0 version javaFX will be ready in 2011 H2. But 2.0 will not use any javaFX script, They will supply java API for FX. This in fact is very big change in the JavaFX world. It means all the existing code in javaFX need rewrite !

JSP scriptlet error for OJSP in ADF project

By W.ZH July 2010Issue:   When u do some sciptlet in your jsp (not jspx fo ADF), you will get such error:

OracleJSP error: oracle.jsp.parse.JavaCodeException: Line # XXXXX, oracle.jsp.parse.JspParseTagExpression@9debe6

Error: Java code in jsp source files is not allowed in ojsp.next mode.

Note: you need to know that sciptlet  in standard jsp means sth like this: <%=request.getRemoteUser()  %>

Reason:  For this error, I found it is very hard to find the real solution in the oracle forum, some suspect is because you enable your user customization(MDS) function in your system. Yes, it might has relation with that, but real reason is not.

My finding is that ADF has a set of config for jsp and jspx pages in the system, which will use the oracleJSP engine to explain the jsp/jspx, the will throuhg this error. If you use ADF system, will force to config to run in ADF model for jsp and jspx page.

But for my page. I have javaFX applet which can not run in the ADF context. So I have to user the jsp to load this applet otu of the ADF context , but still run in same web aplication.

 

Solution: In your web.xml file, you will find

<servlet-mapping>

<servlet-name>jsp</servlet-name>

<url-pattern>*.jsp</url-pattern>

</servlet-mapping>

this will make the *.jsp page to hit the jsp servlet to run it, (same with the jspx and jsff), But oracle define the jsp servlet point to:

<servlet-name>jsp</servlet-name>

<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>

this in fact use OJSP to do it.  So let us comment out the

<servlet-mapping>

<servlet-name>jsp</servlet-name>

<url-pattern>*.jsp</url-pattern>

</servlet-mapping>

in the web.xml and let default java servlet to do it.

Then your will find that, your jsp run by java servlet and jspx/jsff run by the oracle servlet. They can work together in Weblogic server. And in fact they also can in same http session, which can let you exchange data in two pages.

refer to :
http://forums.oracle.com/forums/thread.jspa?threadID=977348&tstart=5

 

 

Oracle DB basic – Listener

listener

A process that resides on the server whose responsibility is to listen for incoming client connection requests and manage the traffic to the server.

When a client requests a network session with a database server, a listener receives the actual request. If the client information matches the listener information, then the listener grants a connection to the database server.

listener.ora file

A configuration file for the listener that identifies the following for a listener:

  • Unique name
  • Protocol addresses that it is accepting connection requests on
  • Services it is listening for

The listener.ora file typically resides in $ORACLE_HOME/network/admin on UNIX platforms and ORACLE_HOME\network\admin on Windows NT.

Listener Control utility

A utility included with Oracle Network Services to control various listener functions, such as to starting, stopping, and getting the status of the listener.

http://download.oracle.com/docs/cd/B10500_01/network.920/a96581/lsnrctl.htm

lsnrctl command [listener_name]
where listener_name is the name of the listener to be administered. If no name is specified, then the default name, LISTENER, is assumed.

 

 

 

 

 

 

 

 

 

 

 

MDS personalize for Web application and Portlet

July 2010, By W.ZHRequest:

Oralce weblogic and ADF frame work has a technology called Metadata Service (MDS), about the details you can refer to the white paper.

http://www.oracle.com/technetwork/developer-tools/jdev/adfmds-128339.pdf


At here i want to share some tips that how the implement this MDS into your system.


How to do:

1. In the following links by Edwin Biemond, you can see how to make the MDS works in your web application and basic steps to do it.

http://biemond.blogspot.com/2009/07/customize-and-personalize-your-jsf.html

http://biemond.blogspot.com/2009/07/mds-repository-for-adf-11g.html

Before next step, play and understand this two articles.

2. But Edwin  does not mention how to do the deployment for your system if you are not use the jdeveloper, or if you want to pack your project to war/ear file to deploy to a weblogic server, Such as you have to use ANT build your project, in that case you can not do it.

If we have an ADF
application with customizations and we deploy this to the Weblogic Server then JDeveloper detects the MDS repository. JDeveloper automatically creates a new MDS partition and uses your ear deployment name as partition name. It also uses the just created datasource to fill the MDS database.

If we can not rely on Jdev to make the deploy, how we can do? Let me explain the trick for you here:

When u config your jdev to enable the MDS , such as use oracle.adf.share.config.UserCC, in the article
http://biemond.blogspot.com/2009/07/customize-and-personalize-your-jsf.html  .  then you will find that adf-config.xml of your application add some config for this. remember to make a copy of this xml file.

then you start to deploy your application by jdev, it will link to the WLS and find that your need to link with a Datasource for the MDS in WLS(suppose you have create the MDS in the WLS server.) By this article.

http://biemond.blogspot.com/2009/07/mds-repository-for-adf-11g.html

Ok after you deploy it., go to jdev’s deployment folder get your ear file, and unzip it. The dig into the adf-config.xml you will find that MDS related config change to sth like this :

<mdsC:adf-mds-config version=”11.1.1.000″>

<mds-config xmlns=”http://xmlns.oracle.com/mds/config”&gt;

<persistence-config>

<metadata-namespaces>

<namespace path=”/oracle/adf/rc/metadata”

metadata-store-usage=”WebCenterFileMetadataStore”/>

<namespace path=”/persdef/”

metadata-store-usage=”WebCenterFileMetadataStore”/>

<namespace path=”/xliffBundles/”

metadata-store-usage=”WebCenterFileMetadataStore”/>

</metadata-namespaces>

<metadata-store-usages>

<metadata-store-usage id=”WebCenterFileMetadataStore”

default-cust-store=”true” deploy-target=”true”>

<metadata-store class-name=”oracle.mds.persistence.stores.db.DBMetadataStore”>

<property value=”mds-SpacesDS” name=”repository-name”/>

<property value=”YOURAPP_NAME” name=”partition-name”/>

<property value=”jdbc/mds/SpacesDS” name=”jndi-datasource”/>

</metadata-store>

</metadata-store-usage>

</metadata-store-usages>

</persistence-config>

<cust-config>

<match>

<customization-class name=”oracle.adf.share.config.UserCC”/>

</match>

</cust-config>

<cache-config>

<max-size-kb>100000</max-size-kb>

</cache-config>

</mds-config>

</mdsC:adf-mds-config>

As my example use the webcenter spaces MDS as my MDS, then you see it like this.. but you need to notice that

<property value=”jdbc/mds/SpacesDS” name=”jndi-datasource”/>

can be any MDS that you have created and registered in the WLS. you just need to copy the related config info to your offline web applicaiton’s xml and then change the MDS to your MDS name.

Then after that, you have ability that can deploy your project by ANT or not rely on the jdeveloper.

Note:

If your WLS’s registered MDS datasource does not have your application’s partition, WLS will auto create the patition in MDS for you after start run your web application.  Thepartition-name will be

<property value=”YOURAPP_NAME” name=”partition-name”/>

Note:

For Portlet, when first time you create the web application, you need to create your jdev applicaiton as a web applocation, then you can enable MDS and create portlet inside, and deploy it..  In this case, MDS will work inside a portlet(not be tested, but said by webcenter staff of oracle).

But if you create your application in jdev as a portlet application and enable the MDS, then MDS will not work inside portlet after you deploy to the webcenter. (test and prove by my self.).