Andrej Koelewijn

7/9/2005

More posts on the IT-eye weblog

Filed under: — andrejk @ 12:48 pm

Some of the posts i’ve written on the IT-eye weblog this last week: Finding jar library dependencies using JarJar, Productivity, choice and ADF metadata and Jwebunit, untrusted certificates, https and proxies.

6/24/2005

JDeveloper free as in beer

Filed under: — andrejk @ 7:23 am

Infoworld is reporting that JDeveloper will be gratis: Oracle to offer JDeveloper tool for free.

Out of the box, JDeveloper has a lot more functionality than Eclipse in many areas. Visual JSP editing, visual support for JSF, support for some of the UML diagrams, wizard support for it’s ORM frameworks ADF Business components and Toplink. It’s a good IDE, so if you haven’t tried it yet, you should.

It’s good to see all the effort Oracle is putting into Java these days: EJB 3.0 support in OC4j since last year, BPEL plugin for JDeveloper, BPEL engine, a really good set of JSF components, a Toplink plugin for Spring, support for xdoclet in JDeveloper.

6/20/2005

Wilfred’s summary of CB’s migration from Designer to JDeveloper on OTN!

Filed under: — site admin @ 9:38 pm

Wilfred’s story about Jules de Ruijter’s presentation on their migration from Designer to Developer made it to OTN’s frontpage! I have to agree with Wilfred, the presenation, Oracle Designer versus Oracle JDeveloper, was really interesting, Jules is a good speaker who likes to provoke his audience.

6/15/2005

Executing PL/SQL from ANT - how to get the output

Filed under: — andrejk @ 9:50 am

Javaddicts and the Amis blog are reporting about executing pl/sql statements from Ant: Executing Oracle PL/SQL from Ant, Executing PL/SQL from ANT – how to keep the format straight.

I’ve also written an Ant target for my current project where we execute pl/sql. The pl/sql queries domain values from some tables and outputs an xml document containing these domains. The problem with Ant’s sql task is that it doesn’t display the output created using dbms_output. So i’ve extended the SQLExec class, to copy all the output created using dbms_output to standard out. This is done in the printDbmsOutputResults method:

protected void printDbmsOutputResults(Connection conn, PrintStream out) throws java.sql.SQLException {
/**

  • Print dbms_output results

    */
    String getLineSql = “begin dbms_output.get_line(?,?); end;”;
    CallableStatement stmt = conn.prepareCall(getLineSql);
    boolean hasMore = true;
    stmt.registerOutParameter(1, Types.VARCHAR);
    stmt.registerOutParameter(2, Types.INTEGER); while (hasMore) {
    boolean status = stmt.execute();
    hasMore = (stmt.getInt(2) == 0); if (hasMore) {
    out.println(stmt.getString(1));
    }
    }
    stmt.close();
    }

4/15/2005

Oracle and MS lead appserver platforms

Filed under: — site admin @ 12:10 pm

The serverside is reporting on a Forrester report: The Forrester Wave: Application Server Platforms Q1 2005. Basically Forrester is saying that both MS and Oracle offer the most complete solution with their application servers. Not many people seems to agree with this on the Serverside, most people think either Oracle or Microsoft payed for this report.

That may or may not be true, but fact is that Oracle is working hard on offering a good and complete application server. Some examples: BPEL support in the application server, and Oracle is already offering a developer preview of EJB 3.0. They’re also working pretty hard on their IDE: see for example the JSF support in JDeveloper.

4/13/2005

Oracle to provide plugins for Eclipse

Filed under: — site admin @ 10:22 pm

Read the CNET article: Oracle warms to Eclipse with open-source project.

3/30/2005

Jdeveloper code folding

Filed under: — site admin @ 9:48 pm

Brian Duff posts about code folding in Jdeveloper. I think i’m in same camp as Brian on code folding: nice, but probably not for me.

