[jboss-user] [JBoss Seam] - Re: Quartz - persisting timers on the database problem.
raffaele.camanzo
do-not-reply at jboss.com
Tue Oct 16 11:12:16 EDT 2007
Deeper, deeper, deeper... Found and solved.
the problem:
from the QuartzDispatcher.java:
| InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("/seam.quartz.properties");
|
Seam does not recognize my seam.quartz.properties.
I've changed it in:
| InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("seam.quartz.properties");
|
and everything works great (if you use a Oracle DB remember to download the latest Quartz distribution and include the quartz-oracle.jar in your app).
It seems to be a bug (no need to add the initial slash), indeed, searching for the seam.properties file in the Seam source code (seam.properties and seam.quartz.properties are in the same position and loaded in the same way) I found this:
from Initialization.java
| ...
| private void scanForComponents()
| {
| ComponentScanner[] scanners = {
| new ComponentScanner("seam.properties"),
| new ComponentScanner("META-INF/seam.properties"),
| new ComponentScanner("META-INF/components.xml")
| };
| ...
|
from ComponentScanner.java
| ...
| public ComponentScanner(String resourceName)
| {
| super(resourceName);
| }
| ...
|
from Scanner.java
| ...
| public Scanner(String resourceName)
| {
| this( resourceName, Thread.currentThread().getContextClassLoader() );
| }
| ...
| protected void scan()
| {
| Set<String> paths = new HashSet<String>();
| if (resourceName==null)
| {
| for ( URL url: getURLsFromClassLoader() )
| {
| String urlPath = url.getFile();
| if ( urlPath.endsWith("/") )
| {
| urlPath = urlPath.substring( 0, urlPath.length()-1 );
| }
| paths.add( urlPath );
| }
| }
| else
| {
| try
| {
| Enumeration<URL> urlEnum = classLoader.getResources(resourceName);
| ...
|
I don't know if this needs a Jira issue or if I'm wrong, then, it would be great if one of the Seam developers can have a glance at this.
Regards,
Raffaele Camanzo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4095681#4095681
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4095681
More information about the jboss-user
mailing list