Closed GoogleCodeExporter closed 9 years ago
Hi James. Sounds like you just need to convert the schema I have (MySQL) to
oracle specific. I can try test one when I get time.
Original comment by saltnlight5
on 13 Mar 2012 at 4:30
I too get the same error.
org.quartz.SchedulerException: TriggerListener 'MyJobHistoryPlugin' threw
exception: Failed to execute DB connection act
can you help me out with that ?
Original comment by ani...@gmail.com
on 16 Mar 2012 at 5:51
Can you guys show me your full quartz.properties that shows how you configure
the JdbcSchedulerHistoryPlugin?
Original comment by saltnlight5
on 17 Mar 2012 at 4:08
Hi,
attached is my quartz.properties.
The invalid column is due to the date/timespan field.
to make it work with my oracle db, what i did was i imported the source code of
JdbcSchedulerHistoryPlugin.java locally and edited the line
public void schedulerStarted() {
Object[] params = new Object[] {
localIp,
localHost,
schedulerNameAndId,
"SchedulerListener",
"schedulerStarted",
//new Date(),
new Timestamp(Calendar.getInstance().getTime().getTime()),
null,
null,
null,
null,
null
};
insertHistory(insertSql, params);
I commented out the //new date() (this is the java.util.date) and not
java.sql.date thus I commented that and replaced it with timespan as shown
below.
I did this in each of the methods where insertHistory was called.
Can you recommend me any other solution or a perminant fix
thanks for the quick reply.
Original comment by ani...@gmail.com
on 17 Mar 2012 at 5:22
Attachments:
Okay, I see the problem now. The Oracle JDBC doesn't like or play with default
values when binding SQL parameters as we as MYSQL. So it error out when we try
to bind it.
I've committed a fix that make JdbcSchedulerHistoryPlugin more friendly. Can
you guys grap the latest myschedule-2.4.2-SNAPSHOT.war from the download and
retry this?
BTW, the Oracle schema should be like this (use TIMESTAMP!)
CREATE TABLE "QRTZ_SCHEDULER_HISTORY"
(
"HOST_IP" VARCHAR2(120 BYTE) NOT NULL,
"HOST_NAME" VARCHAR2(200 BYTE) NOT NULL,
"SCHEDULER_NAME" VARCHAR2(250 BYTE) NOT NULL,
"EVENT_TYPE" VARCHAR2(250 BYTE) NOT NULL,
"EVENT_NAME" VARCHAR2(250 BYTE) NOT NULL,
"EVENT_TIME" TIMESTAMP NOT NULL,
"INFO1" VARCHAR2(250 BYTE),
"INFO2" VARCHAR2(250 BYTE),
"INFO3" VARCHAR2(250 BYTE),
"INFO4" VARCHAR2(250 BYTE),
"INFO5" VARCHAR2(250 BYTE)
);
CREATE INDEX QRTZ_SCHEDULER_HISTORY_INDEX on QRTZ_SCHEDULER_HISTORY(HOST_IP,
HOST_NAME, EVENT_TYPE,EVENT_NAME,EVENT_TIME);
Original comment by saltnlight5
on 17 Mar 2012 at 6:09
Hi
thanks for the reply, I will try this out today and revert. A quick question..
I am actually not using the war file as my functionality. I am just using the
plugin feature to store history data. Thus I hope if I just extract the war and
add the myschedule-quartz-extra-2.4.2-SNAPSHOT.jar file to my project and run,
that should still test your changes right ?
correct me if I am wrong.
thanks again for the response.
Original comment by ani...@gmail.com
on 17 Mar 2012 at 7:00
That's correct Anil.
Original comment by saltnlight5
on 17 Mar 2012 at 7:12
Hi,
Sorry for the delayed reply. I did tested it with the jar as mentioned above
and it works fine except for an error which is continuously there in the logs.
This error was also present in the previous version of the jar, I feel it is
not logging a certain type of event.
I feel, this has references to the core quartz file.. will it be possible to
fix this ?
I have attached the complete trace with debugs here in the attachment.
thanks !
Original comment by ani...@gmail.com
on 18 Mar 2012 at 5:46
Attachments:
Hello,
Please ignore my previous comment. I had not removed the previous version of
the jar and thus I was getting the error as listed above.
Now when I remove the previous versions of the jar, I get the following error.
With this fix, my application does not even start. the scheduler starts and
immediately shutsdown.
Is there a way to fix this ?
Original comment by ani...@gmail.com
on 18 Mar 2012 at 6:00
Hum... seems like your Oracle driver didn't return values when calling
PreparedStatement#getMetaData(), which used to inspect the column types for
conversion. It would seems odd Oracle won't return data on that.
I have tested this against a OracleXE 11g and it works fine. Maybe you need
upgrade jdbc driver?
Original comment by saltnlight5
on 18 Mar 2012 at 11:08
yes this fixes it.
thanks !
Original comment by ani...@gmail.com
on 19 Mar 2012 at 2:33
fixed in Release-2.4.2
Original comment by saltnlight5
on 21 Mar 2012 at 3:36
Original issue reported on code.google.com by
james.yo...@gmail.com
on 8 Mar 2012 at 11:17