Some weeks ago a colleague mentioned that he liked the code folding in visual studio very much, and that he would like to see the same thing in Jdeveloper. My reaction then was: why? What use is code folding. To see the contents of a class without all the coding details? I use the structure view for that. Want to edit a specific method? Just select it in the structure view. My feeling is that once you start using code folding, you needlessly spend a lot of time opening and closing code blocks.

3/14/2005

Testing swing/jclient applications with Marathon

Filed under: — site admin @ 10:03 am

Marathon is a very nice tool to test swing applications. You can write test scripts using python, or you can have Marathon record your actions. The result of this is a python script which looks like this:

useFixture(default)
def test():

window('My Application') click('JTree', '/Someone/Contact Data') select('sexComboBox', 'F') select('weightFormattedTextField', '90') assertText('statusLabel','') select('dateOfBirthFormattedTextField', '01.01.1900') close()

You specify which components you’re using by refering to the component name, which you can set using setName() on every component. In jdeveloper you’d expect that if you specify name in the property sheet of a component that jdeveloper would generate a setName call in your code. This is not the case however. Instead it changes the instance name of the component, which isn’t bad either, but not very helpfull if you’re creating marathon scripts. You’re test scripts will be a lot less readable. In the example above, i didn’t manually call setName for the JTree component. If i’d had 3 JTree components they would have referred to as JTree, JTree1, JTree2.

I’ve created a small utility which will set the name of a component and it’s child components by taking the instance name and calling setName on the component. Might be usefull if you’re using Marathon.

package nl.iteye.swingtest;

	

import java.awt.Component;
import java.awt.Container;
import java.lang.reflect.Field;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**

* @author Andrej Koelewijn */
public class TestHelper { public TestHelper() { } public static void setComponentNames(Component parent) { if (parent instanceof Container) { Component[] childs = ((Container) parent).getComponents(); Field[] fields = parent.getClass().getDeclaredFields(); for (int i = 0, n = fields.length; i < n; i++) { if (Component.class.isAssignableFrom(fields[i].getType())) { try { fields[i].setAccessible(true); Object o = fields[i].get(parent); if (o != null) { ((Component) o).setName(fields[i].getName()); } } catch (IllegalAccessException e) { } } } for (int i = 0, n = childs.length; i < n; i++) { if (childs[i] instanceof Container) { TestHelper.setComponentNames(childs[i]); } } } }
}

3/3/2005

Swing embedded browser

Filed under: — andrejk @ 11:34 pm

Over on javalobby Sebastian Ferreyra is wondering why the embedded browser hasn’t caught on. He thinks embedding a webbrowser in java Swing applications could be really usefull.

I Agree. On my current project we’ve implemented the reporting part of a swing application using an embedded browser.

My first thought for reporting was to use one of the existing reporting components, e.g., jasperreports. So i downloaded jasperreports and a visual report builder, ireport, to see how it worked. I didn’t like it: another xml language to learn, no separation of content and layout, and a visual designer which was a pain to work with. All in all, not a very productive way to create reports.

Actually, i’ve never liked visual reporting tools. I’ve used Oracle Reports in the past, and i found it rather frustrating: it feels like you’re forever moving your elements to get the layout just right.

Html is so much easier, nice separation of content and layout, with easy to use css style. I thought we’d be much more productive by just creating html reports and showing these using an embedded browser.

So first question is, which browser component? I tried the jdic browser component. It works, next question. How do we print? Jdic allows you to print documents by asking your desktop to print the document. Again, this works sufficiently, on windows that is. Your mileage may vary on other platforms, but this is not an issues for us.

How to generate the Html documents? Our solution is to use velocity. Embedding the velocity templating engine in your swing application is pretty easy. We simply put our javabeans based domain model in the velocity context, and can access all our data in our templates. Designing the html pages is pretty productive using the visual html editor in jdeveloper.

So what are the problems? Css support for printing. Well not really the css support, it’s more that the browser support for css for printing is lacking.

Our biggest problem is controlling the page margins and the page header and footer. Your browser controls the page margins and headers and footers. If you want to change this you have to change the page setup using the browsers options, you cannot do this in your css stylesheet.

