[JBoss Messaging] - Re: JMS Bridge Question
by timfox
In your remote jms provider, you are using the local JNDI namespace (java:) to do your lookup:
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.messaging:service=JMSProviderLoader,name=CSMJMSProvider">
| <attribute name="ProviderName">CSMJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
|
| <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
|
| <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
|
| <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
|
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=192.168.0.22:1099
| </attribute>
|
| </mbean>
|
In JNDI, "java:" means "in the same VM", for a remote jms provider you don't want to do the lookup in the same VM.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073979#4073979
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073979
18Â years, 11Â months
[JBoss Seam] - Re: Page refresh when hitting F5
by enrico256
Here is an extract of the code:
home.xhtml shows the list of items
<rich:dataTable id="items" value="#{items}" var="_item" >
| <rich:column>
| <s:link action="#{itemFinder.selectItem}" value="#{_item.id}"/>
| </rich:column>
| <rich:column>
| <h:outputText value="#{_item.title}" />
| </rich:column>
| <rich:column>
| <h:outputText value="#{_item.date}" >
| <f:convertDateTime pattern="dd.MM.yyyy" />
| </h:outputText>
| </rich:column>
| ....
| </rich:dataTable>
ItemFinderAction manages the data model and the selected item:
@Stateful
| @Name("itemFinder")
| @Scope(ScopeType.SESSION)
| public class ItemFinderAction implements ItemFinder {
|
| @PersistenceContext
| EntityManager em;
|
| @DataModel("items")
| List<Item> items;
|
| @DataModelSelection("items")
| @Out(required=false)
| Item item;
|
| @Factory("items")
| public void refresh() {
| items = em.createQuery("from Item i order by i.date asc").getResultList();
| }
|
| @Begin
| public String selectItem() {
| return "view_item";
| }
|
| @Remove @Destroy
| public void destroy() {
| }
| }
Upon item selection, the item is viewed in viewitem.xhtml:
<h:form id="viewItem">
| <h:panelGrid columns="2">
| <h:outputText value="Title"/>
| <h:outputText value="#{item.title}"/>
| <h:outputText value="Date"/>
| <h:outputText value="#{item.date}"/>
| ...
| </h:panelGrid>
| ...
| <s:link action="#{itemEditor.beginUpdate}"value="Update" />
| ....
| </h:form>
|
ItemEditorAction manages the creation and update of items:
@Stateful
| @Name("itemEditor")
| public class ItemEditorAction implements ItemEditor {
|
| @In(required=false)
| User user;
|
| @In(required=false) @Out(required=false)
| Item item;
|
| @PersistenceContext
| EntityManager em;
|
| @Begin
| public String beginRegister() {
| item = new Item();
| item.setDate(new Date());
| item.setNew(true);
| return "edit_item";
| }
|
| public String endRegister() {
| em.persist(item);
| refreshItems();
| return "success";
| }
|
| public String beginUpdate() {
| item.setNew(false);
| return "edit_item";
| }
|
| public String endUpdate() {
| em.merge(item);
| refreshItems();
| return "success";
| }
|
| @Remove @Destroy
| public void destroy() {
| }
|
| private void refreshItems() {
| Events.instance().raiseEvent("loadItems");
| }
| }
loadItems is defined in compontents.xml as
<event type="loadItems">
| <action expression="#{itemFinder.refresh}"/>
| </event>
Creation and update is done through the following xhtml page:
<h:form id="register">
| <rich:panel>
| <f:facet name="header">
| <h:panelGroup>
| <h:outputText value="New item" rendered="#{item.new}"/>
| <h:outputText value="Item #{item.id}" rendered="#{!item.new}"/>
| </h:panelGroup>
| </f:facet>
| <h:panelGrid columns="2">
| <h:outputText value="Title" />
| <h:inputText value="#{item.title}" size="100" maxlength="100"/>
| ...
| </h:panelGrid>
| <h:commandButton action="#{itemEditor.endRegister}" value="Save" rendered="#{item.new}"/>
| <h:commandButton action="#{itemEditor.endUpdate}" value="Save" rendered="#{!item.new}" />
| <s:button action="/home.xhtml" value="Cancel" rendered="#{item.new}" propagation="end" />
| <s:button action="/viewitem.xhtml" value="Cancel" rendered="#{!item.new}" />
| </rich:panel>
| </h:form>
|
Item is defined as
@Entity
| @Name("item")
| @Table(name="ITEMS")
| public class Item implements Serializable {
| private static final long serialVersionUID = 1L;
| private long id = 0L;
| private String title;
| private Date date;
| private boolean new;
| //... setters and getters
| @Transient boolean isNew() {
| return new;
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073973#4073973
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073973
18Â years, 11Â months
[JBoss Seam] - questions about jboss embedded warns
by Stateless Bean
Hi,
Finally i run my jboss embedded on tomcat 6.0, but im warring about few warns. Can anybody explain me this
anonymous wrote :
| JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE.
| Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
| Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
|
i added transaction isolation to my project-ds.xml like
anonymous wrote : <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>
|
but don't know why still I get this warning? maybe for tomcat, transaction isolation should be in some other place?
anonymous wrote :
| (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
| WARN 14-08 14:07:53,656 (JBossTimerServiceFactory.java:restoreTimerService:112) -TIMER SERVICE IS NOT INSTALLED
|
Why I get twice timmer service warn?
anonymous wrote :
| WARN 14-08 14:08:08,515 (Component.java:checkScopeForComponentType:351) -Stateful session beans was bound to the APPLICATION context - note that it is not safe to make concurrent calls to the bean: collectionControler
|
what this means?
and finally what this means?
anonymous wrote :
| WARN 14-08 14:06:56,406 (UnifiedLoaderRepository3.java:addClassLoader:675) -Tried to add non-URLClassLoader. Ignored
| WARN 14-08 14:06:59,937 (TxControl.java::266) -[com.arjuna.ats.arjuna.coordinator.TxControl_1] - Name of XA node not defined. Using 531e3530:e99:46c19ae3:0
| WARN 14-08 14:07:08,359 (JDBCPersistenceManager.java:start:143) -
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073960#4073960
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073960
18Â years, 11Â months