[Installation, Configuration & DEPLOYMENT] - Re: JBoss and Postgres on 2 machines
by mglowacki
I'm sorry, it's the machine with jboss, postgres is almost idle. I believe all important indexes have been set already, I have also reduced ejb usage. Earlier I had a problem with "no more connections available", but this is sorted out by replacing ejb with dao in most places. Now this.
it's really amazing, one machine (4xXeon Dual Core 2,6GHz and 8GB RAM, jboss using only 1,4) can handle jboss and postgres together better, than leaving postgres on this one and moving jboss to 2 Xeon Dual Cores 3GHz with 3,75 GB RAM.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136825#4136825
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136825
18 years, 1 month
[JCA/JBoss] - Completely confused JCA and Hibernate
by gsniderJBoss
My apologies. I've searched and searched. I'm confused about my current configuration for Hibernate.
Basically we use Hibernate.getCurrentSession() to 'get' and 'save' information. We have CMT and an XA-datasource configured.
Is Hibernate using any part of JCA for its work? (the example mysql-ds.xml was in the examples\jca directory). And if I want to use the WorkManager, what am I supposed to do? Is there some default RA to use with JBoss that already works with the WorkManager?
Here is the use case:
1) stateless EJB inserts a record into table A: (get the primary key from the insert)
2) asynchronously do some 'work' that will use the PK from step 1 to insert into child table B
The problem is
1) TX1 is created for the insert
2) TX2 is created by the WorkManager for the inserts into the child table B. But TX2 cannot see the changes made by TX1.
I can set the isolation level to read uncommited but that is ridiculous. I think TX1 and TX2 should be able to see the changes and act as a coordinated transaction.
It's just that this is trivial stuff and I can't imagine I need to write some RA just to do something this simple.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136821#4136821
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136821
18 years, 1 month
[Beginners Corner] - Local not bound
by tracker
I'm working on a my first custom servlet, and I'm making progress. I've looked at the posts of people who are rendering PDFs using iText directly, and the favorite design seems to be to tie the servlet to a URL using the web:context-filter tag in components.xml to let the servlet work inside Seam. I'm getting an error that I can't track down. Something to do with the servlet lifecycle, I suspect. The error looks like:
...
| Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: printServer
| at org.jboss.seam.Component.newInstance(Component.java:1962)
| at org.jboss.seam.Component.getInstance(Component.java:1865)
| at org.jboss.seam.Component.getInstance(Component.java:1832)
| 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.parser.AstValue.getTarget(AstValue.java:34)
| at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
| at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
| at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
| at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
| at javax.faces.component.UICommand.broadcast(UICommand.java:383)
| at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
| at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
| at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| ... 42 more
| Caused by: javax.naming.NameNotFoundException: local not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.seam.Component.instantiateSessionBean(Component.java:1279)
| at org.jboss.seam.Component.instantiate(Component.java:1265)
| at org.jboss.seam.Component.newInstance(Component.java:1958)
The servlet looks like:
@Name("printServer")
| @Stateless
| @Scope(ScopeType.CONVERSATION)
| public class PrintServer extends HttpServlet implements IPrintServer {
|
| private static final long serialVersionUID = 1278807414184735439L;
|
| @Logger
| private static Log log;
|
| public String test(String message) {
| log.info("Running printing test method", "Arg = " + message);
|
| return "Printing test message = " + message;
| }
|
| protected void doGet(HttpServletRequest request, HttpServletResponse response)
| throws ServletException, IOException
| {
| String path = request.getContextPath();
| log.info("Running doGet method: path: " + path);
|
| ServletOutputStream out = response.getOutputStream();
| out.println("<html><body><h1>Hello World! in doGet</h1></body></html>");
| }
|
| protected void service(HttpServletRequest request, HttpServletResponse response)
| throws ServletException, IOException {
| log.info("Running service method in Print Servlet");
|
| try {
| String path = request.getContextPath();
| log.info("Running service method: path: " + path);
|
| ServletOutputStream out = response.getOutputStream();
| out.println("<html><body><h1>Hello World! in service</h1></body></html>");
| }
| catch( Exception ex )
| {
| log.error( "PrintServer", ex.getMessage());
| }
| }
| }
And the page that invokes it looks like:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.org/rich"
| template="/layout/template.xhtml">
|
| <ui:define name="body">
|
| <h:messages globalOnly="true" styleClass="message"/>
|
| <rich:panel>
| <f:facet name="header">Printing test</f:facet>
| <h:form>
| <h:commandLink action="#{printServer.test('Hey Hey Kids')}" value="Print"/>
| </h:form>
| </rich:panel>
|
| </ui:define>
| </ui:composition>
Any helpful nudges in the right direction will be appreciated. In particular I've been trying to determine what "local not bound" means. Does Seam think local is a name that it needs to resolve? If so, I don't see where it's getting that from. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136799#4136799
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136799
18 years, 1 month