Another problem is that current browsers do not support specifying page orientation through css. So if you want some reports printed in landscape and some reports using portrait, you have a problem.

Anyway, we can live with these problems and find that using html to create reports is a lot more productive than using an existing reporting component. And the situation will only improve when browsers will finally start supporting the newer css standards.

2/7/2005

Oracle on CentOS

Filed under: — andrejk @ 8:19 am

I just heard from a co-worker that he installed Oracle 10g on Centos 3.4 without any problems. The installation script checks the linux version you’re installing on, so you’ll have to change this. The easiest way to do this is to copy the oracle cdrom to disk. Then open the file oraparam.ini (in disk1/install), and search for the line which says “Linux=...”. Remove everything after the equals sign. That should do it.

1/29/2005

CentOS: a free Red Hat Enterprise Linux

Filed under: — andrejk @ 7:07 pm

Just found out about Centos. Centos is a new Linux distribution which aims to be a 100% binary compatible with Red Hat Enterprise Linux. This is very good news as Oracle only tests it’s products on Red Hat Enterprise Linux and SuSE Linux Enterprise Server. Theoritically you should be able to use another distribution, but i’ve found out that this is not the easiest way. I’ve experienced stability problems on Fedora, and installation problems on another distribution.

1/28/2005

Oracle BPEL jDeveloper plugin

Filed under: — andrejk @ 8:02 am

Yesterday i attended the Amis query on Oracle BPEL, to see how Oracle’s BPEL plugin for JDeveloper is progressing. Both the Eclipse version and the new JDeveloper version were demoed, and we had a chance to try them. I must say Oracle’s making good progress on the plugin and according to Oracle’s Sandor Nieuwenhuijs a production release should be available in a couple of months. A beta release will be available soon.

Some points discussed yesterday:

  • Oracle is going to include a Web services gateway in Oracle Application server 10.1.3. The gateway will allow you to add security in the application server to already existing services, so you won’t need to modify all the existing services.
  • Oracle is is not yet going to provide a tool to convert high level business process diagrams to BPEL. The question is what should such a tool do and do you really want it: do you really want to automatically translate process diagrams generated by non technical people into an executable process? My opinion is that it’s not very important. I think it would be more usefull if there was a tool to convert complex BPEL diagrams into easy to read high level process diagrams (e.g., UML activity diagrams) so that you have a tool for explaining to business what your BPEL processes are doing.
  • Sandor discussed the various Oracle process management/workflow/integration tools and their future. Oracle Workflow is here to stay as it’s heavily used in Oracle Applications, but if you don’t use Oracle Applications then you’re probably better of using a standards compliant tool, ie., Oracle BPEL.
  • The BPEL plugin now has a service adapters plugin wizard. This wizard will create all the configuration files you need to use existing services through WSIF. Using this wizard you can using Oracle AQ (advanced queueing), ftp services, and detect and read files. This last option was pretty nice: it allows you to specify the structure of text files (fixed column, comma separated, etc), and the text files will be converted to Xml by the BPEL process manager. One important option missing in this wizard was the option to generated configuration files for EJB services. But this option is comming according to Sandor.
  • The BPEL plugin now also contains a xml transformations tool, which enables you to graphically specify how xml files should be transformed to other xml formats. In other words, it’s a visual xslt editor.

1/19/2005

PostgreSQL version 8. has been released

Filed under: — site admin @ 9:26 pm

PostgreSQL version 8 has been released. The biggest change is that Windows is now a supported platform.

For someone like me who mainly works with Oracle databases, PostgreSQL is a much better fit than MySQL. PostgreSQL supports many features which i use daily on Oracle databases: stored procedures, schema’s, views, sequences, etc.

I’m currently using MySQL 4.0 for the Jumpteam website, but i’d rather use PostgreSQL. One reason: Unions. The site started on MySQL 3. No support for unions. Now we’re using MySQL 4.0.18. MySQL 4.0’s union is seriously broken. This has been fixed in newer versions, but unfortunately i can’t upgrade MySQL on this machine.

