mandmtech
asked on
EJB JNDI lookup not working properly.
I need some help on resolving JNDI for this simple EJB application. It adds and subtracts numbers.
I believe you helped me resolve this problem several months ago, and I tried to follow what we did then, however I am not getting anywhere.
I also cant seem to run the program from the server
This is what I get when I run as Java app on MyEclipse8.....
Exception in thread "main" javax.naming.NoInitialCont extExcepti on: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initia l
at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:645)
at javax.naming.InitialContex t.getDefau ltInitCtx( InitialCon text.java: 288)
at javax.naming.InitialContex t.getURLOr DefaultIni tCtx(Initi alContext. java:325)
at javax.naming.InitialContex t.lookup(I nitialCont ext.java:3 92)
at org.jboss01.stateless.TheC lient.main (TheClient .java:30)
When I try to run it as a JBoss5 server app on MyEclipse8, it restarts the server, but I dont see any output from the application.
This is the JNDI setup I have on JBoss5:
13:29:04,069 INFO [JBossASKernel] Created KernelDeployment for: JBOSSTutorial2.jar
13:29:04,069 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=JBOSSTutori al2.jar,na me=Calcula torBean,se rvice=EJB3
13:29:04,069 INFO [JBossASKernel] with dependencies:
13:29:04,069 INFO [JBossASKernel] and demands:
13:29:04,069 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:04,069 INFO [JBossASKernel] and supplies:
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local- org.jboss0 1.stateles s.Calculat orBeanLoca l
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles s.Calculat orBeanLoca l
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote -org.jboss 01.statele ss.Calcula torBeanRem ote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles s.Calculat orBeanRemo te
13:29:04,069 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=JBOSST utorial2.j ar,name=Ca lculatorBe an,service =EJB3) to KernelDeployment of: JBOSSTutorial2.jar
13:29:04,069 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@e728a 5{name=jbo ss.j2ee:ja r=JBOSSTut orial2.jar ,name=Calc ulatorBean ,service=E JB3_endpoi nt bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:04,116 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=JBOSSTutori al2.jar,na me=Calcula torBean,se rvice=EJB3
13:29:04,116 INFO [EJBContainer] STARTED EJB: org.jboss01.stateless.Calc ulatorBean ejbName: CalculatorBean
13:29:04,194 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
CalculatorBean/remote - EJB3.x Default Remote Business Interface
CalculatorBean/remote-org. jboss01.st ateless.Ca lculatorBe anRemote - EJB3.x Remote Business Interface
CalculatorBean/local - EJB3.x Default Local Business Interface
CalculatorBean/local-org.j boss01.sta teless.Cal culatorBea nLocal - EJB3.x Local Business Interface
Here is the code Im using:
Client:
package org.jboss01.stateless;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContex t;
import org.jboss01.stateless.Calc ulatorBean Remote;
public class TheClient {
public static void main(String[] args) throws Exception
{
Context context = new InitialContext();
CalculatorBeanRemote calculator = (CalculatorBeanRemote) context.lookup("Calculator Bean/remot e");
System.out.println(calcula tor.add(1, 1));
System.out.println(calcula tor.subtra ct(1, 1));
}
}
__________________________ __________ __________ __________ __________ __________ _
Session Bean:
package org.jboss01.stateless;
import javax.ejb.Stateless;
@Stateless
public class CalculatorBean implements CalculatorBeanLocal,
CalculatorBeanRemote {
public int add(int x, int y)
{
System.out.print("Doing addition: 1 + 1 ===> ");
return x + y;
}
public int subtract(int x, int y)
{
System.out.print("Doing subtraction: 1 - 1 ===> ");
return x - y;
}
}
__________________________ __________ __________ __________ __________ __________ _
Remote Interface:
package org.jboss01.stateless;
import javax.ejb.Remote;
@Remote
public interface CalculatorBeanRemote {
int add(int x, int y);
int subtract(int x, int y);
}
__________________________ __________ __________ __________ __________ __________ _
Local Interface:
package org.jboss01.stateless;
import javax.ejb.Local;
@Local
public interface CalculatorBeanLocal {
int add(int x, int y);
int subtract(int x, int y);
}
__________________________ __________ __________ __________ __________ __________ _
Complete JBoss Startup Log:
13:28:01,831 INFO [ServerImpl] Starting JBoss (Microcontainer)...
13:28:01,831 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
13:28:01,831 INFO [ServerImpl] Bootstrap URL: null
13:28:01,831 INFO [ServerImpl] Home Dir: C:\jboss-5.1.0.GA
13:28:01,831 INFO [ServerImpl] Home URL: file:/C:/jboss-5.1.0.GA/
13:28:01,831 INFO [ServerImpl] Library URL: file:/C:/jboss-5.1.0.GA/li b/
13:28:01,846 INFO [ServerImpl] Patch URL: null
13:28:01,846 INFO [ServerImpl] Common Base URL: file:/C:/jboss-5.1.0.GA/co mmon/
13:28:01,846 INFO [ServerImpl] Common Library URL: file:/C:/jboss-5.1.0.GA/co mmon/lib/
13:28:01,846 INFO [ServerImpl] Server Name: default
13:28:01,846 INFO [ServerImpl] Server Base Dir: C:\jboss-5.1.0.GA\server
13:28:01,846 INFO [ServerImpl] Server Base URL: file:/C:/jboss-5.1.0.GA/se rver/
13:28:01,846 INFO [ServerImpl] Server Config URL: file:/C:/jboss-5.1.0.GA/se rver/defau lt/conf/
13:28:01,846 INFO [ServerImpl] Server Home Dir: C:\jboss-5.1.0.GA\server\d efault
13:28:01,846 INFO [ServerImpl] Server Home URL: file:/C:/jboss-5.1.0.GA/se rver/defau lt/
13:28:01,846 INFO [ServerImpl] Server Data Dir: C:\jboss-5.1.0.GA\server\d efault\dat a
13:28:01,846 INFO [ServerImpl] Server Library URL: file:/C:/jboss-5.1.0.GA/se rver/defau lt/lib/
13:28:01,846 INFO [ServerImpl] Server Log Dir: C:\jboss-5.1.0.GA\server\d efault\log
13:28:01,846 INFO [ServerImpl] Server Native Dir: C:\jboss-5.1.0.GA\server\d efault\tmp \native
13:28:01,846 INFO [ServerImpl] Server Temp Dir: C:\jboss-5.1.0.GA\server\d efault\tmp
13:28:01,846 INFO [ServerImpl] Server Temp Deploy Dir: C:\jboss-5.1.0.GA\server\d efault\tmp \deploy
13:28:02,612 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/jbos s-5.1.0.GA /server/de fault/conf /bootstrap .xml
13:28:03,300 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins .cache.Com binedVFSCa che]
13:28:03,315 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cac he: null]]
13:28:03,659 INFO [CopyMechanism] VFS temp dir: C:\jboss-5.1.0.GA\server\d efault\tmp
13:28:03,659 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
13:28:04,800 INFO [ServerInfo] Java version: 1.6.0_13,Sun Microsystems Inc.
13:28:04,800 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
13:28:04,800 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 11.3-b02,Sun Microsystems Inc.
13:28:04,800 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
13:28:04,800 INFO [ServerInfo] VM arguments: -agentlib:jdwp=transport=d t_socket,s uspend=y,a ddress=loc alhost:324 2 -Djboss.home=C:\jboss-5.1. 0.GA -Djava.library.path=C:\Pro gram Files\Genuitec\Common\bina ry\com.sun .java.jdk. win32.x86_ 1.6.0.013\ bin -Djava.endorsed.dirs=C:\jb oss-5.1.0. GA\lib\end orsed -Xms128m -Xmx512m -XX:MaxPermSize=256m
13:28:04,847 INFO [JMXKernel] Legacy JMX core initialized
13:28:06,909 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey@fa4dab[domain=d efault, server=default, name=default]
13:28:08,909 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
13:28:16,144 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
13:28:16,144 INFO [NativeServerConfig] 3.1.2.GA
13:28:17,832 INFO [AttributeCallbackItem] Owner callback not implemented.
13:28:20,332 INFO [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logg ing,type=L og4jServic e" to server org.jboss.mx.server.MBeanS erverImpl@ 4d0923[ defaultDomain='jboss' ]
13:28:46,662 WARN [MappedReferenceMetaDataRe solverDepl oyer] Unresolved references exist in JBossWebMetaData:[#web-app :Annotated EJBReferen ceMetaData {name=test .MyServlet /ssr,ejb-r ef-type=nu ll,link=nu ll,ignore- dependecy= false,mapp ed/jndi-na me=SimpleS ession/rem ote,resolv ed-jndi-na me=null,be anInterfac e=interfac e test.SimpleSessionRemote}]
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@5328994 {vfszip:/C :/jboss-5. 1.0.GA/ser ver/defaul t/deploy/E JB3%20In%2 0Action%20 Chapter%20 1.jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@5328994 {vfszip:/C :/jboss-5. 1.0.GA/ser ver/defaul t/deploy/E JB3%20In%2 0Action%20 Chapter%20 1.jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@3099285 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /Eclipse8E jbProject. jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@3099285 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /Eclipse8E jbProject. jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2991217 9{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /JBOSSTuto rial2.jar/ }
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2991217 9{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /JBOSSTuto rial2.jar/ }
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2355222 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /profilese rvice-secu red.jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2355222 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /profilese rvice-secu red.jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2355222 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /profilese rvice-secu red.jar/}
13:28:46,709 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentConte xt@2355222 7{vfsfile: /C:/jboss- 5.1.0.GA/s erver/defa ult/deploy /profilese rvice-secu red.jar/}
13:28:50,131 INFO [JMXConnectorServerService ] JMX Connector server: service:jmx:rmi://127.0.0. 1/jndi/rmi ://127.0.0 .1:1090/jm xconnector
13:28:50,365 INFO [MailService] Mail Service bound to java:/Mail
13:28:54,272 WARN [JBossASSecurityMetadataSt ore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
13:28:54,318 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.anno tation.Man agementCom ponent
13:28:54,459 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.anno tation.Man agementCom ponent
13:28:54,568 INFO [TransactionManagerService ] JBossTS Transaction Service (JTA version - tag:JBOSSTS_4_6_1_GA) - JBoss Inc.
13:28:54,568 INFO [TransactionManagerService ] Setting up property manager MBean and JMX layer
13:28:55,084 INFO [TransactionManagerService ] Initializing recovery manager
13:28:55,334 INFO [TransactionManagerService ] Recovery manager configured
13:28:55,334 INFO [TransactionManagerService ] Binding TransactionManager JNDI Reference
13:28:55,381 INFO [TransactionManagerService ] Starting transaction recovery manager
13:28:56,240 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\bina ry\com.sun .java.jdk. win32.x86_ 1.6.0.013\ bin
13:28:56,350 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
13:28:56,365 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:28:56,444 INFO [StandardService] Starting service jboss.web
13:28:56,444 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.3.GA
13:28:56,537 INFO [Catalina] Server startup in 183 ms
13:28:56,584 INFO [TomcatDeployment] deploy, ctxPath=/web-console
13:28:58,803 INFO [TomcatDeployment] deploy, ctxPath=/jbossws
13:28:58,912 INFO [TomcatDeployment] deploy, ctxPath=/invoker
13:28:59,163 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/ server/def ault/deplo y/jboss-lo cal-jdbc.r ar/META-IN F/ra.xml
13:28:59,178 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/ server/def ault/deplo y/jboss-xa -jdbc.rar/ META-INF/r a.xml
13:28:59,225 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/ server/def ault/deplo y/jms-ra.r ar/META-IN F/ra.xml
13:28:59,272 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/ server/def ault/deplo y/mail-ra. rar/META-I NF/ra.xml
13:28:59,303 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/ server/def ault/deplo y/quartz-r a.rar/META -INF/ra.xm l
13:28:59,459 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
13:28:59,538 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
13:28:59,538 INFO [RAMJobStore] RAMJobStore initialized.
13:28:59,538 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
13:28:59,538 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
13:28:59,538 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_N ON_CLUSTER ED started.
13:29:00,459 INFO [ConnectionFactoryBindingS ervice] Bound ConnectionManager 'jboss.jca:service=DataSou rceBinding ,name=Defa ultDS' to JNDI name 'java:DefaultDS'
13:29:01,866 INFO [ServerPeer] JBoss Messaging 1.4.3.GA server [0] started
13:29:02,100 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,100 INFO [ConnectionFactory] org.jboss.jms.server.conne ctionfacto ry.Connect ionFactory @12d56ed started
13:29:02,131 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:29:02,147 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,147 INFO [ConnectionFactory] org.jboss.jms.server.conne ctionfacto ry.Connect ionFactory @f1413f started
13:29:02,147 INFO [ConnectionFactoryJNDIMapp er] supportsFailover attribute is true on connection factory: jboss.messaging.connection factory:se rvice=Clus teredConne ctionFacto ry but post office is non clustered. So connection factory will *not* support failover
13:29:02,147 INFO [ConnectionFactoryJNDIMapp er] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connection factory:se rvice=Clus teredConne ctionFacto ry but post office is non clustered. So connection factory will *not* support load balancing
13:29:02,147 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,147 INFO [ConnectionFactory] org.jboss.jms.server.conne ctionfacto ry.Connect ionFactory @fc294d started
13:29:02,147 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:29:02,381 INFO [ConnectionFactoryBindingS ervice] Bound ConnectionManager 'jboss.jca:service=Connect ionFactory Binding,na me=JmsXA' to JNDI name 'java:JmsXA'
13:29:02,491 INFO [ConnectionFactoryBindingS ervice] Bound ConnectionManager 'jboss.jca:service=DataSou rceBinding ,name=Prro moDS' to JNDI name 'java:PrromoDS'
13:29:03,225 INFO [JBossASKernel] Created KernelDeployment for: EJB3 In Action Chapter 1.jar
13:29:03,241 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s ervice=EJB 3
13:29:03,241 INFO [JBossASKernel] with dependencies:
13:29:03,241 INFO [JBossASKernel] and demands:
13:29:03,241 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:03,241 INFO [JBossASKernel] and supplies:
13:29:03,241 INFO [JBossASKernel] jndi:HelloUserBean/remote
13:29:03,241 INFO [JBossASKernel] Class:com.ejb3inaction.act ionbazaar. buslogic.H elloUserRe mote
13:29:03,241 INFO [JBossASKernel] jndi:HelloUserBean/remote- com.ejb3in action.act ionbazaar. buslogic.H elloUserRe mote
13:29:03,241 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s ervice=EJB 3) to KernelDeployment of: EJB3 In Action Chapter 1.jar
13:29:03,257 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@18732 6{name=jbo ss.j2ee:ja r=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s ervice=EJB 3_endpoint bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:03,382 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s ervice=EJB 3
13:29:03,428 INFO [EJBContainer] STARTED EJB: com.ejb3inaction.actionbaz aar.buslog ic.HelloUs erBean ejbName: HelloUserBean
13:29:03,600 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
HelloUserBean/remote - EJB3.x Default Remote Business Interface
HelloUserBean/remote-com.e jb3inactio n.actionba zaar.buslo gic.HelloU serRemote - EJB3.x Remote Business Interface
13:29:03,788 INFO [JBossASKernel] Created KernelDeployment for: Eclipse8EjbProject.jar
13:29:03,788 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=Eclipse8Ejb Project.ja r,name=Sim pleSession ,service=E JB3
13:29:03,788 INFO [JBossASKernel] with dependencies:
13:29:03,788 INFO [JBossASKernel] and demands:
13:29:03,788 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:03,788 INFO [JBossASKernel] and supplies:
13:29:03,788 INFO [JBossASKernel] Class:test.SimpleSessionRe mote
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/local-t est.Simple SessionLoc al
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/remote
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/local
13:29:03,788 INFO [JBossASKernel] Class:test.SimpleSessionLo cal
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/remote- test.Simpl eSessionRe mote
13:29:03,788 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=Eclips e8EjbProje ct.jar,nam e=SimpleSe ssion,serv ice=EJB3) to KernelDeployment of: Eclipse8EjbProject.jar
13:29:03,788 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@b22fa b{name=jbo ss.j2ee:ja r=Eclipse8 EjbProject .jar,name= SimpleSess ion,servic e=EJB3_end point bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:03,882 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=Eclipse8Ejb Project.ja r,name=Sim pleSession ,service=E JB3
13:29:03,882 INFO [EJBContainer] STARTED EJB: test.SimpleSession ejbName: SimpleSession
13:29:03,913 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
SimpleSession/remote - EJB3.x Default Remote Business Interface
SimpleSession/remote-test. SimpleSess ionRemote - EJB3.x Remote Business Interface
SimpleSession/local - EJB3.x Default Local Business Interface
SimpleSession/local-test.S impleSessi onLocal - EJB3.x Local Business Interface
13:29:04,069 INFO [JBossASKernel] Created KernelDeployment for: JBOSSTutorial2.jar
13:29:04,069 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=JBOSSTutori al2.jar,na me=Calcula torBean,se rvice=EJB3
13:29:04,069 INFO [JBossASKernel] with dependencies:
13:29:04,069 INFO [JBossASKernel] and demands:
13:29:04,069 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:04,069 INFO [JBossASKernel] and supplies:
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local- org.jboss0 1.stateles s.Calculat orBeanLoca l
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles s.Calculat orBeanLoca l
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote -org.jboss 01.statele ss.Calcula torBeanRem ote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles s.Calculat orBeanRemo te
13:29:04,069 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=JBOSST utorial2.j ar,name=Ca lculatorBe an,service =EJB3) to KernelDeployment of: JBOSSTutorial2.jar
13:29:04,069 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@e728a 5{name=jbo ss.j2ee:ja r=JBOSSTut orial2.jar ,name=Calc ulatorBean ,service=E JB3_endpoi nt bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:04,116 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=JBOSSTutori al2.jar,na me=Calcula torBean,se rvice=EJB3
13:29:04,116 INFO [EJBContainer] STARTED EJB: org.jboss01.stateless.Calc ulatorBean ejbName: CalculatorBean
13:29:04,194 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
CalculatorBean/remote - EJB3.x Default Remote Business Interface
CalculatorBean/remote-org. jboss01.st ateless.Ca lculatorBe anRemote - EJB3.x Remote Business Interface
CalculatorBean/local - EJB3.x Default Local Business Interface
CalculatorBean/local-org.j boss01.sta teless.Cal culatorBea nLocal - EJB3.x Local Business Interface
13:29:04,428 INFO [JBossASKernel] Created KernelDeployment for: profileservice-secured.jar
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecurePro fileServic e,service= EJB3
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/ remote-org .jboss.dep loyers.spi .managemen t.Manageme ntView
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.profileser vice.spi.P rofileServ ice
13:29:04,428 INFO [JBossASKernel] jndi:SecureProfileService/ remote
13:29:04,428 INFO [JBossASKernel] jndi:SecureProfileService/ remote-org .jboss.pro fileservic e.spi.Prof ileService
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil eservice-s ecured.jar ,name=Secu reProfileS ervice,ser vice=EJB3) to KernelDeployment of: profileservice-secured.jar
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecureDep loymentMan ager,servi ce=EJB3
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] jndi:SecureDeploymentManag er/remote- org.jboss. deployers. spi.manage ment.deplo y.Deployme ntManager
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.deployers. spi.manage ment.deplo y.Deployme ntManager
13:29:04,428 INFO [JBossASKernel] jndi:SecureDeploymentManag er/remote
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil eservice-s ecured.jar ,name=Secu reDeployme ntManager, service=EJ B3) to KernelDeployment of: profileservice-secured.jar
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecureMan agementVie w,service= EJB3
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer Service
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/ remote-org .jboss.dep loyers.spi .managemen t.Manageme ntView
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.deployers. spi.manage ment.Manag ementView
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/ remote
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil eservice-s ecured.jar ,name=Secu reManageme ntView,ser vice=EJB3) to KernelDeployment of: profileservice-secured.jar
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@9a7bf 9{name=jbo ss.j2ee:ja r=profiles ervice-sec ured.jar,n ame=Secure ProfileSer vice,servi ce=EJB3_en dpoint bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@52537 b{name=jbo ss.j2ee:ja r=profiles ervice-sec ured.jar,n ame=Secure Deployment Manager,se rvice=EJB3 _endpoint bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@46158 2{name=jbo ss.j2ee:ja r=profiles ervice-sec ured.jar,n ame=Secure Management View,servi ce=EJB3_en dpoint bean=org.jboss.ejb3.endpoi nt.deploye rs.impl.En dpointImpl properties=[container] constructor=null autowireCandidate=true}
13:29:04,538 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecureDep loymentMan ager,servi ce=EJB3
13:29:04,538 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e jb.SecureD eploymentM anager ejbName: SecureDeploymentManager
13:29:04,553 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
SecureDeploymentManager/re mote - EJB3.x Default Remote Business Interface
SecureDeploymentManager/re mote-org.j boss.deplo yers.spi.m anagement. deploy.Dep loymentMan ager - EJB3.x Remote Business Interface
13:29:04,632 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecureMan agementVie w,service= EJB3
13:29:04,632 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e jb.SecureM anagementV iew ejbName: SecureManagementView
13:29:04,647 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
SecureManagementView/remot e - EJB3.x Default Remote Business Interface
SecureManagementView/remot e-org.jbos s.deployer s.spi.mana gement.Man agementVie w - EJB3.x Remote Business Interface
13:29:04,741 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv ice-secure d.jar,name =SecurePro fileServic e,service= EJB3
13:29:04,757 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e jb.SecureP rofileServ iceBean ejbName: SecureProfileService
13:29:04,772 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
SecureProfileService/remot e - EJB3.x Default Remote Business Interface
SecureProfileService/remot e-org.jbos s.profiles ervice.spi .ProfileSe rvice - EJB3.x Remote Business Interface
13:29:05,038 INFO [TomcatDeployment] deploy, ctxPath=/admin-console
13:29:05,210 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/admin-console'
13:29:10,820 INFO [TomcatDeployment] deploy, ctxPath=/BrokerTool-war
13:29:11,023 INFO [TomcatDeployment] deploy, ctxPath=/Eclipse8WebProjec t
13:29:11,226 INFO [TomcatDeployment] deploy, ctxPath=/hi
13:29:11,366 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
13:29:11,491 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:29:11,523 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:29:11,538 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:9s:692ms
I believe you helped me resolve this problem several months ago, and I tried to follow what we did then, however I am not getting anywhere.
I also cant seem to run the program from the server
This is what I get when I run as Java app on MyEclipse8.....
Exception in thread "main" javax.naming.NoInitialCont
at javax.naming.spi.NamingMan
at javax.naming.InitialContex
at javax.naming.InitialContex
at javax.naming.InitialContex
at org.jboss01.stateless.TheC
When I try to run it as a JBoss5 server app on MyEclipse8, it restarts the server, but I dont see any output from the application.
This is the JNDI setup I have on JBoss5:
13:29:04,069 INFO [JBossASKernel] Created KernelDeployment for: JBOSSTutorial2.jar
13:29:04,069 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=JBOSSTutori
13:29:04,069 INFO [JBossASKernel] with dependencies:
13:29:04,069 INFO [JBossASKernel] and demands:
13:29:04,069 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:04,069 INFO [JBossASKernel] and supplies:
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local-
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles
13:29:04,069 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=JBOSST
13:29:04,069 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@e728a
13:29:04,116 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=JBOSSTutori
13:29:04,116 INFO [EJBContainer] STARTED EJB: org.jboss01.stateless.Calc
13:29:04,194 INFO [JndiSessionRegistrarBase]
CalculatorBean/remote - EJB3.x Default Remote Business Interface
CalculatorBean/remote-org.
CalculatorBean/local - EJB3.x Default Local Business Interface
CalculatorBean/local-org.j
Here is the code Im using:
Client:
package org.jboss01.stateless;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContex
import org.jboss01.stateless.Calc
public class TheClient {
public static void main(String[] args) throws Exception
{
Context context = new InitialContext();
CalculatorBeanRemote calculator = (CalculatorBeanRemote) context.lookup("Calculator
System.out.println(calcula
System.out.println(calcula
}
}
__________________________
Session Bean:
package org.jboss01.stateless;
import javax.ejb.Stateless;
@Stateless
public class CalculatorBean implements CalculatorBeanLocal,
CalculatorBeanRemote {
public int add(int x, int y)
{
System.out.print("Doing addition: 1 + 1 ===> ");
return x + y;
}
public int subtract(int x, int y)
{
System.out.print("Doing subtraction: 1 - 1 ===> ");
return x - y;
}
}
__________________________
Remote Interface:
package org.jboss01.stateless;
import javax.ejb.Remote;
@Remote
public interface CalculatorBeanRemote {
int add(int x, int y);
int subtract(int x, int y);
}
__________________________
Local Interface:
package org.jboss01.stateless;
import javax.ejb.Local;
@Local
public interface CalculatorBeanLocal {
int add(int x, int y);
int subtract(int x, int y);
}
__________________________
Complete JBoss Startup Log:
13:28:01,831 INFO [ServerImpl] Starting JBoss (Microcontainer)...
13:28:01,831 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)
13:28:01,831 INFO [ServerImpl] Bootstrap URL: null
13:28:01,831 INFO [ServerImpl] Home Dir: C:\jboss-5.1.0.GA
13:28:01,831 INFO [ServerImpl] Home URL: file:/C:/jboss-5.1.0.GA/
13:28:01,831 INFO [ServerImpl] Library URL: file:/C:/jboss-5.1.0.GA/li
13:28:01,846 INFO [ServerImpl] Patch URL: null
13:28:01,846 INFO [ServerImpl] Common Base URL: file:/C:/jboss-5.1.0.GA/co
13:28:01,846 INFO [ServerImpl] Common Library URL: file:/C:/jboss-5.1.0.GA/co
13:28:01,846 INFO [ServerImpl] Server Name: default
13:28:01,846 INFO [ServerImpl] Server Base Dir: C:\jboss-5.1.0.GA\server
13:28:01,846 INFO [ServerImpl] Server Base URL: file:/C:/jboss-5.1.0.GA/se
13:28:01,846 INFO [ServerImpl] Server Config URL: file:/C:/jboss-5.1.0.GA/se
13:28:01,846 INFO [ServerImpl] Server Home Dir: C:\jboss-5.1.0.GA\server\d
13:28:01,846 INFO [ServerImpl] Server Home URL: file:/C:/jboss-5.1.0.GA/se
13:28:01,846 INFO [ServerImpl] Server Data Dir: C:\jboss-5.1.0.GA\server\d
13:28:01,846 INFO [ServerImpl] Server Library URL: file:/C:/jboss-5.1.0.GA/se
13:28:01,846 INFO [ServerImpl] Server Log Dir: C:\jboss-5.1.0.GA\server\d
13:28:01,846 INFO [ServerImpl] Server Native Dir: C:\jboss-5.1.0.GA\server\d
13:28:01,846 INFO [ServerImpl] Server Temp Dir: C:\jboss-5.1.0.GA\server\d
13:28:01,846 INFO [ServerImpl] Server Temp Deploy Dir: C:\jboss-5.1.0.GA\server\d
13:28:02,612 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/C:/jbos
13:28:03,300 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins
13:28:03,315 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cac
13:28:03,659 INFO [CopyMechanism] VFS temp dir: C:\jboss-5.1.0.GA\server\d
13:28:03,659 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
13:28:04,800 INFO [ServerInfo] Java version: 1.6.0_13,Sun Microsystems Inc.
13:28:04,800 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
13:28:04,800 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 11.3-b02,Sun Microsystems Inc.
13:28:04,800 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
13:28:04,800 INFO [ServerInfo] VM arguments: -agentlib:jdwp=transport=d
13:28:04,847 INFO [JMXKernel] Legacy JMX core initialized
13:28:06,909 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey@fa4dab[domain=d
13:28:08,909 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
13:28:16,144 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
13:28:16,144 INFO [NativeServerConfig] 3.1.2.GA
13:28:17,832 INFO [AttributeCallbackItem] Owner callback not implemented.
13:28:20,332 INFO [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logg
13:28:46,662 WARN [MappedReferenceMetaDataRe
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:46,709 INFO [Ejb3DependenciesDeployer]
13:28:50,131 INFO [JMXConnectorServerService
13:28:50,365 INFO [MailService] Mail Service bound to java:/Mail
13:28:54,272 WARN [JBossASSecurityMetadataSt
13:28:54,318 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.anno
13:28:54,459 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.anno
13:28:54,568 INFO [TransactionManagerService
13:28:54,568 INFO [TransactionManagerService
13:28:55,084 INFO [TransactionManagerService
13:28:55,334 INFO [TransactionManagerService
13:28:55,334 INFO [TransactionManagerService
13:28:55,381 INFO [TransactionManagerService
13:28:56,240 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\bina
13:28:56,350 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
13:28:56,365 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:28:56,444 INFO [StandardService] Starting service jboss.web
13:28:56,444 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.3.GA
13:28:56,537 INFO [Catalina] Server startup in 183 ms
13:28:56,584 INFO [TomcatDeployment] deploy, ctxPath=/web-console
13:28:58,803 INFO [TomcatDeployment] deploy, ctxPath=/jbossws
13:28:58,912 INFO [TomcatDeployment] deploy, ctxPath=/invoker
13:28:59,163 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/
13:28:59,178 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/
13:28:59,225 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/
13:28:59,272 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/
13:28:59,303 INFO [RARDeployment] Required license terms exist, view vfszip:/C:/jboss-5.1.0.GA/
13:28:59,459 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
13:28:59,538 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
13:28:59,538 INFO [RAMJobStore] RAMJobStore initialized.
13:28:59,538 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
13:28:59,538 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
13:28:59,538 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_N
13:29:00,459 INFO [ConnectionFactoryBindingS
13:29:01,866 INFO [ServerPeer] JBoss Messaging 1.4.3.GA server [0] started
13:29:02,100 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,100 INFO [ConnectionFactory] org.jboss.jms.server.conne
13:29:02,131 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:29:02,147 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,147 INFO [ConnectionFactory] org.jboss.jms.server.conne
13:29:02,147 INFO [ConnectionFactoryJNDIMapp
13:29:02,147 INFO [ConnectionFactoryJNDIMapp
13:29:02,147 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:29:02,147 INFO [ConnectionFactory] org.jboss.jms.server.conne
13:29:02,147 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:29:02,381 INFO [ConnectionFactoryBindingS
13:29:02,491 INFO [ConnectionFactoryBindingS
13:29:03,225 INFO [JBossASKernel] Created KernelDeployment for: EJB3 In Action Chapter 1.jar
13:29:03,241 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s
13:29:03,241 INFO [JBossASKernel] with dependencies:
13:29:03,241 INFO [JBossASKernel] and demands:
13:29:03,241 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:03,241 INFO [JBossASKernel] and supplies:
13:29:03,241 INFO [JBossASKernel] jndi:HelloUserBean/remote
13:29:03,241 INFO [JBossASKernel] Class:com.ejb3inaction.act
13:29:03,241 INFO [JBossASKernel] jndi:HelloUserBean/remote-
13:29:03,241 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s
13:29:03,257 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@18732
13:29:03,382 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=EJB3 In Action Chapter 1.jar,name=HelloUserBean,s
13:29:03,428 INFO [EJBContainer] STARTED EJB: com.ejb3inaction.actionbaz
13:29:03,600 INFO [JndiSessionRegistrarBase]
HelloUserBean/remote - EJB3.x Default Remote Business Interface
HelloUserBean/remote-com.e
13:29:03,788 INFO [JBossASKernel] Created KernelDeployment for: Eclipse8EjbProject.jar
13:29:03,788 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=Eclipse8Ejb
13:29:03,788 INFO [JBossASKernel] with dependencies:
13:29:03,788 INFO [JBossASKernel] and demands:
13:29:03,788 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:03,788 INFO [JBossASKernel] and supplies:
13:29:03,788 INFO [JBossASKernel] Class:test.SimpleSessionRe
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/local-t
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/remote
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/local
13:29:03,788 INFO [JBossASKernel] Class:test.SimpleSessionLo
13:29:03,788 INFO [JBossASKernel] jndi:SimpleSession/remote-
13:29:03,788 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=Eclips
13:29:03,788 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@b22fa
13:29:03,882 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=Eclipse8Ejb
13:29:03,882 INFO [EJBContainer] STARTED EJB: test.SimpleSession ejbName: SimpleSession
13:29:03,913 INFO [JndiSessionRegistrarBase]
SimpleSession/remote - EJB3.x Default Remote Business Interface
SimpleSession/remote-test.
SimpleSession/local - EJB3.x Default Local Business Interface
SimpleSession/local-test.S
13:29:04,069 INFO [JBossASKernel] Created KernelDeployment for: JBOSSTutorial2.jar
13:29:04,069 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=JBOSSTutori
13:29:04,069 INFO [JBossASKernel] with dependencies:
13:29:04,069 INFO [JBossASKernel] and demands:
13:29:04,069 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:04,069 INFO [JBossASKernel] and supplies:
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local-
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/local
13:29:04,069 INFO [JBossASKernel] jndi:CalculatorBean/remote
13:29:04,069 INFO [JBossASKernel] Class:org.jboss01.stateles
13:29:04,069 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=JBOSST
13:29:04,069 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@e728a
13:29:04,116 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=JBOSSTutori
13:29:04,116 INFO [EJBContainer] STARTED EJB: org.jboss01.stateless.Calc
13:29:04,194 INFO [JndiSessionRegistrarBase]
CalculatorBean/remote - EJB3.x Default Remote Business Interface
CalculatorBean/remote-org.
CalculatorBean/local - EJB3.x Default Local Business Interface
CalculatorBean/local-org.j
13:29:04,428 INFO [JBossASKernel] Created KernelDeployment for: profileservice-secured.jar
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.profileser
13:29:04,428 INFO [JBossASKernel] jndi:SecureProfileService/
13:29:04,428 INFO [JBossASKernel] jndi:SecureProfileService/
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] jndi:SecureDeploymentManag
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.deployers.
13:29:04,428 INFO [JBossASKernel] jndi:SecureDeploymentManag
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil
13:29:04,428 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=profileserv
13:29:04,428 INFO [JBossASKernel] with dependencies:
13:29:04,428 INFO [JBossASKernel] and demands:
13:29:04,428 INFO [JBossASKernel] jboss.ejb:service=EJBTimer
13:29:04,428 INFO [JBossASKernel] and supplies:
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/
13:29:04,428 INFO [JBossASKernel] Class:org.jboss.deployers.
13:29:04,428 INFO [JBossASKernel] jndi:SecureManagementView/
13:29:04,428 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=profil
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@9a7bf
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@52537
13:29:04,444 INFO [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@46158
13:29:04,538 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv
13:29:04,538 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e
13:29:04,553 INFO [JndiSessionRegistrarBase]
SecureDeploymentManager/re
SecureDeploymentManager/re
13:29:04,632 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv
13:29:04,632 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e
13:29:04,647 INFO [JndiSessionRegistrarBase]
SecureManagementView/remot
SecureManagementView/remot
13:29:04,741 INFO [SessionSpecContainer] Starting jboss.j2ee:jar=profileserv
13:29:04,757 INFO [EJBContainer] STARTED EJB: org.jboss.profileservice.e
13:29:04,772 INFO [JndiSessionRegistrarBase]
SecureProfileService/remot
SecureProfileService/remot
13:29:05,038 INFO [TomcatDeployment] deploy, ctxPath=/admin-console
13:29:05,210 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/admin-console'
13:29:10,820 INFO [TomcatDeployment] deploy, ctxPath=/BrokerTool-war
13:29:11,023 INFO [TomcatDeployment] deploy, ctxPath=/Eclipse8WebProjec
13:29:11,226 INFO [TomcatDeployment] deploy, ctxPath=/hi
13:29:11,366 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
13:29:11,491 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:29:11,523 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:29:11,538 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:9s:692ms
ASKER
Ha, I get this error. I tried something like that before ioanton. Here's the new msg:
javax.naming.NoInitialCont extExcepti on: Cannot instantiate class: org.jnp.interfaces.NamingC ontextFact ory [Root exception is java.lang.ClassNotFoundExc eption: org.jnp.interfaces.NamingC ontextFact ory]
at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:657)
at javax.naming.InitialContex t.getDefau ltInitCtx( InitialCon text.java: 288)
at javax.naming.InitialContex t.init(Ini tialContex t.java:223 )
at javax.naming.InitialContex t.<init>(I nitialCont ext.java:1 97)
at org.jboss01.stateless.TheC lient.main (TheClient .java:23)
Caused by: java.lang.ClassNotFoundExc eption: org.jnp.interfaces.NamingC ontextFact ory
at java.net.URLClassLoader$1. run(URLCla ssLoader.j ava:200)
at java.security.AccessContro ller.doPri vileged(Na tive Method)
at java.net.URLClassLoader.fi ndClass(UR LClassLoad er.java:18 8)
at java.lang.ClassLoader.load Class(Clas sLoader.ja va:307)
at sun.misc.Launcher$AppClass Loader.loa dClass(Lau ncher.java :301)
at java.lang.ClassLoader.load Class(Clas sLoader.ja va:252)
at java.lang.ClassLoader.load ClassInter nal(ClassL oader.java :320)
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:2 47)
at com.sun.naming.internal.Ve rsionHelpe r12.loadCl ass(Versio nHelper12. java:46)
at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:654)
... 4 more
Im probably missing something.......will keep looking, but any help from the experts is Most Welcome!
Thank you!
javax.naming.NoInitialCont
at javax.naming.spi.NamingMan
at javax.naming.InitialContex
at javax.naming.InitialContex
at javax.naming.InitialContex
at org.jboss01.stateless.TheC
Caused by: java.lang.ClassNotFoundExc
at java.net.URLClassLoader$1.
at java.security.AccessContro
at java.net.URLClassLoader.fi
at java.lang.ClassLoader.load
at sun.misc.Launcher$AppClass
at java.lang.ClassLoader.load
at java.lang.ClassLoader.load
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
at com.sun.naming.internal.Ve
at javax.naming.spi.NamingMan
... 4 more
Im probably missing something.......will keep looking, but any help from the experts is Most Welcome!
Thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
public class TheClient {
public static void main(String[] args)
throws Exception {
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CO
env.put(Context.PROVIDER_U
env.put(Context.URL_PKG_PR
Context context = new InitialContext(env);
CalculatorBeanRemote calculator = (CalculatorBeanRemote) context.lookup("Calculator
System.out.println(calcula
System.out.println(calcula
} catch (Exception ex) {
ex.printStackTrace();
}
}
}