[JBossCache] - Re: PojoCacheListener fqn recovery
by mc.coder
Jason,
Thank you for your reply and sorry for the very late response. I have been (and still am :)) swamped.
I appreciate your adding this as a feature request. I have voted for it (hope others will too) and am watching it eagerly.
A couple of comments:
I tried the solution you proposed, and it does do what I want to an extent. Here is the test scenario.
I have one object nested within another, and a method on the enclosing object modifies the enclosed object (field) value. I modeled this as follows:
@Replicable
| protected class integer implements Serializable {
| private static final long serialVersionUID = 811409324986665055L;
| private int i;
| public integer(int i) {
| this.i = new Integer(i);
| }
| public integer add(int addend) {
| return new integer(this.i += addend);
| }
| public String toString() {
| return i + ": integer";
| }
| }
|
| @Replicable
| protected class IntegerWrapper implements Serializable {
| private static final long serialVersionUID = -6675820439881914329L;
| private integer value;
| public IntegerWrapper(int i) {
| value = new integer(i);
| }
| public void makeChange() {
| value.add(57);
| }
| public String toString() {
| return value + " wrapper";
| }
| }
I interpreted your suggested solution as the following:
private void showRealFQNFor(Event e) {
| BaseInterceptor interceptor = (BaseInterceptor) AopUtil.findCacheInterceptor(((Advised) e.getSource())._getInstanceAdvisor());
| Fqn internalFqn = interceptor.getFqn();
| PojoInstance pojoInstance = interceptor.getAopInstance();
| List<Fqn> fqns = pojoInstance.getReferences();
| System.out.println(fqns);
| }
First, I instantiate and add the enclosing object (IntegerWrapper) to a cache and I get the following attach notifications:
Node attached: org.jboss.cache.pojo.notification.event.AttachedEvent[source=0: integer]
| [/__JBossInternal__/root/child/0/_ID_/4l4o6a2l-99frc3-fa5q02ws-1-fa5q02ws-2]
| Node attached: org.jboss.cache.pojo.notification.event.AttachedEvent[source=0: integer wrapper]
| [/root/child/0]
Note that the fqn returned for the enclosing object is the internal representation (not useful for me) and the fqn of the enclosed object is the external representation of the enclosing object (this is what I need). I can achieve what I need for this event type even though I would have expected the fqn returned for the enclosing object to be the external representation.
Second, I call the method on the enclosing object (IntegerWrapper.makeChange) to modify the enclosed object and I get the following:
Field modified: org.jboss.cache.pojo.notification.event.FieldModifiedEvent[source=57: integer]
| [/__JBossInternal__/root/child/0/_ID_/4l4o6a2l-99frc3-fa5q02ws-1-fa5q02ws-2]
When I call the makeChange method on the enclosing object is the event generated has the enclosed object as it's source (which is fine) and the fqn returned is the external fqn of the enclosing object which does not allow me to retrieve the enclosing object (which does not give me what I need).
1) Have I interpreted your instructions incorrectly in my showRealFQNFor() method? I may well have since I don't think it matches up exactly with you description, but I didn't see a more obvious way using the 2.0.0.GA API.
2) If I did interpret your reply correctly, is there another way for me to solve my issue I have with the FieldModifiedEvent type?
3) To clarify what I think would be useful in relation to the feature request, it would be useful to retrieve the user created (external) fqn representation of the object added to the cache whenever any event type notification comes in for any objects enclosed within the object which was added to the cache.
Thanks, and sorry if this is long. Just wanted to include all the information.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112752#4112752
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112752
18 years, 4 months
[JBossWS] - JBoss Hanging on start up during Web Service ServletContext
by hopkinst
On my JBoss 4.2.2 Server I have two web services.
If I first start my JBoss server without either web service then deploy web service A. Then deploy web service B. The following runs (as intended).
Web Service B has a ContextInitialized piece that runs when it is deployed. Inside of Web Service B (which has already ingested via wsimport Web Service A prior to packaging as a WAR and deployment on the same server) an instance of web service A is created via service and port. Then a function in web service A is called, passed an object, and properly returns data (in this case a boolean).
Everything there runs as it is supposed to. The issue is that if I shut the server down and bring it back online with both of the Web Services (A and B) on the server the server will hang when it tries to create the instance of Web Service A inside the Servlet ContextInitialized section.
During start up web service A deploys properly and I can see its endpoints created. Then web service B deploys and after one println that tells me it is starting it tries to create the service and port for web service A and the server just hangs.
Does anyone have any idea what I've forgotten to do, or what the reason is that this will fail when the server is started and the web services are already deployed?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112745#4112745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112745
18 years, 4 months
[JBossCache] - Lock leaking on PojoCache 1.4.1
by sqian99
I have build an application using PojoCache 1.4.1 SP6/7 and the leaf node has a collection (HashSet) of objects. I need to frequently add/remove objects from the collection. But at high load, some removed objects only exist as _lock_: LOCK with no data attached. (See the object /2 under /transactions). Those phantom objects cannot be removed.
The Cache configuration is READ_COMMITTED for IsolationLevel and REPL_ASYNC for CacheMode and no eviction or passivation configured. Also LockParentForChildInsertRemove set to true.
When accessing the collection, threads use Iterator to remove the object and no synchronization is used when adding/removing objects from the collection. My questions are:
1) JBossCache is thread-safe, so I do not need to use synchronization when adding/removing objects from the collection, since those collection is proxy anyway, right?
2) Is there any way to remove those "_lock_: LOCK" entries?
Thanks
sqian99
/0
_lock_: LOCK
__jboss:internal:class__: class com.relayhealth.ch.rt.wscache.impl.SubmitterCacheNode
AOPInstance: org.jboss.cache.aop.AOPInstance@d74b31
fqn: /wsgway/INTERN/INTERN
/parent
__jboss:internal:class__: class com.relayhealth.ch.rt.wscache.impl.BillerCacheNode
AOPInstance: org.jboss.cache.aop.AOPInstance@89848d
/children
__jboss:internal:class__: class java.util.HashSet
AOPInstance: org.jboss.cache.aop.AOPInstance@5d4a62
/0
_lock_: LOCK
__jboss:internal:class__: class com.relayhealth.ch.rt.wscache.impl.UserCacheNode
AOPInstance: org.jboss.cache.aop.AOPInstance@be8e12
fqn: /wsgway/INTERN/INTERN/rteuser
/transactions
__jboss:internal:class__: class java.util.HashSet
AOPInstance: org.jboss.cache.aop.AOPInstance@6159c4
/2
_lock_: LOCK
/parent
__jboss:internal:class__: class com.relayhealth.ch.rt.wscache.impl.SubmitterCacheNode
AOPInstance: org.jboss.cache.aop.AOPInstance@182eca8
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112738#4112738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112738
18 years, 4 months
[JBoss Seam] - <transaction:ejb-transaction/> breaks icefaces file upload
by efbiaiinzinz
To be precise, icefaces file upload gets broken and possibly some other things too that we haven't experienced yet.
We use seam 2.0.0GA, icefaces 1.7DR#3 from svn, jsf 1.2 on glassfish v2
When uploading file, some odd exception of "EJB not found" is thrown.
I have posted full stacktrace already at icefaces forum at
http://www.icefaces.org/JForum/posts/list/6613.page
Example source
http://www.flamebox.org/fserver/soovexample.rar
Example ear package
http://www.flamebox.org/fserver/soov.ear
When executed, simple page is displayed where you can select file to upload, upload it, and also see the progress of the upload.
Ear has <transaction:ejb-transaction/> in components.xml
When I upload the file and icefaces component tries to send content to browser, exceptions
NRU-org.jboss.seam.transaction.EjbSynchronizations: Cannot load from BACKUPSTORE FOR Key: <3e90c03b00a81f-ffffffffd01e540c-1>
| EJB5018: An exception was thrown during an ejb invocation on [EjbSynchronizations]
| javax.ejb.NoSuchObjectLocalException: The EJB does not exist. session-key: 3e90c03b00a81f-ffffffffd01e540c-1
| at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:2400)
| at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1675)
| at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1229)
| at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195)
| at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
| at $Proxy218.afterTransactionBegin(Unknown Source)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
| at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
| at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
| at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
| at org.javassist.tmp.java.lang.Object_$$_javassist_0.afterTransactionBegin(Object_$$_javassist_0.java)
| at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:40)
| at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
| at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
| at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
| 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 com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:248)
| at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:299)
| at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
| at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
| at java.lang.Thread.run(Thread.java:619)
| uncaught exception
| java.lang.IllegalStateException: Could not start transaction
|
start to occur and also following stacktrace occurs
| Problem in renderResponse: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
| javax.faces.FacesException: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
| at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
| at com.icesoft.faces.renderkit.dom_html_basic.DomBasicInputRenderer.getValue(DomBasicInputRenderer.java:60)
| at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.getValue(DomBasicRenderer.java:156)
| at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(DomBasicRenderer.java:128)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
| at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:384)
| at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:92)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:374)
| at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:196)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
| at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:584)
| at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
| at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
| at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
| at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
| at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:320)
| at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
| at com.icesoft.faces.webapp.http.core.PageServer$1.respond(PageServer.java:25)
| at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:146)
| at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
| at com.icesoft.faces.webapp.http.core.PageServer.service(PageServer.java:30)
| at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:56)
| at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
| at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
| at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
| at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:117)
| at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:37)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
| at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
| at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:76)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
| at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
| at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
| at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
| at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
| at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
| at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
| at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
| at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
| at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
| at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
| at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
| at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
| Caused by: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
| ... 82 more
|
When I remove the <transaction:ejb-transaction/> from components.xml, file upload works correctly, when I add it, things stop working.
Is this seam related issue and how and if can I overcome the EJB not found exception and EJB being associated with incomplete transaction during upload ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112728#4112728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112728
18 years, 4 months