Update Initially i wrote here that PostgreSQL supports inline views, but some google research seems to indicate otherwise. And apparently MySQL supports inline views as of version 4.1. Seems it’s time to upgrade MySQL to version 4.1 instead of moving to PostgreSQL.

Another update Joseph commented that PostgreSQL does support inline views. I guess they’re not called inline views in PostgreSQL though. When you search in the PostgreSQL documentation for inline view nothing helpfull comes up.

Another update Inline views are called sub-selects in PostgresSQL.

1/3/2005

Jdeveloper 10.1.2 is available

Filed under: — site admin @ 11:02 pm

It’s not very obvious, but version 10.1.2 is a bug fix release for jDeveloper 9.0.5.2. It contains over 1000 bug fixes, so if you’re using jDeveloper 9.0.5.2 start downloading now. I know i am.

12/16/2004

Jdeveloper 10.1.3 preview

Filed under: — site admin @ 10:14 pm

I just downloaded and installed the 10.1.3 preview. One of the problems i have with jdeveloper 9.0.5.2 is that the projects in the application navigator do not show the directory structure under the projects. Instead it categorizes all files and under the project category folders are displayed instead of directories. For example, all xml files are considered one category, and are usually displayed under one category, even if you put them in different directories. This is a pain if you have a lot of different xml files for different purposses in different directories, especially if some of these files have the same name.

Now, jdeveloper 10.1.3 doesn’t store a reference to every files in the project file. This makes it easier to put project files in cvs, you’ll have less conflicts. In the project properties you can specify which files need to be displayed as part of the project, you can filter on directories and on files. This is configured in so called working sets.

To test this I created a new workspace and a new project, and then i created one new file in this project: a file called config.cfg in a folder conf. The first thing i do in this new jdeveloper version, and immediately i seem to experience a bug or a misunderstanding on my part: the project doesn’t show config.cfg. I’ve edited the working set (which shows the conf directory), i added a *.cfg pattern to the working set. I’ve also added the extension .cfg under File Types in the preferences windows, but nothing helps. Config.cfg is not displayed as part of my project…

9/24/2004

Re: BPEL is great – and so is Oracle BPEL

Filed under: — andrejk @ 8:02 pm

Lucas Jellema is reporting about the BPEL presentation at the Oracle Open World in Amsterdam today. I had also planned to attend it, but i was too busy this week: implementing a business process for a project using the Oracle BPEL process manager. Oracle’s BPEL Designer makes it look easy to create a bpel process, but you need quite some knowledge to use it: web services, xml, xml schema, using multiple namespaces in one xml document, wsdl, wsif, xpath, java, j2ee, ejb’s, ldap, jsp’s…

It’s good to hear that the bpel designer plugin for JDeveloper has already reached beta status, as running 2 IDE’s (Eclipse & JDeveloper) is a bit too much for my laptop.

During modelling the designer verifies the endpoints you define using wsdl files. It displays an error when the endpoints aren’t available. This means that it’s probably not very usefull for analysts who are designing a business process. It would be nice if you could convert UML Activity Diagrams to BPEL processes in JDeveloper. This would allow analysts to use the Activity diagrams to model the business process, which could then be converted to BPEL processes by developers.

Lucas also mentions WSIF, saying that he doesn’t exactly know what it is. His summary is pretty good though. WSIF allows you to invoke non web services as if they were web services. In BPEL when you want to use a web service you have to specify it as an endpoint by providing the wsdl file which describes the services. Oracle BPEL process manager invokes these web services through it’s web service libraries. Using apache wsif you can provide wsdl files for non web services such as EJB and Message queues. Embedded in the wsdl file are wsif tags which describe how to invoke the service. Oracle BPEL process manager will invoke these services not by using it’s web service libraries but by using the Apache wsif library.

So all the developer has to do is to write a wsdl file containing wsif tags describing the service and it can be used as an endpoint in the bpel process.

One important part currently lacking in Oracle BPEL is security. A bpel process is a web service in itself, and often you will want to restrict access to the web service. When creating web services in JDeveloper you can control access by specifying security constraints in the web.xml file. This is not possible for BPEL processes. Oracle is working on this. Integration with JAAS is expected in the next release in october, integration with Oracle single sign on is expected at the end of this year.

