[JBoss JIRA] (JASSIST-151) javassist.runtime.Desc cannot load array types when using thread's context classloader
by Yanic Inghelbrecht (JIRA)
Yanic Inghelbrecht created JASSIST-151:
------------------------------------------
Summary: javassist.runtime.Desc cannot load array types when using thread's context classloader
Key: JASSIST-151
URL: https://issues.jboss.org/browse/JASSIST-151
Project: Javassist
Issue Type: Bug
Affects Versions: 3.15.0-GA
Environment: Any
Reporter: Yanic Inghelbrecht
Assignee: Shigeru Chiba
When the Desc class has to load an array type during instrumentation, it fails when its global flag useContextClassLoader is set to true.
The following testcase demonstrates this :
---
package test_descForName;
import javassist.runtime.Desc;
import org.junit.Assert;
import org.junit.Test;
public class TestDescForName {
@Test
public void test() {
// try it using classloader of TestDescForName
Desc.useContextClassLoader = false;
Assert.assertTrue(Desc.getClazz("[Ljava.lang.String;") != null);
Thread.currentThread().setContextClassLoader(TestDescForName.class.getClassLoader());
Desc.useContextClassLoader = true;
Assert.assertTrue(Desc.getClazz("[Ljava.lang.String;") != null);
}
}
---
The root cause for this defect is the use of ClassLoader#loadClass in method getClassObject (which doesn't handle array types):
private static Class getClassObject(String name) throws ClassNotFoundException {
if (useContextClassLoader)
return Thread.currentThread().getContextClassLoader().loadClass(name);
else
return Class.forName(name);
}
The fix is to use the three argument version of Class#forName (which does handle array types):
private static Class getClassObject(String name) throws ClassNotFoundException {
if (useContextClassLoader)
return Class.forName(name, true, Thread.currentThread().getContextClassLoader());
else
return Class.forName(name);
}
Hooray, my first fix for javassist :)
Best regards,
Yanic
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] (AS7-3773) A security realm definition should not require an authentication mechanism to be defined if 'truststore' is defined.
by Darran Lofthouse (JIRA)
Darran Lofthouse created AS7-3773:
-------------------------------------
Summary: A security realm definition should not require an authentication mechanism to be defined if 'truststore' is defined.
Key: AS7-3773
URL: https://issues.jboss.org/browse/AS7-3773
Project: Application Server 7
Issue Type: Bug
Reporter: Darran Lofthouse
On slave DC security realm defined with only a trust store initialising the native interface raised the following error: -
[Host Controller] 16:24:15,297 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.remoting.server.management: org.jboss.msc.service.StartException in service jboss.remoting.server.management: JBAS017113: Failed to start service
[Host Controller] at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:112) [jboss-as-remoting-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
[Host Controller] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[Host Controller] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
[Host Controller] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
[Host Controller] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
[Host Controller] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
[Host Controller] Caused by: java.lang.IllegalStateException: JBAS017119: A security realm has been specified but no supported mechanism identified
[Host Controller] at org.jboss.as.remoting.RealmSecurityProvider.getOptionMap(RealmSecurityProvider.java:137) [jboss-as-remoting-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
[Host Controller] at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:101) [jboss-as-remoting-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
[Host Controller] ... 5 more
On a related note - if the native interface of the HC failed to start we should probably avoid starting the AS processes as we know there is nothing for them to connect back to.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[JBoss JIRA] (JBAS-9472) Improve the processing time of a request with a large number of parameters.
by Toshio Oya (JIRA)
Toshio Oya created JBAS-9472:
--------------------------------
Summary: Improve the processing time of a request with a large number of parameters.
Key: JBAS-9472
URL: https://issues.jboss.org/browse/JBAS-9472
Project: Application Server 3 4 5 and 6
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Components: Web (Tomcat) service
Affects Versions: JBossAS-5.1.0.GA
Environment: Linux, Windows
Reporter: Toshio Oya
Assignee: Remy Maucherat
We ported an existing business application from Tomcat 5.5.x to JBoss AS 5.1.0.GA.
When running the application on JBoss AS, we found that the processing of a POST request with a large number of parameters takes longer than doing it on Tomcat.
We investigated the cause, it occurred in the processing of org.apache.tomcat.util.http.Parameters class in JBossAS/JBossWeb.
So, we've created a patch for JBoss AS to improve it.
We applied this patch to JBoss AS, then the processing time of 10,000 parameters in a POST request is now as follows.
- Time of processing request.getParameterMap().
Before:
22,635.0 msec (average of 3 times)
After:
2.3 msec (average of 3 times)
We want to incorporate this patch in JBoss AS.
Using our sample application:
1. Build
$ cd /tmp
$ unzip sample-app.zip
$ cd sample-app
$ mvn package
2. Deploy
Please copy the test_war-1.0.war to your deploy directory for your JBossAS.
$ cd blank_war/target/
$ cp test_war-1.0.war $JBOSS_HOME/server/<profile>/deploy
3. Test
Access the url - http://server:port/test_war-1.0/ via a web browser.
Press the "click" button in the page.
And, press "OK" button on a dialog.
The time of processing request.getParameters() is logged to CONSOLE and log/server.log.
ex)
13:42:43,084 FATAL [SampleTestAction] request.getParameterMap() taken 20467 msec.
About patch.
modified-5.1.0.GA.zip
- B2CConverter.java ... replacement of org.apache.tomcat.util.buf.B2BConverter
- Parameters.java ... replacement of org.apache.tomcat.util.http.Parameters
- LocalStrings.properties
... added a new property file to org.apache.tomcat.util.http.
Best regards,
Team.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months