[EJB 3.0] - Why is Remote Interface not installed
by baumar
Hi,
I created a remote interface:
| @Remote
| public interface PersonHandlerRemote {
|
| public abstract void addPerson(Person person);
| public abstract void printAllPerson(String message);
| public abstract void deletePerson(Person person);
|
Then I created a stateful session bean using it:
...
| @Stateful
| @Remote(com.informationcontrol.forumorganizer.person.PersonHandlerRemote.class)
| public class PersonHandlerBean implements PersonHandlerRemote {
| @PersistenceUnit(unitName="gw03")
| ...
|
and added a META-INF with persistence.xml
...
<persistence-unit name="gw03">
<jta-data-source>java:DefaultDS</jta-data-source>
</persistence-unit>
...
(created with eclipse 3.2)
Then I export it through a jar to JBoss 404. I checked the jar in /deploy, it contains the session bean, the remote interface and META-INF/persistence.xml but the Remote Interface cannot be found through the lookup. I checked in the JMX-console, it is not there:
+- PersonHandlerBean (class: org.jnp.interfaces.NamingContext)
| +- remote (class: java.lang.Object)
| +- remoteStatefulProxyFactory (proxy: $Proxy82 implements interface org.jboss.ejb3.ProxyFactory)
Can anybody tell me what could be wrong?
Thanks
Markus
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147085#4147085
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147085
17 years, 11 months
[Messaging, JMS & JBossMQ] - Creating New Connection Factory
by nitinmandolkar
Hi All
The default connection factory name in jbos is ConnectionFactoty, java:/ConnectionFactory, XAConnectionFactory and java:/XAConnectionFactory.
So when ever i need to connect JBOSS JMS Server my client code need to look for above name in JNDI. Sample code below...
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("java:/ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
With above code block my example is working fine with out any problem.
Due to old code base i can not use default Connection factory name provided by JBOSS. I am intrest to give my name to connection factory. So in search of that i did some change in jms-ds.xml as below.
<!--
DefaultJMSProvider
org.jboss.jms.jndi.JNDIProviderAdapter
<!-- The combined connection factory -->
java:/MyConnectionFactory
<!-- The queue connection factory -->
java:/MyConnectionFactory
<!-- The topic factory -->
java:/MyConnectionFactory
<!-- Uncomment to use HAJNDI to access JMS
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1100
-->
-->
After doing this change in jms-ds.xml file i change the above code block like this. Now i am looking for "MYConnectionFactory" rather than "ConnectionFactory".
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("java:/MyConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
Doing this change i am excepting it shoud work. but i am getting following error. Can one tell me where i can define new connection factory in JBOSS 4.2.2 GA and how.
Exception i am getting :
====================
run-example1p2p:
[java] [INFO,SendRecvClient] Begin SendRecvClient, now=1209322015968
[java] [INFO,SendRecvClient] Begin sendRecvAsync
[java] Exception in thread "main" javax.naming.NameNotFoundException: MyCon
nectionFactory not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.jav
a:294)
[java] at sun.rmi.transport.Transport$1.run(Transport.java:153)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
[java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTranspor
t.java:466)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPT
ransport.java:707)
[java] at java.lang.Thread.run(Thread.java:595)
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServe
r(StreamRemoteCall.java:247)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCa
ll.java:223)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:66
7)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:62
7)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:351)
[java] at org.jboss.book.jms.ex1.SendRecvClient.setupPTP(SendRecvClient
.java:56)
[java] at org.jboss.book.jms.ex1.SendRecvClient.sendRecvAsync(SendRecvC
lient.java:72)
[java] at org.jboss.book.jms.ex1.SendRecvClient.main(SendRecvClient.jav
a:104)
[java] Java Result: 1
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147080#4147080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147080
17 years, 11 months
[Beginners Corner] - Jboss 4.0.5 seems to hang up if not accessed for a while
by cjensen
I am a newbie. I am trying to deploy a Jboss application into production on a Linux server. It seems to be working OK on a Windows box. If we deploy the application, we can access it just fine. If it 'sits' for a while (an hour or so; sometimes longer, sometimes less), it seems to go into a comma. By that, I mean when we try to access the home page, we get an error such as "The website address you entered could not be found". When I do a netstat -d -p on the linux box, I can see that Jboss is listening on the http and https ports, but it is like it is not answering. If I logon to the linux box and telnet to the the box on port 80, I get a 'connection refused', but then, the website can be accessed again. It is like the telnet wakes it up, or otherwise clears the problem. Any suggestions would be appreciated. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147079#4147079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147079
17 years, 11 months