[Persistence, JBoss/CMP, Hibernate, Database] - Re: Multiple persistence units (one JTA one RESOURCE_LOCAL)
by bmcgovern
Mtedone1, I don't have an answer for you, but can you post your xml regarding JTA, I cannot get JTA working right on 4.2.0. Specifically I cannot seem to lookup TransactionManager from JNDI. I can get UserTransaction from JNDI, but when I do, the expected Transactional behavior simply doesn't work. THe system operates like there is no transaction running and i get partial commits.
Using UserTransaction I get a warning in the logs, but not an error : JTA cannot find TransactionManager, JTA will not be able to syncronize with existing JTA transactions.
So I think the root cause is something with JNDI and TransactionManger. Please paste your configs.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059376#4059376
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059376
15Â years, 11Â months
[JBossWS] - Intercepting SOAP message
by kkarthikeyankrr
Hi ,
This is karthick and i'm new to webservices.Can anyone tell me how to intercept the SOAP message in server and client side.I have done the SOAP message intercepting at server side by using handler.In this I have mentioned some information in my service.But I dont want like this I want to intercept with the help of deployment descriptor.I have downloaded many examples from net.so plz dont give me the link.Plz tel me whether I have to create the separate WSDD file for this or otherwise I can use my web.xml to configure those details(about handlers)? Then tell me where I have to keep that wsdd file.
My personal id:kkarthikeyankrr@gmail.com
Thanks&Regards
Karthick
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059366#4059366
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059366
15Â years, 11Â months
[JBoss Seam] - How does one @In(ject) a component from components.xml?
by gothmog
Hi,
I'm new to this but wouldn't have thought that this should proove to be so difficult.
I have a seam component that requires the services of a components.xml object that implements the interface called PaymentService.
Now when my seam app is deployed it recognizes the component as the following is output to the server console:
17:18:22,310 INFO [Component] Component: paymentService, scope: APPLICATION, type: JAVA_BEAN, class: second_seam.MockPaymentService
Now I wanted to use the payment services in my business object, so I did the following
..
@In(value="paymentService")
private PaymentService paymentService;
Thinking that seam would find the object called paymentService and inject it into my business component. But it can't:
First of all when I request a page that uses this buisness object, other properties on the object start reporting errors, like I've also got an expiryMonth field on the business object and seam reports this error relating to it
17:18:23,845 ERROR [STDERR] Jun 30, 2007 5:18:23 PM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/addcardPOJO.xhtml]
javax.faces.el.EvaluationException: /cardfieldsPOJO.xhtml @51,106 value="#{cardFundingPOJO.expiryMonth}": Exception getting value of property expiryMonth of base of type : second_seam.CardFundingPOJO_$$_javassist_44
And finally about three pages of stack trace you get..
17:18:23,874 ERROR [DebugPageHandler] redirecting to debug page
org.jboss.seam.RequiredException: In attribute requires non-null value: cardFundingPOJO.paymentService
at org.jboss.seam.Component.getValueToInject(Component.java:1919)
at org.jboss.seam.Component.injectAttributes(Component.java:1368)
at org.jboss.seam.Component.inject(Component.java:1195)
...
when I change the injection annotation to the following
@In(value="paymentService", required=false)
private PaymentService paymentService;
it works of course until I need to use the paymentService because its null in value. (i.e. I did this to proove that the one change was causing the errors on the monthExpiry field)
How does one simply inject a component from components.xml or is there another way to do this? (like I experimented with @Factory, but didn't have much luck with that either)
Seam 1.2.1
JBoss 4.0.5
Thanks
Troy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059364#4059364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059364
15Â years, 11Â months
[EJB 3.0] - Fail to lookup EJB3 as JBoss return internal IP
by dinnychk
Hi,
I wrote a HelloWorld EJB 3 and HelloClient to test remote access JBoss server, but failed as IP changed by firewall.
The server is linux and using JBoss 4.0.4.GA with jdk1.5.0_09.
I tried to start JBoss with "run.sh -c default -b <external IP>" , jboss cannot start with error :
anonymous wrote : 2007-06-30 21:16:12,840 ERROR [org.jboss.remoting.transport.socket.SocketServerInvoker] Error starting ServerSocket. Bind port: 3873, bind address: /202.155.230.102
| 2007-06-30 21:16:12,841 ERROR [org.jboss.remoting.transport.Connector] Error starting connector.
| java.net.BindException: Cannot assign requested address
| at java.net.PlainSocketImpl.socketBind(Native Method)
| at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
| at java.net.ServerSocket.bind(ServerSocket.java:319)
| at java.net.ServerSocket.(ServerSocket.java:185)
| at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:169)
| at org.jboss.remoting.transport.socket.SocketServerInvoker.createServerSocket(SocketServerInvoker.java:186)
| at org.jboss.remoting.transport.socket.SocketServerInvoker.start(SocketServerInvoker.java:136)
| at org.jboss.remoting.transport.Connector.start(Connector.java:316)
| 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:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at org.jboss.system.ServiceController.start(ServiceController.java:435)
| 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:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
|
then tried to start JBoss with "run.sh -c default -b <internal IP>" , then got below error
anonymous wrote : javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: <internal IP>; nested exception is:
| java.net.ConnectException: Connection timed out: connect]
EJB Source Code
| // HelloWorldBean.java
| package hi;
|
| import javax.ejb.Stateless;
|
| @Stateless(name="HelloWorld")
| public class HelloWorldBean implements HelloWorldRemote {
|
| public String sayHi (){
| System.out.println("sayHi");
| return "Hello world!";
| }
|
| }
| // HelloWorldRemote.java
| package hi;
|
| import javax.ejb.Remote;
|
| @Remote
| public interface HelloWorldRemote {
| public String sayHi ();
| }
|
Client Source code
| // main.java
| package helloclient;
| import hi.HelloWorldRemote;
| import java.sql.SQLException;
|
| public class Main {
| private static HelloWorldRemote helloRemote;
| public Main() {
| }
| public static void main(String[] args) throws SQLException {
| if( args.length > 0 )
| MyContext.setUrl(args[0]);
| try {
| helloRemote = (HelloWorldRemote) MyContext.lookup("HelloWorld/remote");
| System.out.println(helloRemote.sayHi());
| } catch( Exception e ) {
| System.out.println(e);
| }
| System.exit(0);
|
| }
|
| }
|
| // MyContext.java
| package helloclient;
|
| import java.util.Properties;
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
|
| public class MyContext
| {
| private static String url = "localhost:1099";
| private static Context context;
| private static MyContext uniqueInstance;
|
| private MyContext() throws NamingException {
| Properties props = new Properties();
| props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| props.setProperty("java.naming.provider.url", new String("jnp://" + getUrl()));
| props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
| context = new InitialContext(props);
| }
|
| public static Object lookup( String ejbName ) throws NamingException {
| if( uniqueInstance == null )
| uniqueInstance = new MyContext();
| System.out.println("getUrl " +getUrl());
| System.out.println("ejbName " + ejbName);
| System.out.println(context.toString());
|
| return context.lookup( ejbName);
| }
|
| public static MyContext getInstance() throws NamingException {
| if( uniqueInstance == null )
| uniqueInstance = new MyContext();
| return uniqueInstance;
| }
|
| public static String getUrl() {
| return url;
| }
|
| public static void setUrl(String aUrl) {
| url = aUrl;
| }
|
| }
|
|
|
Please help
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059363#4059363
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059363
15Â years, 11Â months