Juni 13, 2006

Tips Trik Eclipse, Spring, Dan Hibernate

Posted in Java, komputer pada 6:02 am oleh fuad

Tips trick eclipse

Bingung nih dapat error seperti ini

Buildfile: /home/fuad/EclipseProject/DataCentre/build.xml

build:

[delete] Deleting directory /home/fuad/EclipseProject/DataCentre/war/WEB-INF/classes

[mkdir] Created dir: /home/fuad/EclipseProject/DataCentre/war/WEB-INF/classes

[copy] Copying 14 files to /home/fuad/EclipseProject/DataCentre/war/WEB-INF/classes

[javac] Compiling 19 source files to /home/fuad/EclipseProject/DataCentre/war/WEB-INF/classes

junit:

BUILD FAILED

/home/fuad/EclipseProject/DataCentre/build.xml:126: Could not create task or type of type: junit.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual

solutions are to read the manual pages then download and

install needed JAR files, or fix the build file:

– You have misspelt ‘junit’.

Fix: check your spelling.

– The task needs an external JAR file to execute

and this is not found at the right place in the classpath.

Fix: check the documentation for dependencies.

Fix: declare the task.

– The task is an Ant optional task and the JAR file and/or libraries

implementing the functionality were not found at the time you

yourself built your installation of Ant from the Ant sources.

Fix: Look in the ANT_HOME/lib for the ‘ant-‘ JAR corresponding to the

task and make sure it contains more than merely a META-INF/MANIFEST.MF.

If all it contains is the manifest, then rebuild Ant with the needed

libraries present in ${ant.home}/lib/optional/ , or alternatively,

download a pre-built release version from apache.org

– The build file was written for a later version of Ant

Fix: upgrade to at least the latest release version of Ant

– The task is not an Ant core or optional task

and needs to be declared using <taskdef>.

– You are attempting to use a task defined using

<presetdef> or <macrodef> but have spelt wrong or not

defined it at the point of use

Jadi kayaknya si ant tidak mengenali task “junit”. Ada dua kemungkinan memang versi antnya tidak mendukung yang kedua task junit membutuhkan library yang tidak ada.

Untuk yang pertama di komputer saya tidak mungkin karena sebelum di coba di eclipse, saya telah coba dari konsol dan berhasil. Kemnugkinan yang kedua saya buka opsi konfigurasi ant pada eclipse. Yaitu di

Run–>External Tools–>External Tools

Tampil Dialog, pilih file build xml project saya, lihat tab classpath dan memang tidak ada library junit.jar. Trus saya kopi file junit.jar ke folder WEB-INF/lib. Trus saya buka kembali dialog yang tadi.

Ke Tab classpath. Pilih User Entries. Klik tombol Add Jars, trus pilih file junit.jar dan OK, klik Apply, dan Run

(Success)

Spring-Tag-Error

Cek validitas DTD(Document Type Definition ) di file file konfigurasi xml

Hibernate Query By Example

pada Hibernate Query By Example. Primary key akan diabaikan

4 Komentar »

  1. aditya said,

    Saya baru dalam menggunakan Eclipse dengan Hibernate, pada new Mapping File ada Driver yang diisi kenapa kosong ya..harus setting dimana ya
    termakasih.

  2. fuad said,

    Driver itu untuk konektor jdbc

  3. setyawan said,

    saya blm paham tentang konsep hibernate itu sendiri kalo boleh saya mita tutorialnya yang membahasa hibernate dari awal dan tolong kirimkan ke email saya…
    trmksih…………..

  4. yudi said,

    install hibernate caanya gimana? saya lagi ada tugas.kebetulan pake eclipse galileo tapi gak bisa terus


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: