java.lang.IllegalArgumentException: name

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.IllegalArgumentException: name

rich

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more



_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

rich
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more




_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

david@butterdev.com
Rich,

at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)

This line looks a bit suspect to me.  I am not exactly sure what is going on here but it looks like you are using some sort of plugin and it seems to be initializing DWR a second time, which would explain your problem.  I believe you should only be seeing addParameter being called once with an askFor of "response:org.directwebremoting.servlet.CachingHandler".

On 09/03/2017 02:40 AM, Rich Midwinter wrote:
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more





_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users



_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

rich
In reply to this post by rich
Thanks David (I seem to not be getting the replies via email, but can see the archives).

You're spot on, it's initialising twice - it's a plugin architecture which init'd a servlet for the core and each plugin would do the same. In a similar fashion to what's documented still at http://directwebremoting.org/dwr/documentation/server/configuration/servlet/multiconfig.html but with multiple archives, parsing a web.xml within the plugins and programatically adding each servlet.

If that pattern isn't available anymore, does anyone know if there's an alternative way of deploying multiple further dwr.xml files after the initial servlet is init'd?

Thanks
Rich


On 3 September 2017 at 09:40, Rich Midwinter <[hidden email]> wrote:
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more





_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

david@butterdev.com
It looks like this may have been introduced here:
https://github.com/directwebremoting/dwr/commit/d1c39636273c1306bca4c4dce142a513b8f51074

Mike, can you take a quick look at this and let me know what you think?  It seems like there a few ways we could fix this.


On 09/04/2017 03:35 AM, Rich Midwinter wrote:
Thanks David (I seem to not be getting the replies via email, but can see the archives).

You're spot on, it's initialising twice - it's a plugin architecture which init'd a servlet for the core and each plugin would do the same. In a similar fashion to what's documented still at http://directwebremoting.org/dwr/documentation/server/configuration/servlet/multiconfig.html but with multiple archives, parsing a web.xml within the plugins and programatically adding each servlet.

If that pattern isn't available anymore, does anyone know if there's an alternative way of deploying multiple further dwr.xml files after the initial servlet is init'd?

Thanks
Rich


On 3 September 2017 at 09:40, Rich Midwinter <[hidden email]> wrote:
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more






_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users



_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

Mike Wilson
Administrator
Hi Rich and David,
I've taken a look and here's my comments:
 
Doing LocalUtil.classForName on strings that are not class names is done on purpose in the DWR setup. The DWR container stores both string parameters and object parameters and when the string "response:xyz" fails to instantiate to an object it is just stored as a string. There is a similar pattern for "url:xyz" strings in the defaults. You can see the catch-clauses for ClassNotFoundException both in DefaultContainer.java:130 and in LocalUtil.java:1198 that are supposed to make this a "non-error".
 
What I suspect is that you may have a custom classloader configured that throws IllegalArgumentException instead of ClassNotFoundException upon detecting the malformed class name with a colon. This is not mentioned in docs for official classloaders so this would be non-standard behaviour. Or at least "new" as we haven't run into this before :-) 
Please debug the code in LocalUtil and correlate the two classloader instances with exception type thrown.
 
Best regards
Mike
 
 
David Marginian wrote:
It looks like this may have been introduced here:
https://github.com/directwebremoting/dwr/commit/d1c39636273c1306bca4c4dce142a513b8f51074

Mike, can you take a quick look at this and let me know what you think?  It seems like there a few ways we could fix this.


On 09/04/2017 03:35 AM, Rich Midwinter wrote:
Thanks David (I seem to not be getting the replies via email, but can see the archives).

You're spot on, it's initialising twice - it's a plugin architecture which init'd a servlet for the core and each plugin would do the same. In a similar fashion to what's documented still at http://directwebremoting.org/dwr/documentation/server/configuration/servlet/multiconfig.html but with multiple archives, parsing a web.xml within the plugins and programatically adding each servlet.

If that pattern isn't available anymore, does anyone know if there's an alternative way of deploying multiple further dwr.xml files after the initial servlet is init'd?

Thanks
Rich


On 3 September 2017 at 09:40, Rich Midwinter <[hidden email]> wrote:
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more






_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users



_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalArgumentException: name

Mike Wilson
Administrator
Hi Rich, did you get any further on this?
Best regards
Mike
 
Mike Wilson wrote:
Hi Rich and David,
I've taken a look and here's my comments:
 
Doing LocalUtil.classForName on strings that are not class names is done on purpose in the DWR setup. The DWR container stores both string parameters and object parameters and when the string "response:xyz" fails to instantiate to an object it is just stored as a string. There is a similar pattern for "url:xyz" strings in the defaults. You can see the catch-clauses for ClassNotFoundException both in DefaultContainer.java:130 and in LocalUtil.java:1198 that are supposed to make this a "non-error".
 
What I suspect is that you may have a custom classloader configured that throws IllegalArgumentException instead of ClassNotFoundException upon detecting the malformed class name with a colon. This is not mentioned in docs for official classloaders so this would be non-standard behaviour. Or at least "new" as we haven't run into this before :-) 
Please debug the code in LocalUtil and correlate the two classloader instances with exception type thrown.
 
Best regards
Mike
 
 
David Marginian wrote:
It looks like this may have been introduced here:
https://github.com/directwebremoting/dwr/commit/d1c39636273c1306bca4c4dce142a513b8f51074

Mike, can you take a quick look at this and let me know what you think?  It seems like there a few ways we could fix this.


On 09/04/2017 03:35 AM, Rich Midwinter wrote:
Thanks David (I seem to not be getting the replies via email, but can see the archives).

You're spot on, it's initialising twice - it's a plugin architecture which init'd a servlet for the core and each plugin would do the same. In a similar fashion to what's documented still at http://directwebremoting.org/dwr/documentation/server/configuration/servlet/multiconfig.html but with multiple archives, parsing a web.xml within the plugins and programatically adding each servlet.

If that pattern isn't available anymore, does anyone know if there's an alternative way of deploying multiple further dwr.xml files after the initial servlet is init'd?

Thanks
Rich


On 3 September 2017 at 09:40, Rich Midwinter <[hidden email]> wrote:
I know a little more on this now.

DefaultContainer.addParameter("response:org.directwebremoting.servlet.CachingHandler", "org.directwebremoting.servlet.PublicPeriodCacheableResponse") does this:

    Class<?> impl = LocalUtil.classForName((String) value);

Where value is the second parameter provided. And is able to then call newInstance without issue.  Once it has this instance it then does:

    Class<?> iface = LocalUtil.classForName(askFor);


But this is on the value "response:org.directwebremoting.servlet.CachingHandler" and the response: bit is breaking it. But that comes from defaults.properties and looks entirely predictable, so I'm not sure why other people wouldn't suffer this?

Thanks
Rich




On 1 September 2017 at 18:17, Rich Midwinter <[hidden email]> wrote:

Hi

I'm trying to look at upgrading the version of DWR within an application from 1.x to the latest and I'm getting the below error. Any suggestions on what the cause might be?

Thanks
Rich


2017.09.01 15:46:36 org.directwebremoting.log.startup - Starting: DwrServlet v3.0.3-dev on jetty/9.2.14.v20151106 / JDK 1.8.0_144 from Oracle Corporation at

==> target/openfire/logs/all.log <==
2017.09.01 15:46:36 ERROR [pool-296-thread-1]: org.directwebremoting.servlet.DwrServlet - init failed
org.directwebremoting.extend.ContainerConfigurationException: java.lang.IllegalArgumentException: name
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:194)
at org.directwebremoting.servlet.DwrServlet.createContainer(DwrServlet.java:101)
at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:64)
at org.jivesoftware.openfire.container.PluginServlet.registerServlets(PluginServlet.java:161)
at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java:557)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:276)
at org.jivesoftware.openfire.container.PluginMonitor$MonitorTask$4.call(PluginMonitor.java:264)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: name
at sun.misc.URLClassPath$Loader.getResource(URLClassPath.java:729)
at sun.misc.URLClassPath.getResource(URLClassPath.java:239)
at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.directwebremoting.util.LocalUtil.classForName(LocalUtil.java:1199)
at org.directwebremoting.impl.DefaultContainer.addParameter(DefaultContainer.java:124)
at org.directwebremoting.impl.StartupUtil.setupDefaults(StartupUtil.java:565)
at org.directwebremoting.impl.StartupUtil.setupDefaultContainer(StartupUtil.java:246)
at org.directwebremoting.impl.StartupUtil.createAndSetupDefaultContainer(StartupUtil.java:189)
... 10 more






_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users



_______________________________________________
dwr-users mailing list
[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dwr-users