[JBossCache] - java.util.ConcurrentModificationException in JBS 2.1 CR.4 ?
by pcarpenter
Hi
I am using Tree Cache (not pojo) in a stand alone project.
I've been evaluating an upgrade from 2.0GA to 2.1.
After evaluating jbc 2.1 CR.3, I've upgraded to 2.1 CR.4.
Nothing in my code was changed, only the class path.
oddly enough, I started getting those Exceptions:
anonymous wrote : java.util.ConcurrentModificationException
| at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:617)
| at java.util.LinkedList$ListItr.next(LinkedList.java:552)
| at org.jboss.cache.lock.IdentityLock.toString(IdentityLock.java:453)
| at org.jboss.cache.lock.IdentityLock.toString(IdentityLock.java:430)
| at org.jboss.cache.lock.IdentityLock.acquireReadLock(IdentityLock.java:270)
| at org.jboss.cache.lock.IdentityLock.acquire(IdentityLock.java:493)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireNodeLock(PessimisticLockInterceptor.java:634)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:513)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireLocksWithTimeout(PessimisticLockInterceptor.java:440)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.handleGetNodeMethod(PessimisticLockInterceptor.java:393)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:87)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:83)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:452)
| at org.jboss.cache.interceptors.TxInterceptor.handleGetNodeMethod(TxInterceptor.java:245)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:87)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:73)
| at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:123)
| at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:64)
| at org.jboss.cache.invocation.CacheInvocationDelegate.getNode(CacheInvocationDelegate.java:429)
| at org.jboss.cache.invocation.NodeInvocationDelegate.getChild(NodeInvocationDelegate.java:331)
| ......
|
|
And while using different JBC code ...
anonymous wrote :
| java.util.ConcurrentModificationException
| at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:617)
| at java.util.LinkedList$ListItr.next(LinkedList.java:552)
| at org.jboss.cache.lock.IdentityLock.toString(IdentityLock.java:453)
| at org.jboss.cache.lock.IdentityLock.toString(IdentityLock.java:430)
| at org.jboss.cache.lock.IdentityLock.toString(IdentityLock.java:424)
| at java.lang.String.valueOf(String.java:2615)
| at java.lang.StringBuilder.append(StringBuilder.java:116)
| at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:122)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:452)
| at org.jboss.cache.interceptors.TxInterceptor.handleGetNodeMethod(TxInterceptor.java:245)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:87)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
| at org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
| at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:73)
| at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:123)
| at org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:64)
| at org.jboss.cache.invocation.CacheInvocationDelegate.getNode(CacheInvocationDelegate.java:429)
| at org.jboss.cache.invocation.NodeInvocationDelegate.getChild(NodeInvocationDelegate.java:331)
| at org.jboss.cache.invocation.NodeInvocationDelegate.addChild(NodeInvocationDelegate.java:293)
|
| .....
|
Just to be on the safe side, I've switched back to CR.3 and everything went back to normal.
I did some exploring and found that the exceptions are thrown while calling toString() in classes which inherit org.jboss.cache.interceptors.Interceptor.java, when the "trace" boonean field is "true". I've looked for ways to set it to false, but I vould not find the log4j
configuraiton. to save time, I've hard coded "trace" to false, and rebuilt the jboss-code.jar from source, this seemed to do the trick.
public abstract class Interceptor implements InterceptorMBean
| {
| protected Interceptor next = null, last = null;
| protected CacheSPI<?, ?> cache;
| protected Log log = null;
| protected Configuration configuration;
| private boolean statsEnabled = false;
| protected boolean trace = false;
|
| public Interceptor()
| {
| initLogger();
| }
|
| protected void initLogger()
| {
| log = LogFactory.getLog(getClass());
| // trace = log.isTraceEnabled();
|
| }
Is it a bug? I couln't find any info in the JIRA.
if so, what is the proper way to config trace to false?
Regards and Thanks.
Paul.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131773#4131773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131773
18 years, 1 month
[JBossWS] - Re: My WS doesn't send any attachment... why?
by cdc08x
Thank you Martin for your kind reply. I did appreciate it very much but...
Here is the new wrapper class:
| @XmlRootElement(name="Documenti")
| public class DocumentiDataList {
| @XmlMimeType("application/octet-stream")
| protected String dummy;
|
| @XmlElement(name="documenti")
| public List<DocumentoData> documenti;
|
| protected DocumentiDataList() {}
|
| public DocumentiDataList(List<DocumentoData> list) {
| this.dummy = "";
| this.documenti = list;
| }
| }
|
where DocumentoData is:
| @XmlRootElement(name="DocumentoData")
| public class DocumentoData {
| /**
| * Autore del documento.
| */
| @XmlAttribute(required=true)
| public String autore;
|
| /**
| * Data della creazione del documento.
| */
| @XmlAttribute(required=true)
| public Calendar dataCreazione;
|
| /**
| * Numero identificativo (chiave) del documento
| * <br />Deve essere univoco per ogni documento generato, e positivo.
| */
| @XmlElement(required=true)
| public int numeroDocumento;
|
| /**
| * Numero di protocollo del documento (attributo opzionale).
| * <br />Qualora presente, questo attributo deve essere univoco per tutti gli oggetti di questa classe.
| */
| @XmlElement(required=false)
| public Protocollo protocollo;
|
| /**
| * Nome del file.
| */
| @XmlElement(required=true)
| public String nomeFile;
|
| /**
| * Titolo del documento.
| */
| @XmlElement(required=true)
| public String titolo;
|
| /**
| * Descrizione del documento (attributo opzionale).
| */
| @XmlElement(required=false)
| public String descrizione;
|
| /**
| * Contenuto binario del documento (mappato come <em>SwAref</em>, allegato SOAP)
| */
| @XmlAttachmentRef
| public DataHandler file;
|
| // Costruttore richiesto da JAXB: impostandone l'accesso a "protected", si evita la trasposizione in XML-Schema
| protected DocumentoData() {}
|
| /**
| * Costruttore di istanze <code>DocumentoData</code>
| * @param autore Autore del documento
| * @param dataCreazione Data di creazione del documento
| * @param numeroDocumento Numero del documento
| * @param protocollo Protocollo del documento (puÃÂò essere <code>null</code>)
| * @param nomeFile Nome del file
| * @param titolo Titolo del file
| * @param descrizione Descrizione del contenuto (puÃÂò essere una stringa vuota)
| * @param data Handler dei dati fisici del file
| */
| public DocumentoData(String autore, Calendar dataCreazione,
| int numeroDocumento, Protocollo protocollo,
| String nomeFile, String titolo, String descrizione, DataHandler data) {
| this.autore = autore;
| this.dataCreazione = dataCreazione;
| this.numeroDocumento = numeroDocumento;
| this.protocollo = protocollo;
| this.nomeFile = nomeFile;
| this.titolo = titolo;
| this.descrizione = descrizione;
| this.file = data;
| }
| }
|
and this is the SessionBean's WebService method the client calls:
| public DocumentiDataList getDocumentiRichiestaAvvioPratica(int numeroIstanza,
| String settore, String natura)
| throws IllegalArgumentException {
| DocumentoData newDocumentoData = new DocumentoData(
| "Claudio Di Ciccio",
| new GregorianCalendar(),
| 14,
| null,
| "RichiestaAvvio.13.A2.1244.pdf",
| "Richiesta avvio procedimento - Settore Vincolo Idrogeologico - Allargamento pista camionabile",
| "Richiesta avvio procedimento",
| new DataHandler(new FileDataSource("/var/SemplificAZIONE/RichiestaAvvio.13.A2.1244.pdf")));
| List<DocumentoData> returnList = new ArrayList<DocumentoData>(2);
| returnList.add(newDocumentoData);
| returnList.add(newDocumentoData);
| return new DocumentiDataList(returnList);
| }
|
but the response is still:
| HTTP/1.1 200 OK
| Server: Apache-Coyote/1.1
| X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5
| Content-Type: text/xml;charset=UTF-8
| Date: Mon, 25 Feb 2008 09:11:13 GMT
| Connection: close
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header>
| </env:Header>
| <env:Body>
| <ns2:getDocumentiRichiestaAvvioPraticaResponse xmlns:ns2="http://www.provincia.latina.it/servizi/ws/PraticaStartWS">
| <documentiData>
| <dummy>
| </dummy>
| <documenti dataCreazione="2008-02-25T10:11:13.901+01:00" autore="Claudio Di Ciccio">
| <numeroDocumento>14</numeroDocumento>
| <nomeFile>RichiestaAvvio.13.A2.1244.pdf</nomeFile>
| <titolo>Richiesta avvio procedimento - Settore Vincolo Idrogeologico - Allargamento pista camionabile</titolo>
| <descrizione>Richiesta avvio procedimento</descrizione>
| <file>cid:0-1203930673914-19807859@ws.jboss.org</file>
| </documenti>
| <documenti dataCreazione="2008-02-25T10:11:13.901+01:00" autore="Claudio Di Ciccio">
| <numeroDocumento>14</numeroDocumento>
| <nomeFile>RichiestaAvvio.13.A2.1244.pdf</nomeFile>
| <titolo>Richiesta avvio procedimento - Settore Vincolo Idrogeologico - Allargamento pista camionabile</titolo>
| <descrizione>Richiesta avvio procedimento</descrizione>
| <file>cid:1-1203930673914-32990827@ws.jboss.org</file>
| </documenti>
| </documentiData>
| </ns2:getDocumentiRichiestaAvvioPraticaResponse>
| </env:Body>
| </env:Envelope>
|
I tried it, believe me, but it doesn't work.
Maybe it's because of the version? The running Application Server is:
JBoss AS 4.2.2.GA
with JBossWS / jbossws-native-2.0.1.SP2 bundled,
over Ubuntu Linux 7.10,
with Sun Java JDK 1.5.0_13 as the default JDK/JVM
Thank you very much, once again!!
Best regards,
Claudio
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131759#4131759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131759
18 years, 1 month