-
1. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Jan 17, 2013 8:03 AM (in response to jonathanmclarke)Your issue seems weird. Have you seen quartz debug log message in server log about starting quartz scheduler? Something like:
Found seam.quartz.properties file. Using it for Quartz config.
or
No seam.quartz.properties file. Using in-memory job store.
It is true that you can't cast org.jboss.seam.async.ThreadPoolDispatcher to org.jboss.seam.async.QuartzDispatcher, but there is the question why is there different proxy instance.
-
2. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Jan 20, 2013 9:51 AM (in response to manarh)Neither of those messages appear in the log files, even though I've declared Quartz in the components.xml, and I've specified the quartz properties file. If you try and seam-gen a project with 2.3.0 and AS7.1.1.Final, and put the following code into a new class, does it work for you?
@Observer("org.jboss.seam.postInitialization")
public void observe() {
try {
QuartzDispatcher fQuartzDispatcher = QuartzDispatcher.instance();
Scheduler fScheduler = fQuartzDispatcher.getScheduler();
JobDetail fJobDetail = new JobDetail("MyJob1",
fScheduler.DEFAULT_GROUP, MyJob.class);
SimpleTrigger fSimpleTrigger = new SimpleTrigger(
"MyTrigger", fScheduler.DEFAULT_GROUP,
new Date(), null, SimpleTrigger.REPEAT_INDEFINITELY,
(long) 1000);
JobDataMap fJobDataMap = fJobDetail.getJobDataMap();
fJobDataMap.put("Processor", fMyProcessor);
fJobDataMap.put("QuartzScheduler", fScheduler);
fScheduler.scheduleJob(fJobDetail, fSimpleTrigger);
}
catch (Exception fException) {
fLog.error(fException.getMessage());
}
}
-
3. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Jan 21, 2013 10:58 AM (in response to jonathanmclarke)I haven't tried that yet, but will do. What type of project do you have? EAR or WAR?
-
5. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Jan 22, 2013 4:15 AM (in response to jonathanmclarke)I did what you have described and I can see the following messages in my server.log and schedule job is executed after all:
09:48:36,546 WARN [org.jboss.seam.async.QuartzDispatcher] (MSC service thread 1-2) No seam.quartz.properties file. Using in-memory job store. 09:48:36,577 INFO [org.quartz.simpl.SimpleThreadPool] (MSC service thread 1-2) Job execution threads will use class loader of thread: MSC service thread 1-2 09:48:36,607 INFO [org.quartz.core.SchedulerSignalerImpl] (MSC service thread 1-2) Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl 09:48:36,607 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-2) Quartz Scheduler v.null.null.null created. 09:48:36,610 INFO [org.quartz.simpl.RAMJobStore] (MSC service thread 1-2) RAMJobStore initialized. 09:48:36,610 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-2) Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties' 09:48:36,610 INFO [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-2) Quartz scheduler version: null.null.null 09:48:36,611 INFO [org.quartz.core.QuartzScheduler] (MSC service thread 1-2) Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
Look at attached zip file, where is my seam-gen generated project without lib directory. If you copy the lib directory with jar files and deploy the testquartz.ear into AS7, you should see the same.
-
testquartz.zip 103.0 KB
-
-
6. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Jan 26, 2013 1:02 PM (in response to manarh)Hi Marek,
Thanks for this. I was able to build your source, and successfully deploy it. I did a source comparison between yours and mine, and I found several differences, which suggests that you're using an unreleased seam-gen:
1. My 2.3.0.Final seam-gen puts the following in orm.xml:
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
version="1.0"
Yours puts:
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0"
2. My 2.3.0.Final seam-gen puts the following in web.xml:
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5"
Yours puts:
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
3. Your deployment is using H2. However, I am using MySQL, so, I reset and ran a seam-gen for H2 instead. However, when I went to deploy, I got the errors reported at:
https://issues.jboss.org/browse/JBSEAM-5037
I could find no reference to the hsqldb.jar file you're suggesting as a solution, and my seam-gen properties and datasources entry are identical to the ones you've specified, too.
So, is it possible that my usage of the MySQL libraries is in some way conflicting? I'd like to try without, but you'll need to advise on how you've built your .ear file, with regards to points above. There were no other differences found between the files you sent and the ones I have.
Jonathan.
-
7. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Jan 28, 2013 8:11 AM (in response to jonathanmclarke)Jonathan, wrt your points 1 and 2, I changed that manually in generated project, because I tried to reduced warning and error messages in log file output. It is still seam gen 2.3.0.Final released sem-gen. I don't think that difference JDBC/database setup should break the application with quartz, anyway I can try that, unfortunately I am on vacations right now, so expect longer response from me.
-
8. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Feb 1, 2013 8:47 AM (in response to manarh)Hi Marek,
Thanks. Looking forward to the response. Please bear in mind, though, that the other problem was that H2 doesn't deploy, as per point 3, and if we could address that too, I would be able to build an identical system to you, and then do a comparison that way.
Also, please find attached a skeleton seam-gen build that I've done exactly as described above, with the MySQL connections. You'll need to create a schema called "skeleton" but it doesn't need any tables. The only things I've added are core classes for instantiating a quartz job, and these additional classes can be found in the com.skeleton.Main folder. I'm still getting the quartz problem. I've done the comparison against yours again, and, unless I'm missing something subtle, I'm at a loss as to what is causing the problem.
Jonathan.
-
9. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Feb 1, 2013 9:05 AM (in response to jonathanmclarke)Hi Marek,
Also, while I've got your attention, would you mind commenting on this point too, please? The Icefaces library offers some rather good pushing technology, and I've also got some Icefaces functionality that I want to keep on a mobile web implementation, but Icefaces seems to have been pulled from the project timeline. I've spoken to Icesoft and they've tested some of their latest mobile functionality with Seam, and it seems to be working, but they don't want to move forward with full support unless the community warrants it, and, if it's been pulled from the Seam framework, then it's unlikely to move forward anymore. If the Richfaces library can implement all Icefaces equivalent, then a move to that is a potential, but not ideal.
https://community.jboss.org/message/776647#776647
Jonathan.
-
10. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Feb 14, 2013 10:25 AM (in response to jonathanmclarke)Hi Marek,
Just wondering whether you've had a chance to look at my skeleton application. If you're not available to do it, is there anyone else there who can lend a hand?
Jonathan.
-
11. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Feb 15, 2013 6:41 AM (in response to jonathanmclarke)Jonathan Clarke wrote:
Hi Marek,
Also, while I've got your attention, would you mind commenting on this point too, please? The Icefaces library offers some rather good pushing technology, and I've also got some Icefaces functionality that I want to keep on a mobile web implementation, but Icefaces seems to have been pulled from the project timeline. I've spoken to Icesoft and they've tested some of their latest mobile functionality with Seam, and it seems to be working, but they don't want to move forward with full support unless the community warrants it, and, if it's been pulled from the Seam framework, then it's unlikely to move forward anymore. If the Richfaces library can implement all Icefaces equivalent, then a move to that is a potential, but not ideal.
https://community.jboss.org/message/776647#776647
Jonathan.
If you tell me what mobile Icefaces components are you using I can ask Richfaces developers or you can do that on their User forum here - https://community.jboss.org/en/richfaces?view=discussions.
-
12. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Feb 15, 2013 7:12 AM (in response to manarh)Hi Marek,
It's less a case of the individual Icefaces components, and more to do with the overall technology stack I need to use. I need Seam 2.3, JBoss AS7, Icefaces, and then Icefaces Mobile OR another mobile framework that works in conjunction with Icefaces pushing. jQuery Mobile and HTML5 don't work very well with Icefaces 1.8.2, for a number of reasons, but particularly with pushing. So, I want asynchronous pushing on the desktop browser, plus any Icefaces component I choose to use in website development, and then a mobile framework that also works with asynchronous pushing, all running under Seam 2.3 and AS7. So, I also need the other Seam 2.3 problem above resolved, too. At the moment, I have Seam 2.2.2 with JBoss 5.1.0, with Icefaces 1.8.2, jQuery Mobile and HTML5, and it does quite hang together.
Jonathan.
-
13. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
manarh Feb 15, 2013 7:51 AM (in response to jonathanmclarke)I have set up your skeleton project and deployed it to AS7 and indeed I can see the error:
ERROR [com.skeleton.Main.Starter] (MSC service thread 1-4) org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
On first view besides a few warnings related to old hibernate config I would say it is not clear for me what the error caused. I will digg deeper to find out that and let you know.
-
14. Re: Only in Seam 2.3.0.Final, and not Seam 2.2.2.Final: java.lang.ClassCastException: org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_seam_2 cannot be cast to org.jboss.seam.async.QuartzDispatcher
jonathanmclarke Feb 15, 2013 9:49 AM (in response to manarh)Many thanks. I appreciate your help, and getting through this should enable me to proceed with my client's development.