Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JBoss with EJB

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am running simple EJB program in JBoss3x with Tomcat,
for deploying i did manually, like jar -cvf test.jar -c. .
then it creates the jar file then I opend that jar file
using jar -tvf test.jar then it shows all ejb classes
and META-INF files like ejb-jar.xml and jboss.xml.
after that i put that jar into jboss\server\default\deploy.
then I ran JBoss application server, it was saying
deploy fail. so how can I deploy a EJB Component exactly
any one could explain me, what that things i did wrong and
suggest the correct ptrocedure.
Thanx
Fyrose.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The deployment procedure is specific to JBoss. Try jboss.org or our JBoss forum.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, you should also give a bit more info than "deploy fail"...
 
Ahamed Firoz
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
Oh, you should also give a bit more info than "deploy fail"...


Hi,
Thats my complete info.about simpe EJB using jboss-3.2.1_tomcat-4.1.24 and
JBuilder8 editor.
I want to test a simple stateless session bean
so I developed 3 ejb classes.
I created directory structure like
c:>cd fyrose\classes
i put all 3 classes in classes dirctory.
then I created another dirctory
c:> cd fyrose\META-INF
I put ejb-jar.xml and jboss.xml on that directory.
Then I create Jar like
c:> cd fyrose here I set the java path for jar.
c:> cd fyrose> jar -cvf test.jar -c. .
then it showing like
-c. : no such file or directory
added manifest
adding: ejbclient/(in = 0) (out= 0)(stored 0%)
adding: ejbclient/ClientEJBBean.class(in = 1082) (out= 492)(deflated 54%)
adding: ejbclient/ClientEJBHome.class(in = 277) (out= 187)(deflated 32%)
adding: ejbclient/ClientEJBRemote.class(in = 243) (out= 180)(deflated 25%)
ignoring entry META-INF/
adding: META-INF/ejb-jar.xml(in = 569) (out= 256)(deflated 55%)
adding: META-INF/jboss.xml(in = 710) (out= 313)(deflated 55%)

