[JBossWS] - Memory leak with Provider<Source> webservice implementation
by Sintetik7
Hi,
I have a problem running my app that implements webservice using Provider api. After ~4hrs of mild load AS goes out of memory.
I'm using JBoss 5.0.1 with sun jdk 1.6.0_14. Configuration is
-Xms256m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -XX:+UseConcMarkSweepGC -Dsun.rmi.dgc.client.gcInterval=1800000 -Dsun.rmi.dgc.server.gcInterval=1800000
My endpoints defined as follows:
| @WebServiceProvider(serviceName = "StorageService", portName = "External", wsdlLocation = "WEB-INF/wsdl/storage.wsdl")
| @BindingType(value = HTTPBinding.HTTP_BINDING)
| @ServiceMode(value = Service.Mode.PAYLOAD)
| public class StorageServiceExternalProvider extends AbstractServiceProvider implements Provider<Source> {
|
| @Resource(type = Object.class)
| protected WebServiceContext wsContext;
|
| public Source invoke(Source req) {
| MessageContext mc = wsContext.getMessageContext();
| String path = ((String) mc.get(MessageContext.PATH_INFO)).substring(1);
| return invoke(path, req);
| }
|
| protected String getJndiNameSLSB() {
| return "StorageExternalSarco/local";
| }
| }
|
|
| public abstract class AbstractServiceProvider {
| private static Logger log = Logger.getLogger(AbstractServiceProvider.class);
|
| protected abstract String getJndiNameSLSB();
|
| public Source invoke(String path, Source req) {
|
| JAXBContext jc = null;
| Object local;
| Method[] localMethods;
|
| try {
| InitialContext ic = new InitialContext();
| local = ic.lookup(getJndiNameSLSB());
| ic.close();
| localMethods = local.getClass().getMethods();
|
| jc = StorageJAXBContext.getContext();
|
| } catch (Throwable t) {
| log.error("Unable to initialize", t);
| return new DOMSource();
| }
|
| Reader decoded;
| Object in = null;
| try {
|
| decoded = new StringReader(URLDecoder.decode(req.toString(), "utf8"));
| in = jc.createUnmarshaller().unmarshal(decoded);
|
| if (in instanceof JAXBElement<?>)
| in = ((JAXBElement<?>)in).getValue();
|
| for (Method m : localMethods)
| if (m.getName().equals(path))
| {
| Object result = m.invoke(local, in);
| Class<?> retType = m.getReturnType();
| if (retType == Void.TYPE)
| return new DOMSource();
| else
| return new JAXBSource(jc, result);
| }
|
| throw new Exception("Accessing invalid path: " + path);
|
| } catch (Throwable e) {
| log.error("Error processing invocation for path: " + path + ", input type is: " + (in == null ? "NULL" : in.getClass()), e);
| return new DOMSource();
| }
| }
|
web.xml:
<servlet>
| <servlet-name>StorageServiceExternalProvider</servlet-name>
| <servlet-class>com.photoholding.storage.StorageServiceExternalProvider</servlet-class>
| </servlet>
| <servlet-mapping>
| <servlet-name>StorageServiceExternalProvider</servlet-name>
| <url-pattern>/External/*</url-pattern>
| </servlet-mapping>
I tried to do jmap profiling and it shows lots of B[ and C[ objects growing with time. Looks like "Provider" instance is never released and GC skips it - size of the OldGen grows until GC can't handle it.
Any help is appreciated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232449#4232449
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232449
16 years, 11 months
[Advanced Documentation] - How to pass/set ContextData to be available on interceptors
by tomazi30
I have 2 jboss instances. Clients connect to the first app1 on jboss1, which connects to the second app2 on jboss2 :
client-> jboss 1 ->jboss2
This means that each method that is invoked on jboss1 invokes some method(s) on jboss2. JBoss1 is just another client from Jboss2 point of view
I have to log all user activity. Each jboss instance writes to it's own log file.
I am ussing an interceptor to log all application's bean/method invocations on each jboss instance.
@AroundInvoke
public Object intercept(InvocationContext ctx) throws Exception {
....
log.info(ctx.getMethod().getName());
...
ctx.proceed();
}
I want establish reliable corelation between jboss1 log and cluster jboss logs.
How can I obtain client (jboss1) information on jboss2?
Or, if that is not possible, how can I pass some context information from jboss1(app1) method to jboss2(app2) method, without explicitly changing method signature on app2?
Ideally the information should be available on InvocationContext.getContextData() on the jboss2, but I don't know how to set contextdata on InvocationContext.
Looking at InvocationContextImpl.java I can see that getContextData tries to get the metadata from ClientInterceptorUtil:
metadata = ClientInterceptorUtil.getClientMetadataMap(wrapped);
I don't know how/where to set the data to ClientInterceptorUtil.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232443#4232443
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232443
16 years, 11 months
[Microcontainer] - Re: can't read resource from the classpath??
by jeff.yuchang
Just finished the test, same result, the whole stack tree is as following:
| 17:34:07,272 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/local/deploy/jboss-5.0.1.GA/server/default/deploy/idm.jar/ state=PreReal mode=Manual requiredState=Real
| org.jboss.deployers.spi.DeploymentException: java.lang.IllegalArgumentException: no config resource
| at org.jboss.identity.idm.integration.jboss5.IDMDeployer.deploy(IDMDeployer.java:123)
| at org.jboss.identity.idm.integration.jboss5.IDMDeployer.deploy(IDMDeployer.java:42)
| at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:547)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalArgumentException: no config resource
| at org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration.createConfigurationMetaData(JAXB2IdentityConfiguration.java:121)
| at org.jboss.identity.idm.integration.jboss5.IDMDeployer.deploy(IDMDeployer.java:75)
| ... 23 more
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232440#4232440
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232440
16 years, 11 months