[JBoss Portal] - Re: Packaging of portlet-instances.xml
by julienï¼ jboss.com
If you write an MBean, the best way is to inject it into your MBean using :
| <mbean ...>
| ...
| <depends
| optional-attribute-name="InstanceContainer"
| proxy-type="attribute">portal:container=Instance</depends>
| ...
| <mbean>
|
If you want to do that from a Portlet component, you can inject an MBean service into the servlet context attributes and then make a lookup from the PortletContext. In that case you need to have in your jboss-portlet.xml :
| <portlet-app>
| ...
| <service>
| <service-name>InstanceContainer</service-name>
| <service-class>org.jboss.portal.core.model.instance.InstanceContainer</service-class>
| <service-ref>:container=Instance</service-ref>
| </service>
| ...
| </portlet-app>
|
then in your portlet you can do, usually best placed into the init() method :
| InstanceContainer container = (InstanceContainer)getPortletContext().getAttribute("InstanceContainer");
|
If you do use portal services, you should also declare the transactional attribute in jboss-portlet.xml that will propagate the portal transaction to the portlet or create a new one like :
| <portlet>
| <portlet-name>MyPortlet</portlet-name>
| <transaction>
| <trans-attribute>Required</trans-attribute>
| </transaction>
| </portlet>
|
or
| <portlet>
| <portlet-name>MyPortlet</portlet-name>
| <transaction>
| <trans-attribute>RequiresNew</trans-attribute>
| </transaction>
| </portlet>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011305#4011305
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011305
19Â years, 2Â months
[JNDI/Naming/Network] - JMXInvokerServlet invoked by a standalone program
by msadoun
Hi,
I've been searching in different forums, i can?t found anybody who already met the following issue:
I got connection refused when i invoke the JMXInvokerServlet remotely from a standalone application in JBoss/Tomcat bundle 4.0.5 behind Apache 2.0 using mod_jk 1.2.20.
I need to access JBoss ejb tier through http avoiding rmi calls. The following tests j've made run locally on Windows xp environment , and remotely on Redhat Lunix.
The application is downloaded and deployed through java Web Start and uses JNDI over http provided by http-invoker.sar to access the server. Within jnlp file, all resources come from the same server.
I?m using mod_jk configuration exactly as described at http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss and my uriworkermap.properties contains:
/invoker=loadbalancer
/invoker/*=loadbalancer
The application works fine on the localhost with the following jndi.properties:
java.naming.factory.initial=org.jboss.naming.HttpNamingContextFactory
java.naming.provider.url=http://localhost/invoker/JNDIFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
and with the jboss-service configuration snippet code of the HTTP invoker service:
<attribute name=InvokerURLPrefix>http:// < /attribute>
<attribute name=InvokerURLSuffix>/invoker/JMXInvokerServlet < /attribute>
Also, every thing goes well when accessing directly and remotely JBoss/Tomcat by shunting Apache+mod_jk using:
- java.naming.provider.url=http://www.mydomain.com:8080/invoker/JNDIFactory
and
- <attribute name=InvokerURLSuffix>:8080/invoker/JMXInvokerServlet < /attribute>
But i got connection refused when accessing JBoss/Tomcat remotely through Apache, and mod_jk with the following:
- java.naming.provider.url=http://lwww.mydomain.com/invoker/JNDIFactory
and
- <attribute name=InvokerURLSuffix>/invoker/JMXInvokerServlet < /attribute>
see message below.
I can't figure out what's wrong or missing, any help will greatly be appreciated.
Thanks.
Alain
Caused by: java.rmi.ServerException: IOE; nested exception is:
java.net.ConnectException: Connection refused: connect
at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.naming.interceptors.ExceptionInterceptor.invoke(ExceptionInterceptor.java:42)
... 34 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at org.jboss.invocation.http.interfaces.Util.invoke(Util.java:145)
at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:103)
... 37 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011298#4011298
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011298
19Â years, 2Â months
[JBossWS] - Architecture question
by rlamie
Hello,
I'd know your point of view of the current needs expressed by a customer of mine.
>From an existing workflow engine (JBoss jBPM), he'd like to consume web services from another company (so-called A). Moreover, the company A could call our own web services (not yet implemented), as a delayed response to our own calls.
I imagine the following strategy :
Company A <------ws-------> Application X to be developped <---------> JBoss jBPM
My questions :
- Application X should be isolated as a sort of gateway application ?
- What is the best choice :
1/ Application X is a simple webapp with any soap stacks (xfire, jax-ws 2.1, ...). Communication between Application X and JBoss jBPM is based on web service
2/ Application X is an ejb application (jBoss), and then, the application must(?) rely on jBoss WS. Communication between Application X and jBoss JBPM is based on remote ejbs.
3/ does jBoss support jax-ws 2.1 ?
Thank you a lot for your support.
R.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011296#4011296
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011296
19Â years, 2Â months
[JBoss Messaging] - DO i need to start jboss AS necessarily to implement Jboss M
by miryaver
HI,
i am developing a client application to implement JBossMQ JMS. i also have jboss4.2 on my system. IN my client application i have included all the jars necessary.
I can run the application and get desired results whn JBoss app server is running.But when i shut the JBoss application server i get the following error
Exception in thread "main" javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1302)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1382)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at src.Client.main(Client.java:30)
Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)
at java.net.DatagramSocket.receive(DatagramSocket.java:712)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1272)
... 5 more
Does it mean running JBoss app server is mandatory.Is there any other way where i can do my example without running jboss App server or running only JBoss MQ feature of Jboss (not whole app server).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011295#4011295
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011295
19Â years, 2Â months
[Beginners Corner] - EJB pooling
by lovelyliatroim
Hi Folks,
Just a quick question about pooling in relation to stateless EJBS. Im having problem finding out where to it goes. Ive seen a snippet of xml that goes into standardjboss.xml and looks like this below but i dont think it is what i am looking for. All i want to do is create a pool of 50 beans at startup for a particular bean type!! Also tried looking at the xdoclet tags tp see where the property is for this and can not find it, can you configure this using xdoclet?? if so, how??
Appreciate any help!!
LL
| <container-configuration>
| <container-name>Standard CMP 2.x EntityBean</container-name>
| <call-logging>false</call-logging>
| <invoker-proxy-binding-name>entity-rmi-invoker</invoker-proxy-binding-name>
| <sync-on-commit-only>false</sync-on-commit-only>
| <insert-after-ejb-post-create>false</insert-after-ejb-post-create>
| <call-ejb-store-on-clean>true</call-ejb-store-on-clean>
| <container-interceptors>
| <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
| <interceptor>org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
| <interceptor metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor<
| /interceptor>
| <interceptor>org.jboss.ejb.plugins.EntityCreationInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.EntityLockInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.EntityInstanceInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.EntityReentranceInterceptor</interceptor>
| <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor<
| /interceptor>
| <interceptor>org.jboss.ejb.plugins.EntitySynchronizationInterceptor</interceptor>
| <interceptor>org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor</interceptor>
| </container-interceptors>
| <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
| <instance-cache>org.jboss.ejb.plugins.InvalidableEntityInstanceCache</instance-cache>
| <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
| <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
| <container-cache-conf>
| <cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>
| <cache-policy-conf>
| <min-capacity>50</min-capacity>
| <max-capacity>1000000</max-capacity>
| <overager-period>300</overager-period>
| <max-bean-age>600</max-bean-age>
| <resizer-period>400</resizer-period>
| <max-cache-miss-period>60</max-cache-miss-period>
| <min-cache-miss-period>1</min-cache-miss-period>
| <cache-load-factor>0.75</cache-load-factor>
| </cache-policy-conf>
| </container-cache-conf>
| <container-pool-conf>
| <MaximumSize>100</MaximumSize>
| </container-pool-conf>
| <commit-option>B</commit-option>
| </container-configuration>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011290#4011290
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011290
19Â years, 2Â months