[JBossCache] - Re: uninitialized nodes
by aditsu
Thanks for the updates and sorry for messing up the jira issue
"manik.surtani(a)jboss.com" wrote :
| This is not entirely correct since even when you first put a node in the cache, it does need to (try and) load it from the cache loader in case it is not really a new node but one that was evicted.
|
Why should it load it when I put? It doesn't even do that currently.
"manik.surtani(a)jboss.com" wrote :
| Doing a put(node, key, value) is expected to return the old value under that key and hence the need to load.
|
I didn't put(node, key, value), but put(fqn, map). And it didn't load it from the cacheloader, until I tried to "get" something. I guess it did that because it thinks it should merge the map I gave it with the existing data. I need a way to tell it "just put this data and don't load anything". It should also not write that data to the cacheloader (this is yet another issue, I used a workaround for that too). The ultimate goal is to do my own optimized preloading of data from a database.
I wonder if the way to solve it is to have another "special" method like putForExternalRead. Anyway, as I said, my program works now with a cache listener and no cache loader. That will only run into problems if not all the data is present in the cache all the time.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063797#4063797
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063797
19Â years
[JBoss Seam] - Re: Using stateless beans generated by seam in standalone Ja
by JbossDing
Thanks for the reply and code example. But I thought the code generated by seam-gen is not ejb (please refer to my above first message). I am very shallow on seam so far. When I follow the seam tutorial of the Registration example, everything is making sense, like you will code the session bean with annotation @stateless and entity bean with @entity. What's more, there is a ejb-jar.xml for deployment descriptor and each bean has remote methods that client can call, for example method register().
However, if you look closely at the generated code as I posted above, for table host, seam-gen generated 2 java files in src/Action folder, which I think should be where session beans are. They HostHome.java and HostList.java. By looking at those code closely, they do not have annotation @stateless or @entity. What is more, I do not know what remote methods will execute CRUD operations. For example, in HostHome.java, it has setHostId, getHostId, isWired, wire, getDefinedInstance. If I need to update the records, what remote method to call?
I am not very familiar with JPA. I thought the code you put in the last message is for client to use JPA to query database. That is terrific. However, because seam-gen generated data-access layer codes like session bean and entity beans, I would like to be lazy and use the generated codes in client directly.
After a little reading of seam, it occurs to me that seam-gen generated data-access code in src/Action folder is not suitable for direct call from a standalone java application. Please correct me if I am wrong. I really need some jboss seam guru to tell me if there is a way for standalone java client (replacing jsf) to reuse seam-gen generated data-access codes. seam-gen is great, but it's just too mysterious for me to us in a not so usual way.
Thanks for your attention nd help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063788#4063788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063788
19Â years
[JBoss jBPM] - how to programatically set jdbc connection string for hsqldb
by tjcroteau
Hi,
I am very new to jbpm and trying to programatically set the hsdqldb connection string instead of using the defaults set in hibernate.cfg.xml. All of the defaults in the hibernate config file are acceptable with the exception of the jdbcconnection string (I need to construct the location of the database at runtime).
I'm using the below code where connection is a javax.sql.Connection that has been populated with the jdbc connection string.
| JbpmContext jbpmContext = Jbpmconfiguration.getInstance().createJbpmContext();
| jbpmContext.setConnection(connection);
|
I thought that interjecting the setConnection into the context would override the jdbc connection string that is in the hibernate.cfg.xml file (based upon the jbpm chapter on persistence). However, the jbpm instance that is starting up is still using the jdbc connect string from the config file instead of the one that is passed into setConnection.
I would appreciate any help or thoughts.
Tammy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063783#4063783
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063783
19Â years
[Clustering/JBoss] - Home and component interface references in clustered JBoss
by Alenaal
Hi all,
I have a questions about home or component interface references in clustered JBoss, about how they are saved, replicated and managed. They always say "try it" so I wrote a small example to illustrate my point. Basically my question is about how and why home, component and local home references work in clustered JBoss. I would very much appreciate an expert opinion. Below is my example. Many thanks to you all in advance.
I run JBoss 4.0.5 as a cluster (I put apache with mod_jk) on two boxes, say box1, box2 which makes two nodes: node1, node2 respectively and I use farming to deploy my ejbs. So I put myEjb.jar into farm on node1 and it get distributed to node2
I enabled a NON-sticky approach (just a test to illustrate my question and be able later on to go to another server that does not support sticky) so requests go a box1/box2/box1.... in a round-robin manner.
The call is like this JSP -> servlet -> SFSB. I am testing this Stateful Session Bean (let's call it AddressManagerHome). It is a facade for two other stateful beans (it is just a test to illustrate my question). Servlet gets reference to component interface of the bean and stores it into the request.
For this particular test my SFSB has 3 instance variables (here they are just to make things clear)
protected AddressHome addressHome = null; (reference to home interface)
protected Address address = null; (reference to component interface)
protected WorkAddressLocalHome workAddressHome = null; (reference to local home interface)
they are all initialized in ejbCreate of the bean. So I create bean in the servlet like this
public class AddressManagerServlet extends HttpServlet {
....
AddressManagerHome home = (AddressManagerHome) ServiceLocator.getInstance().getRemoteHome(.....);
AddressManager bean = home.create();
bean.testAll()
....
where testAll() does 3 things:
1. for home reference (addressHome) it creates component interface and calls method :
Address bean = addressHome.create();
bean.test();
2. for component reference (address) it just calls method :
address.test();
3. for local home interface it creates home component reference and calls method :
WorkAddressLocal bean = workAddressHome.create();
bean.test();
Now, the 1st request goes to node1 and everything works fine. Then 2nd request (same session, I use encodeURL) goes to node2 and everything is fine again. WHY????
I understand why case N1 is fine, we just have reference to remote home so no problem there but why in case N2 it is fine? If we created ejbObject on node1 and then call it from node2? How is node2 even aware of address bean being created earlier in node1?? Shouldn't it say I have no idea, create reference to component interface again?
And why is case N3 is fine? It is a reference to local to home. Which is by definition local to VM ! So if WorkAddressLocalHome is created in node1 then node2 should have no idea what it is. So how does exactly clustering in JBoss work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063782#4063782
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063782
19Â years
[JBoss jBPM] - How to use TomaHawk with JBPM?
by gsccnu
I want use Tomahawk's compnents.
My .xhtml is :
<html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:c="http://java.sun.com/jstl/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:tf="http://jbpm.org/jsf/tf"
| xmlns:jbpm="http://jbpm.org/jsf"
| xmlns:t="http://myfaces.apache.org/tomahawk">
|
| <ui:component>
|
| <jbpm:dataform>
|
| <f:facet name="header">
| <h:outputText value="#{taskName}"/>
| </f:facet>
|
| <!-- TASKFORM ROWS -->
| <jbpm:datacell>
| <f:facet name="header">
| <h:outputText value="date"/>
| </f:facet>
| <t:inputCalendar id="secondOne" monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" popupButtonStyleClass="standard_bold"
| currentDayCellClass="currentDayCell" value="#{var['date']}" renderAsPopup="true"
| popupTodayString="Today"
| popupDateFormat="MM/dd/yyyy" popupWeekString="WK"
| helpText="MM/DD/YYYY"
| forceId="true"/>
| </jbpm:datacell>
| .............................
But when i try to Examine ,i get a error as follow
com.sun.facelets.FaceletException: Error Parsing /2/task.xhtml: Error Traced[line: 28] Invalid byte 1 of 1-byte UTF-8 sequence.
| com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
| com.sun.facelets.compiler.Compiler.compile(Compiler.java:105)
| com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:197)
| com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:293)
| com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:240)
| org.jbpm.jsf.core.handler.IncludeProcessFileHandler.apply(IncludeProcessFileHandler.java:88)
| com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
| com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
| com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
| com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
| com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
| com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
| com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
| com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
| com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
| com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
| com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
| com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58)
| com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128)
| com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306)
| com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279)
| com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
| com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
| com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
| com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
| com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
| com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
| com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
| com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
| com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
| com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
| com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
| com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
| com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
| com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
| com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
| com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
| com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:546)
| javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:178)
| com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
| com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
How can i do?
THANKS a lot
GS
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063781#4063781
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4063781
19Â years