then i saw all files in jar
c:>fyrose>jar -tvf test1.jar
0 Thu Aug 14 10:50:04 CEST 2003 META-INF/
68 Thu Aug 14 10:50:04 CEST 2003 META-INF/MANIFEST.MF
0 Mon Aug 11 19:10:58 CEST 2003 ejbclient/
1082 Mon Aug 11 18:55:24 CEST 2003 ejbclient/ClientEJBBean.class
277 Mon Aug 11 18:55:28 CEST 2003 ejbclient/ClientEJBHome.class
243 Mon Aug 11 18:55:28 CEST 2003 ejbclient/ClientEJBRemote.class
569 Mon Aug 11 19:02:06 CEST 2003 META-INF/ejb-jar.xml
710 Tue Aug 12 17:18:16 CEST 2003 META-INF/jboss.xml
then I copy that jar file then I put into JBoss\server\default\deploy
once I start JBoss application server like
c:> cd jboss\bin> run.bat
11:06:02,984 INFO [Engine] WebappLoader[/jmx-console]: Deploy JAR /WEB-INF/lib/
jboss-jmx.jar to C:\JBoss\server\default\deploy\jmx-console.war\WEB-INF\lib\jbos
s-jmx.jar
11:06:03,437 INFO [Engine] ContextConfig[/jmx-console]: Added certificates -> r
equest attribute Valve
11:06:03,531 INFO [EmbeddedCatalinaService41] Using Java2 parent classloader de
legation: true
11:06:03,531 INFO [Engine] StandardManager[/jmx-console]: Seeding random number
generator class java.security.SecureRandom
11:06:03,531 INFO [Engine] StandardManager[/jmx-console]: Seeding of random num
ber generator has been completed
11:06:03,531 INFO [Engine] StandardWrapper[/jmx-console efault]: Loading conta
iner servlet default
11:06:03,531 INFO [Engine] StandardWrapper[/jmx-console:invoker]: Loading conta
iner servlet invoker
11:06:03,546 INFO [MainDeployer] Deployed package: file:/C:/JBoss/server/defaul
t/deploy/jmx-console.war/
11:06:03,546 INFO [MainDeployer] Starting deployment of package: file:/C:/JBoss
/server/default/deploy/jms/
11:06:03,546 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jbossmq-destinations-service.xml
11:06:03,546 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jbossmq-httpil.sar/
11:06:03,546 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jbossmq-service.xml
11:06:03,546 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jms-ds.xml
11:06:03,546 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jms-ra.rar
11:06:03,562 INFO [SARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
11:06:03,625 INFO [RARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/tmp/deploy/server/default/deploy/jms/jms-ra.rar/39.jms-ra.rar-contents/jms-ra.
jar
11:06:03,640 INFO [XSLSubDeployer] transformed into doc: [#document: null]
11:06:03,734 INFO [JMSProviderLoader] Creating
11:06:03,734 INFO [JMSProviderLoader] Created
11:06:03,734 INFO [ServerSessionPoolLoader] Creating
11:06:03,734 INFO [ServerSessionPoolLoader] Created
11:06:03,734 INFO [RARDeployment] Creating
11:06:03,734 INFO [RARDeployment] Created
11:06:03,734 INFO [JBossManagedConnectionPool] Creating
11:06:03,734 INFO [JBossManagedConnectionPool] Created
11:06:03,734 INFO [TxConnectionManager] Creating
11:06:03,734 INFO [TxConnectionManager] Created
11:06:03,984 INFO [MessageCache] Creating
11:06:03,984 INFO [MessageCache] Created
11:06:03,984 INFO [PersistenceManager] Creating
11:06:03,984 INFO [PersistenceManager] Created
11:06:03,984 INFO [CacheStore] Creating
11:06:03,984 INFO [CacheStore] Created
11:06:03,984 INFO [DynamicStateManager] Creating
11:06:03,984 INFO [DynamicStateManager] Created
11:06:03,984 INFO [DestinationManager] Creating
11:06:04,000 INFO [DestinationManager] Created
11:06:04,015 INFO [A] Creating
11:06:04,015 INFO [A] Created
11:06:04,015 INFO Creating
11:06:04,015 INFO Created
11:06:04,015 INFO [C] Creating
11:06:04,015 INFO [C] Created
11:06:04,015 INFO [D] Creating
11:06:04,015 INFO [D] Created
11:06:04,015 INFO [ex] Creating
11:06:04,015 INFO [ex] Created
11:06:04,015 INFO [SecurityManager] Creating
11:06:04,015 INFO [SecurityManager] Created
11:06:04,015 INFO [testTopic] Creating
11:06:04,015 INFO [testTopic] Created
11:06:04,015 INFO [securedTopic] Creating
11:06:04,015 INFO [securedTopic] Created
11:06:04,015 INFO [testDurableTopic] Creating
11:06:04,015 INFO [testDurableTopic] Created
11:06:04,015 INFO [testQueue] Creating
11:06:04,015 INFO [testQueue] Created
11:06:04,015 INFO [InterceptorLoader] Creating
11:06:04,015 INFO [InterceptorLoader] Created
11:06:04,031 INFO [Invoker] Creating
11:06:04,031 INFO [Invoker] Created
11:06:04,031 INFO [HTTPServerILService] Creating
11:06:04,031 INFO [HTTPServerILService] Created
11:06:04,031 INFO [JVMServerILService] Creating
11:06:04,031 INFO [JVMServerILService] Created
11:06:04,031 INFO [RMIServerILService] Creating
11:06:04,031 INFO [RMIServerILService] Created
11:06:04,031 INFO [OILServerILService] Creating
11:06:04,031 INFO [OILServerILService] Created
11:06:04,031 INFO [UILServerILService] Creating
11:06:04,031 INFO [UILServerILService] Created
11:06:04,031 INFO [OIL2ServerILService] Creating
11:06:04,031 INFO [OIL2ServerILService] Created
11:06:04,031 INFO [UILServerILService] Creating
11:06:04,031 INFO [UILServerILService] Created
11:06:04,031 INFO [DLQ] Creating
11:06:04,031 INFO [DLQ] Created
11:06:04,093 INFO [EmbeddedCatalinaService41] deploy, ctxPath=/jbossmq-httpil,
warUrl=file:/C:/JBoss/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpi
l.war/
11:06:04,125 INFO [Engine] WebappLoader[/jbossmq-httpil]: Deploying class repos
itories to work directory C:\JBoss\server\default\tmp\deploy\server\default\depl
oy\work\MainEngine\localhost\jbossmq-httpil
11:06:04,125 INFO [Engine] WebappLoader[/jbossmq-httpil]: Deploy class files /W
EB-INF/classes to C:\JBoss\server\default\deploy\jms\jbossmq-httpil.sar\jbossmq-
httpil.war\WEB-INF\classes
11:06:04,484 INFO [Engine] ContextConfig[/jbossmq-httpil]: Added certificates -
> request attribute Valve
11:06:04,484 INFO [Engine] ContextConfig[/jbossmq-httpil]: Configured an authen
ticator for method BASIC
11:06:04,562 INFO [EmbeddedCatalinaService41] Using Java2 parent classloader de
legation: true
11:06:04,562 INFO [Engine] StandardManager[/jbossmq-httpil]: Seeding random num
ber generator class java.security.SecureRandom
11:06:04,562 INFO [Engine] StandardManager[/jbossmq-httpil]: Seeding of random
number generator has been completed
11:06:04,562 INFO [Engine] StandardWrapper[/jbossmq-httpil efault]: Loading co
ntainer servlet default
11:06:04,578 INFO [Engine] StandardWrapper[/jbossmq-httpil:invoker]: Loading co
ntainer servlet invoker
11:06:04,593 INFO [RARDeployment] Starting
11:06:04,625 INFO [RARDeployment] Started
11:06:04,625 INFO [JBossManagedConnectionPool] Starting
11:06:04,625 INFO [JBossManagedConnectionPool] Started
11:06:04,625 INFO [TxConnectionManager] Starting
11:06:04,640 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.se
curity.plugins.JaasSecurityManager@102679a
11:06:04,640 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util
.TimedCachePolicy@dfbb43
11:06:04,640 INFO [JaasSecurityManagerService] Added JmsXARealm, org.jboss.secu
rity.plugins.SecurityDomainContext@7f3b8a to map
11:06:04,656 INFO [JmsXA] Bound connection factory for resource adapter for Con
nectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/JmsXA'
11:06:04,656 INFO [TxConnectionManager] Started
11:06:04,656 INFO [JMSProviderLoader] Starting
11:06:04,671 INFO [JMSProviderLoader] Bound adapter to java:/DefaultJMSProvider
11:06:04,671 INFO [JMSProviderLoader] Started
11:06:04,671 INFO [ServerSessionPoolLoader] Starting
11:06:04,671 INFO [ServerSessionPoolLoader] pool factory StdJMSPool bound to ja
va:/StdJMSPool
11:06:04,671 INFO [ServerSessionPoolLoader] Started
11:06:04,703 INFO [MessageCache] Starting
11:06:04,703 INFO [MessageCache] Started
11:06:04,703 INFO [PersistenceManager] Starting
11:06:05,000 WARN [WrappedConnection] Closing a statement you left open, please
do your own housekeeping
11:06:05,000 WARN [WrappedConnection] Closing a statement you left open, please
do your own housekeeping
11:06:05,000 INFO [PersistenceManager] Started
11:06:05,000 INFO [CacheStore] Starting
11:06:05,000 INFO [CacheStore] Started
11:06:05,015 INFO [DynamicStateManager] Starting
11:06:05,015 INFO [DynamicStateManager] Started
11:06:05,015 INFO [DestinationManager] Starting
11:06:05,031 INFO [DestinationManager] Started
11:06:05,031 INFO [A] Starting
11:06:05,031 INFO [A] Bound to JNDI name: queue/A
11:06:05,031 INFO [A] Started
11:06:05,046 INFO Starting
11:06:05,046 INFO Bound to JNDI name: queue/B
11:06:05,046 INFO Started
11:06:05,046 INFO [C] Starting
11:06:05,046 INFO [C] Bound to JNDI name: queue/C
11:06:05,046 INFO [C] Started
11:06:05,046 INFO [D] Starting
11:06:05,062 INFO [D] Bound to JNDI name: queue/D
11:06:05,062 INFO [D] Started
11:06:05,062 INFO [ex] Starting
11:06:05,062 INFO [ex] Bound to JNDI name: queue/ex
11:06:05,062 INFO [ex] Started
11:06:05,062 INFO [SecurityManager] Starting
11:06:05,062 INFO [JaasSecurityManagerService] Created securityMgr=org.jboss.se
curity.plugins.JaasSecurityManager@1cab18
11:06:05,078 INFO [JaasSecurityManagerService] setCachePolicy, c=org.jboss.util
.TimedCachePolicy@24e801
11:06:05,078 INFO [JaasSecurityManagerService] Added jbossmq, org.jboss.securit
y.plugins.SecurityDomainContext@fba502 to map
11:06:05,078 INFO [SecurityManager] Started
11:06:05,093 INFO [testTopic] Starting
11:06:05,093 INFO [testTopic] Bound to JNDI name: topic/testTopic
11:06:05,109 INFO [testTopic] Started
11:06:05,109 INFO [securedTopic] Starting
11:06:05,109 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
11:06:05,109 INFO [securedTopic] Started
11:06:05,109 INFO [testDurableTopic] Starting
11:06:05,109 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
11:06:05,109 INFO [testDurableTopic] Started
11:06:05,109 INFO [testQueue] Starting
11:06:05,109 INFO [testQueue] Bound to JNDI name: queue/testQueue
11:06:05,109 INFO [testQueue] Started
11:06:05,109 INFO [InterceptorLoader] Starting
11:06:05,109 INFO [InterceptorLoader] Started
11:06:05,109 INFO [Invoker] Starting
11:06:05,109 INFO [Invoker] Started
11:06:05,109 INFO [HTTPServerILService] Starting
11:06:05,171 INFO [HTTPServerILService] Started
11:06:05,171 INFO [JVMServerILService] Starting
11:06:05,187 INFO [JVMServerILService] Started
11:06:05,187 INFO [RMIServerILService] Starting
11:06:05,218 INFO [RMIServerILService] Started
11:06:05,218 INFO [OILServerILService] Starting
11:06:05,218 INFO [OILServerILService] JBossMQ OIL service available at : 0.0.0
.0/0.0.0.0:8090
11:06:05,234 INFO [OILServerILService] Started
11:06:05,234 INFO [UILServerILService] Starting
11:06:05,250 INFO [UILServerILService] JBossMQ UIL service available at : 0.0.0
.0/0.0.0.0:8091
11:06:05,250 INFO [UILServerILService] Started
11:06:05,250 INFO [OIL2ServerILService] Starting
11:06:05,250 INFO [OIL2ServerILService] JBossMQ OIL2 service available at : 0.0
.0.0/0.0.0.0:8092
11:06:05,265 INFO [OIL2ServerILService] Started
11:06:05,265 INFO [UILServerILService] Starting
11:06:05,265 INFO [UILServerILService] JBossMQ UIL service available at : 0.0.0
.0/0.0.0.0:8093
11:06:05,312 INFO [UILServerILService] Started
11:06:05,328 INFO [DLQ] Starting
11:06:05,328 INFO [DLQ] Bound to JNDI name: queue/DLQ
11:06:05,328 INFO [DLQ] Started
11:06:05,359 INFO [MainDeployer] Deployed package: file:/C:/JBoss/server/defaul
t/deploy/jms/
11:06:05,359 INFO [MainDeployer] Starting deployment of package: file:/C:/JBoss
/server/default/deploy/management/
11:06:05,359 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/management/console-mgr.sar
11:06:05,359 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/management/ejb-management.jar
11:06:05,359 INFO [JARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/deploy/management/web-console.war
11:06:05,375 INFO [SARDeployer] nested deployment: file:/C:/JBoss/server/defaul
t/tmp/deploy/server/default/deploy/management/console-mgr.sar/43.console-mgr.sar
-contents/console-mgr-classes.jar
11:06:05,515 INFO [PluginManager] Creating
11:06:05,515 INFO [PluginManager] Created
11:06:05,828 INFO [EjbModule] Creating
11:06:05,828 INFO [EjbModule] Deploying MEJB
11:06:05,921 INFO [StatelessSessionContainer] Creating
11:06:05,937 INFO [StatelessSessionInstancePool] Creating
11:06:05,937 INFO [StatelessSessionInstancePool] Created
11:06:05,953 INFO [StatelessSessionContainer] Created
11:06:05,953 INFO [EjbModule] Created
11:06:05,953 INFO [PluginManager] Starting
11:06:05,968 INFO [PluginManager] Started
11:06:05,984 INFO [EjbModule] Starting
11:06:05,984 INFO [StatelessSessionContainer] Starting
11:06:06,031 INFO [StatelessSessionInstancePool] Starting
11:06:06,031 INFO [StatelessSessionInstancePool] Started
11:06:06,031 INFO [StatelessSessionContainer] Started
11:06:06,031 INFO [EjbModule] Started
11:06:06,031 INFO [EJBDeployer] Deployed: file:/C:/JBoss/server/default/deploy/
management/ejb-management.jar
11:06:06,140 INFO [EmbeddedCatalinaService41] deploy, ctxPath=/web-console, war
Url=file:/C:/JBoss/server/default/tmp/deploy/server/default/deploy/management/we
b-console.war/45.web-console.war
11:06:06,171 INFO [Engine] WebappLoader[/web-console]: Deploying class reposito
ries to work directory C:\JBoss\server\default\tmp\deploy\server\default\deploy\
work\MainEngine\localhost\web-console
11:06:06,171 INFO [Engine] WebappLoader[/web-console]: Deploy class files /WEB-
INF/classes to C:\JBoss\server\default\tmp\deploy\server\default\deploy\work\Mai
nEngine\localhost\web-console\WEB-INF\classes
11:06:06,750 INFO [Engine] ContextConfig[/web-console]: Added certificates -> r
equest attribute Valve
11:06:06,859 INFO [EmbeddedCatalinaService41] Using Java2 parent classloader de
legation: true
11:06:06,859 INFO [Engine] StandardManager[/web-console]: Seeding random number
generator class java.security.SecureRandom
11:06:06,859 INFO [Engine] StandardManager[/web-console]: Seeding of random num
ber generator has been completed
11:06:07,171 INFO [Engine] StandardWrapper[/web-console efault]: Loading conta
iner servlet default
11:06:07,250 INFO [Engine] StandardWrapper[/web-console:invoker]: Loading conta
iner servlet invoker
11:06:07,265 INFO [MainDeployer] Deployed package: file:/C:/JBoss/server/defaul
t/deploy/management/
11:06:07,265 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
ration 'checkIncompleteDeployments()'
Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
<none>
Incompletely deployed packages:
[org.jboss.deployment.DeploymentInfo@e5e8b978 { url=file:/C:/JBoss/server/defaul
t/deploy/test1.jar }
deployer: org.jboss.ejb.EJBDeployer@1015a9e
status: null
state: FAILED
watch: file:/C:/JBoss/server/default/deploy/test1.jar
lastDeployed: 1060851962812
lastModified: 1060851962750
mbeans:
]MBeans waiting for classes:
<none>
MBeans waiting for other MBeans:
<none>
11:06:07,281 INFO [URLDeploymentScanner] Started
11:06:07,312 INFO [MainDeployer] Deployed package: file:/C:/JBoss/server/defaul
t/conf/jboss-service.xml
11:06:07,312 INFO [Server] JBoss (MX MicroKernel) [3.2.1 (build: CVSTag=JBoss_3
_2_1 date=200305041533)] Started in 11s:531ms

it was showing deploy fail.
I am not understanding why it is not deploying the component. Please suggest me how can I deploy a file.

And my ejb.jar.xml file
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar>
<description>JBoss SampleApplication</description>
<display-name>Simple EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>HalloEJB</ejb-name>
<home>ejbclient.ClientEJBHome</home>
<remote>ejbclient.ClientEJBRemote</remote>
<ejb-class>ejbclient.ClientEJBBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

jboss.xml file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE jboss (View Source for full doctype...)>
<jboss>
<enterprise-beans>
<session>
<ejb-name>HalloEJB</ejb-name>
<stateless-session-descriptor>
<pool>
<max-beans-in-free-pool>20</max-beans-in-free-pool>
<initial-beans-in-free-pool>10</initial-beans-in-free-pool>
</pool>
<stateless-clustering>
<stateless-bean-load-algorithm>Random</stateless-bean-load-algorithm>
</stateless-clustering>
</stateless-session-descriptor>
<transaction-descriptor>
<trans-timeout-seconds>60</trans-timeout-seconds>
</transaction-descriptor>
<jndi-name>MessageJNDI</jndi-name>
</session>
</enterprise-beans>
</jboss>
or i can give another simple jboss.xml file like
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE jboss (View Source for full doctype...)>
<jboss>
<enterprise-beans>
<session>
<ejb-name>HalloEJB</ejb-name>
<jndi-name>MessageJNDI</jndi-name>
</session>
</enterprise-beans>
</jboss>
then both are same files or which one i have to prefer for jboss.xml. I gave the first one .
then I create a client program source:
package ejbclient;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import java.io.*;
import ejbclient.ClientEJBRemote;
import ejbclient.ClientEJBHome;
public class TestClient {
public static void main(String args[]){
try{
InitialContext jndiContext = new InitialContext();
System.out.println("Got context");
Object ref = jndiContext.lookup("MessageJNDI");
System.out.println("Got reference");
ClientEJBHome home = (ClientEJBHome)
PortableRemoteObject.narrow(ref, ClientEJBHome.class);
ClientEJBRemote remote = home.create();
System.out.println(remote.getHallo());
}catch(Exception ex){
System.out.println(ex.toString());
}
}
}
once I run the program it was showing this error on run time.
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

please suggest me how can I deploy a component and
how can I run EJB in JBoss.
Thanks
Fyrose.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JBoss Forum...
 
Author
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the client side, do you have a jndi.properties file set? If not,
create a jndi.properties and put it on a directory in your classpath. It should contain something this:

Then you should be able to connect to JBoss and do lookups...(of course you need the jboss client jars on your classpath too)
 
norman richards
Author
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
responding to pm message here, since I lost the link to it.
The jndi.properties in the conf directory is for internal JBoss use. If you are running your client outside of JBoss, as I assume you are because of the main call, then you need your own that looks something like the one above. (you can also set the properties programatically, but I don't have a code sample handy)
So, put the jndi.properties in some local directory. ("properties", for example) Then, add the properties directory to your classpath. (your classpath should have your code, the JBoss client jars and the properties directory) You should be able to get a JNDI context for your JBoss server with new InitialContext().
 
I can't take it! You are too smart for me! Here is the tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic