[JBoss Portal] - Re: java.lang.OutofMemoryException
by aerostra
"thomas.heute(a)jboss.com" wrote : PermGen Space OOM can happen if you redeploy an application several times. It shouldn't happen in a production environment.
Yep, I came across this problem when I deployed a couple of portlets several times. Managed to solve it by doing the following steps below. My setup is JBP 2.4.1, MySql v5, Java 1.5 on Win XP & Solaris 10 so this may be of relevance to other versions:
Assuming your portlets are already in the "server/default/deploy" directory then
Stop the server, clear out your "server/default/work/jboss.web/localhost" directory of your applications. I've also removed the entire "server/default/tmp" directory as well then restarted the server. It should then automatically deploy your portlets hopefully without problems.
My set up of the JAVA opts is:
JAVA_OPTS="-server -Xms512m -Xmx1024m -XX:MaxPermSize=1024m
{rest of line omitted} which also works as quick fix - bear in mind that my server has enough RAM to do this.
I also have another development setup with the following java opts:
-Xmx256m -Xms256m -XX:PermSize=256m -XX:MaxPermSize=256m
(adjust settings depending on the amount of memory you need)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075026#4075026
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075026
18Â years, 11Â months
[JBossCache] - Unexpected (?) TimeoutException
by jacek187
Could anybody tel me, why I got TimeoutException when 2 Threads are executing this code?
| for (int x = 0; x < 1000; x++) {
| tm.begin();
| System.out.println("R" + Thread.currentThread().getName());
| //inside transaction
| cache.remove("/a");
| System.out.println("AR" + Thread.currentThread().getName());
| tm.commit();
| //outside transaction
| System.out.println("P" + Thread.currentThread().getName());
| cache.putObject("/a/b/c/d", "text"+x);
| System.out.println("AP" + Thread.currentThread().getName());
| }
|
Console Output:
RThread:0
RThread:1
ARThread:1
ARThread:0
PThread:1
PThread:0
APThread:1
RThread:1
org.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/a, caller=GlobalTransaction::3, lock=read owners=[GlobalTransaction::3], write owner=GlobalTransaction::5 (org.jboss.cache.lock.LockStrategyReadCommitted@d02b51)
at org.jboss.cache.Node.acquire(Node.java:500)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireNodeLock(PessimisticLockInterceptor.java:379)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:307)
at
(...)
Complete code:
| package org.jboss.cache.aop;
|
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.transaction.TransactionManager;
|
| import junit.framework.TestCase;
|
| import org.jboss.cache.DummyTransactionManagerLookup;
| import org.jboss.cache.TreeCache;
| import org.jboss.cache.lock.IsolationLevel;
|
| public class ConcurentPutRemoveTest extends TestCase {
|
| private TransactionManager tm;
|
| public ConcurentPutRemoveTest(String s) {
| super(s);
| }
|
| private PojoCache cache;
|
| protected void setUp() throws Exception {
| cache = new PojoCache();
| cache.setCacheMode(TreeCache.LOCAL);
| cache.setIsolationLevel(IsolationLevel.READ_COMMITTED);
| cache.setTransactionManagerLookup(new DummyTransactionManagerLookup());
| cache.setLockAcquisitionTimeout(10000);
| cache.create();
| cache.start();
| tm = cache.getTransactionManager();
| }
|
| protected void tearDown() throws Exception {
| super.tearDown();
| cache.stop();
| cache.destroy();
| }
|
| public void testLock() throws Exception {
| List<SeparateThread> threads = new ArrayList<SeparateThread>();
| for (int x = 0; x < 2; x++) {
| SeparateThread t = new SeparateThread(x);
| threads.add(t);
| t.start();
| }
| for (SeparateThread separateThread : threads) {
| separateThread.join();
| if (separateThread.getException() != null) {
| throw separateThread.getException();
| }
| }
|
| }
|
| private class SeparateThread extends Thread {
| Exception e = null;
|
| private int num = 0;
|
| public SeparateThread(int num) {
| this.num = num;
| }
|
| public Exception getException() {
| return e;
| }
|
| public void run() {
| Thread.currentThread().setName("Thread:" + num);
| try {
| for (int x = 0; x < 1000; x++) {
| tm.begin();
| System.out.println("R" + Thread.currentThread().getName());
| //inside transaction
| cache.remove("/a");
| System.out.println("AR" + Thread.currentThread().getName());
| tm.commit();
| //outside transaction
| System.out.println("P" + Thread.currentThread().getName());
| cache.putObject("/a/b/c/d", "text"+x);
| System.out.println("AP" + Thread.currentThread().getName());
| }
| } catch (Exception e) {
| this.e = e;
| }
| }
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075025#4075025
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075025
18Â years, 11Â months
[JNDI/Naming/Network] - Re: Why does jbossall-client.jar cause
by leo_ni
yes, you are right, when I use jbossall-client.jar in an external client, it is fine. actually I need to use some EJB lookup-specific jar/jars (e.g. jnp-client.jar, jboss-je22.jar, etc.) within my web application. I tried to use some other jars combination instead of use the big jbossall-client.jar, but it ended up giving me the same error especially if I use jnp-client.jar.
I thought the default classloading sequence for a web application is web libraries first, then tomcat libraries and jboss libraries. So before my war is deployed, everything is fine with JBoss, when JBOSS is trying to deploy my war file in a isolated web application scope, it gets jbossall-client.jar loaded first, which might contains some implementation classes with different version of dependencies classes from server side version of dependencies classes I guess. then there is conflicts. That's my thoughts about the issue, but I don't how to fix it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075022#4075022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075022
18Â years, 11Â months
[JBoss Seam] - security rules problem from cvs,
by Stateless Bean
hi,
I try to run new CVS version of seam, and I get error on security rules line.
anonymous wrote :
| ERROR 16-08 23:38:38,937 [org.jboss.seam.drools.RuleBase.compileRuleBase():68] errors parsing rules in: /META-INF/security-rules.drl
| ERROR 16-08 23:38:38,937 [org.jboss.seam.drools.RuleBase.compileRuleBase():74] Rule Compilation error The method insert(Role) is undefined for the type Rule_AdminIsAUser_0 (/META-INF/security-rules.drl:8)
| 2007-08-16 23:38:39 org.apache.catalina.session.StandardSession tellNew
| SEVERE: Session event listener threw exception
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
| at org.jboss.seam.Component.newInstance(Component.java:1966)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
| at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
| at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:187)
| at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
| at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:44)
| at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
| at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369)
| at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:829)
| at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291)
| at org.apache.catalina.connector.Request.doGetSession(Request.java:2312)
| at org.apache.catalina.connector.Request.getSession(Request.java:2075)
| at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
| at com.sun.faces.context.SessionMap.getSession(ExternalContextImpl.java:1002)
| at com.sun.faces.context.SessionMap.get(ExternalContextImpl.java:962)
| at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:48)
| at org.jboss.seam.Component.getInstance(Component.java:1847)
| at org.jboss.seam.Component.getInstance(Component.java:1825)
| at org.jboss.seam.web.Session.getInstance(Session.java:122)
| at org.jboss.seam.contexts.FacesLifecycle.beginRequest(FacesLifecycle.java:54)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeRestoreView(SeamPhaseListener.java:361)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:139)
| at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:82)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:72)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:149)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Unknown Source)
| Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule name=AdminIsAUser, agendaGroup=MAIN, salience=10, no-loop=true]
| SeamSpacePermissions/Rule_AdminIsAUser_0.java (9:345) : The method insert(Role) is undefined for the type Rule_AdminIsAUser_0
|
| at org.drools.rule.Package.checkValidity(Package.java:368)
| at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:250)
| at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:87)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
| at org.jboss.seam.Component.callComponentMethod(Component.java:2078)
| at org.jboss.seam.Component.callCreateMethod(Component.java:2001)
| at org.jboss.seam.Component.newInstance(Component.java:1972)
| at org.jboss.seam.Component.getInstance(Component.java:1869)
| at org.jboss.seam.Component.getInstance(Component.java:1836)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
| at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
| at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
| at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
| at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
| at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
| at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
| at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
| at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
| at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2356)
| at org.jboss.seam.Component.initialize(Component.java:1388)
| at org.jboss.seam.Component.instantiateJavaBean(Component.java:1314)
| at org.jboss.seam.Component.instantiate(Component.java:1267)
| at org.jboss.seam.Component.newInstance(Component.java:1962)
| ... 50 more
Here is my rule
anonymous wrote :
| package SeamSpacePermissions;
|
| import java.security.Principal;
|
| import org.jboss.seam.security.PermissionCheck;
| import org.jboss.seam.security.Role;
|
| rule AdminIsAUser
| salience 10
| no-loop
| when
| Role(name == "admin")
| not Role(name == "user")
| then
| insert(new Role("user"));
| end
|
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:web="http://jboss.com/products/seam/web"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
| http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd">
|
| <core:init jndi-pattern="@jndiPattern@" debug="false"/>
|
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"/>
|
| <security:identity authenticate-method="#{authenticator.authenticate}"
| security-rules="#{securityRules}"/>
|
| <drools:rule-base name="securityRules">
| <drools:rule-files>
| <value>/META-INF/security-rules.drl</value>
| </drools:rule-files>
| </drools:rule-base>
|
| <web:multipart-filter create-temp-files="true"
| max-request-size="1000000"
| url-pattern="*.seam"/>
|
| <web:context-filter url-pattern="/content/*"/>
|
| <persistence:managed-persistence-context name="em" auto-create="true"
| persistence-unit-jndi-name="java:/sguEntityManagerFactory"/>
|
| <event type="org.jboss.seam.notLoggedIn">
| <action expression="#{redirect.captureCurrentView}"/>
| </event>
|
| <event type="org.jboss.seam.postAuthenticate">
| <action expression="#{redirect.returnToCapturedView}"/>
| </event>
|
| <factory name="remoteAddr" value="#{facesContext.externalContext.request.remoteAddr}" />
| </components>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075021#4075021
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075021
18Â years, 11Â months
[JBoss Portal] - encoding issues on portal 2.6
by lucasdeoliveira
Hi there!
We just moved from portal 2.4 to 2.6 and now everytime. On portal 2.4 some jsp pages displayed weird characters sometimes (like a white'?' on a black square - a.k.a encoding issues) but the page was displayed anyway. Now on 2.6 it simply crashes and throws the following Exception:
| 16:53:37,375 ERROR [STDERR] java.io.CharConversionException: Not an ISO 8859-1 character: ?
| 16:53:37,376 ERROR [STDERR] at javax.servlet.ServletOutputStream.print(ServletOutputStream.java:89)
| 16:53:37,376 ERROR [STDERR] at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:242)
| 16:53:37,376 ERROR [STDERR] at com.zAgile.zOntologyNavigator.servlets.zOntologyNavigatorServlet.printOnClient(zOntologyNavigatorServlet.java:88)
| 16:53:37,376 ERROR [STDERR] at com.zAgile.zOntologyNavigator.servlets.zOntologyNavigatorServlet.doPost(zOntologyNavigatorServlet.java:79)
| 16:53:37,376 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| 16:53:37,376 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 16:53:37,376 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| 16:53:37,376 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| 16:53:37,376 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 16:53:37,376 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| 16:53:37,376 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| 16:53:37,377 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| 16:53:37,377 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| 16:53:37,377 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| 16:53:37,377 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
|
We tryed setting tomcat's enconding to UTF-8 but it didn't work.
JSP's and servlets reponses and requests are all setting the enconding.
Any clue how to solve that?
thanks in advance!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075020#4075020
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075020
18Â years, 11Â months