9/22/2004

Using WSIF with Oracle BPEL

Filed under: — andrejk @ 7:40 am

Oracle BPEL Process Manager uses Apache WSIF to enable you to call non web services as part of your BPEL process. This, for example, allows you to easily invoke EJB’s. I couldn’t locate any documentation describing how to use WSIF with Oracle BPEL. At first, i was looking for a tool to generate a WSIF WSDL file for an existing EJB, but i don’t think it currently exists. Looks like you have to manually create a wsdl file with wsif tags, which you can use when you add a new partner link in the BPEL designer. The easiest way to do this is by copying one of the existing wsdl/wsif files from the examples (look under samples/tutorials/702.Bindings).

7/21/2004

Creating a custom tag for use with ADF data bindings

Filed under: — andrejk @ 9:16 am

Here’s how you can create custom tags that support JSTL’s expression language. This example applies to JSP 1.2. In JSP 2.0 is has become a lot easier, as JSP 2.0 already supports EL, so you don’t need JSTL for that.

I wanted to create a tag that can be used with ADF’s data bindings, for example:


<taglib1:Tag1 attr1="${bindings.TabDonorView1}" ></taglib1:Tag1>

In you tag implementation code you’ll need to import apache jstl’s ExpressionEvaluatorManager. Here’s how you can use it:


import oracle.adf.model.binding.DCControlBinding;
import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;
...
binding = (DCControlBinding) ExpressionEvaluatorManager.evaluate("attr1",attr1,Object.class,this,pageContext);

Using VPD with BC4J

Filed under: — andrejk @ 9:14 am

On OTN you’ll find a document outlining how to use VPD with BC4J: How To Create Secure BC4J Applications with Oracle9i VPD and Oracle 9iAS JAAS Provider.

I’ve tried the method described, but couldn’t get it to work properly. The afterConnect method is called only once, if you do not use connection pooling. I tested this by setting the max application module pool size to 1, and starting 2 browser sessions. Logging in with the first browser, afterConnect is called, setting the application context for VPD. After logging in with the second browser, afterConnect is not called as the application module already has a database connection.

You need to use afterActivation instead of afterConnect to make this work. AfterActivation is called every time an application module is activated from the pool. Now you can set your VPD context in the database before doing any work in the application module.

Update: Steve Muench has commented that it’s better to implement this using prepareSession(), instead of afterActivation().

7/15/2004

First impression Oracle BPEL Process Manager

Filed under: — andrejk @ 9:13 am

On my previous post about Oracle BPEL process manager Dave Ruzius asks:

Hi, we’re also busy investigating BPEL Process Manager options. Did you perform some own testing / developing yet ? Whats your opinion on the tool and future of it within the Oracle product stack ?

Oracle BPEL process manager look really complete. It has a full implementation of BPEL 1.1, can handle user interaction through the TaskManager service. This allows you to create workflow like solutions.

The designer plugin for Eclipse makes it easy to create new BPEL processes (although you’ll still need to know about xml, xpath, xml schema’s, etc. So i think there’s still a big learning curve). Also deployment to different environments (test,development,etc) has been handled in an Ant build file, which is very developer friendly.

I also like the BPEL console, it gives you insight into a lot information about your BPEL processes and their instances. It provides statistics, so you can optimize the runtime of your processes. Also usefull is that all information in the BPEL console is also available through a Java API. I’m not sure though if the BPEL console is very usefull if you have thousends of processes running daily. Maybe then you’ll need to implement your own management console using these API’s. One point of dissapointment is that the BPEL console doesn’t work correctly in firefox, hopefully this will be fixed in the next version.

My guess is that the Oracle BPEL process manager will replace Oracle ProcessConnect and maybe Oracle Workflow, probably somewhere next year. It will take Oracle some time to integrate BPEL process manager into Application Server Integration and BPEL designer into JDeveloper.

Powered by WordPress