• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pet Store

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any body help me or give guidelines how to configure java petstore application in jboss. Thanks in Advance
Sudhakar
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This will help you to configure PetStore in JBOSS:-

----Just check this out------

Deploying the Pet Store 1.1.2 Demo in JBoss

Introduction
The Pet Store sample application (demo) is a relatively robust, well-documented demonstration of J2EE technology and concepts. It implements MVC (Model-View-Controller) architecture.

The Pet Store demo can allow developers to gain familiarity with J2EE concepts including application portability, a key J2EE design objective.

The Pet Store has been most recently deployed using the JBoss-Jetty package, JBoss-2.4.0_Jetty-3.1.RC8-1. If you use the JBoss-Jetty package, you will have to add Pet Store DB Pools to the jboss.jcml file in the jboss/conf/jetty directory.

The Pet Store had previously been deployed using a JBoss 2.4 BETA configured to use Embedded Tomcat 3.2.2. The specific release used was JBoss 2.4 BETA Rel_2_4_0_23.

Both deployments were on a RH Linux 6.2 system using the Sun 1.3 jdk.

Outstanding Deployment Issues
Please post your experiences with deploying the Pet Store in JBoss to the jboss-user mailing list.

Initializing the Database. The Pet Store application should automatically build required database tables the first time the Pet Store application is started. The latest database schema is slightly different from the earlier release, so you may encounter problems if you have an existing Pet Store database from a previous installation. When tring to determine the initial status of the database, this conflict may cause one of the drop commands to fail, and the application will not create the required tables. If this is the case, you may need to manually drop all existing tables before deploying the Pet Store for the first time. It may help to turn off your browser cache while building the tables.

The Admin Client. We need JBoss deployment descriptors for the Admin application. If you have successfully deployed the Admin application using JBoss, please post them to one of the Forums or to the jboss-user mailing list.

Pet Store Security. The current release of the Pet Store handles security at the application level. It does require that you configure JBoss or Tomcat security services.

Contributors:
Mike Lueders, Richard Gyger - Focus Technologies

Scott Stark

Anatoly Ackerman

Tom Coleman

Aaron Mulder

Cuong Tran

Joseph King

Jim Utter

Installation & Configuration
Download the Pet Store

You can get the source from Sun's J2EE Download Page. It's in the "J2EE Blueprints" package. Download the 1.1.2 version. Unpack it anywhere. The root directory of the Pet Store demo is referred to below as $PETSTORE.

Download the JBoss Pet Store patch file

Running the Pet Store demo in JBoss requires several minor changes to deployment files in the Pet Store application (.ear) file. The current patch file, jps112-01.zip is currently available in the documentation files section of the manual.

Configure JBoss

You need a servlet container to run the Java Pet Store. If you're using the JBoss-Jetty or JBoss-Tomcat releases, the server is preconfigured.

Select a Database

The Pet Store demo uses the Cloudscape database by default.

The Pet Store demo theoretically should work with just about any JDBC compliant database. However, to avoid problems with SQL syntax doing a Product Search, use Cloudscape if at all possible.

Rebuild the Pet Store application (petstore.ear)

The following step overwrites several files in the Pet Store application sources. You may want to make a separate copy of the JBoss version of the Pet Store.

This step adds the file jboss-web.xml to the WEB-INF directory in petstore.war, modifies the serverType in the web.xml file of that directory to identify the JBoss server to the application, and modifies the application.xml file in the META-INF directory of petstore.ear.

Copy the jps112-01.zip file to the root directory ($PETSTORE) of your Pet Store distribution. Change to this directory and unzip the file.

Note: This will overwrite the original web.xml file.


cd $PETSTORE
unzip jps1.1.2-01.zip


Rebuild the Pet Store application.

Run build.sh or build.bat in the $PETSTORE/src/petstore/src/build directory.

The result is a new petstore.ear in the $PETSTORE/src/petstore/build directory.

This is the file you deploy by copying it to $JBOSS_HOME/deploy

Add DB Pools to JBoss

The JBoss Pet Store patch file includes the file jboss.jcml. This file defines Pet Store DB Pools for JBoss 2.4 using Cloudscape on port 1098.

Cloudscape uses port 1099 by default. JBoss uses port 1099 for JNDI.

If you will be using a different database, you will need to define the appropriate DB pools for your database. See Chapter 3 for details

Prepare the Database

Modify the Cloudscape startup command to use port 1098.

You do this by adding -port port_number. For example:

java ... RmiJdbc.RJJdbcServer -port 1098 COM.cloudscape.core.JDBCDriver
Start Cloudscape.

Add JARS to JBoss

Copy your DB driver JAR to the lib/ext directory of your JBoss installation ($JBOSS_HOME).

For Cloudscape, copy client.jar and RmiJdbc.jar to the lib/ext directory.

Copy tools.jar from the J2 SDK to the lib/ext directory of your JBoss installation ($JBOSS_HOME).

Start JBoss

Start JBoss and copy the new petstore.ear to the deploy directory. You should see JBoss deploy the Pet Store EJBs.

Run the Pet Store

Point your browser to http://your-server-name.your-domain:8080/estore to start the Pet Store.

---Anurag
 
DVVN Sudhakara Rao
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I followed all the steps. I am getting an error Unable to connect to the database. In JBOSS Console it is showing the following errors.

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:592)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:185)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
at org.jboss.Main.boot(Main.java:145)
at org.jboss.Main$1.run(Main.java:399)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.SecurityException: Invalid authentication attempt, principa
l=null
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubjec
t(BaseConnectionManager2.java:666)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
onnection(BaseConnectionManager2.java:495)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
nManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
erDataSource.java:102)
at org.jboss.mq.pm.jdbc2.PersistenceManager.getConnection(PersistenceMan
ager.java:1267)
at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(Pers
istenceManager.java:216)
at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceMana
ger.java:1360)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:60)
... 87 more
10:29:33,453 INFO [JmsXA] Bound connection factory for resource adapter for Con
nectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/JmsXA'
10:29:33,593 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C
:/jboss-3.2.5/server/default/deploy/jmx-console.war/
10:29:34,859 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C
:/jboss-3.2.5/server/default/tmp/deploy/tmp25304web-console.war/
10:29:35,468 INFO [EARDeployer] Init J2EE application: file:/C:/jboss-3.2.5/ser
ver/default/deploy/petstore.ear
10:29:37,640 WARN [DeploymentInfo] Only the root deployment can set the loader
repository, ingoring config=null
10:29:37,906 INFO [EjbModule] Deploying TheInventory
10:29:38,171 INFO [EjbModule] Deploying TheCart
10:29:38,203 INFO [EjbModule] Deploying TheCatalog
10:29:38,359 INFO [EjbModule] Deploying TheProfileMgr
10:29:38,437 INFO [EjbModule] Deploying TheMailer
10:29:38,531 INFO [EjbModule] Deploying TheShoppingClientController
10:29:38,625 INFO [EjbModule] Deploying TheSignOn
10:29:38,750 INFO [EjbModule] Deploying TheOrder
10:29:38,750 INFO [EjbModule] Deploying TheAccount
10:29:38,765 INFO [EjbModule] Deploying TheCustomer
10:29:38,875 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/inventoryEjb.jar
10:29:38,968 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/shoppingcartEjb.jar
10:29:39,031 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/personalizationEjb.jar
10:29:39,046 WARN [StatelessSessionContainer] No resource manager found for mai
l/MailSession
10:29:39,078 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/mailerEjb.jar
10:29:39,109 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/petstoreEjb.jar
10:29:39,156 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/signonEjb.jar
10:29:39,234 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.5/server/default/t
mp/deploy/tmp25305petstore.ear-contents/customerEjb.jar
10:29:39,281 INFO [TomcatDeployer] deploy, ctxPath=/estore, warUrl=file:/C:/jbo
ss-3.2.5/server/default/tmp/deploy/tmp25305petstore.ear-contents/petstore.war/
10:29:39,546 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-3.2.5/
server/default/deploy/petstore.ear
10:29:39,578 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
Packages waiting for a deployer:
org.jboss.deployment.DeploymentInfo@83207d9a { url=file:/C:/jboss-3.2.5/server/d
efault/deploy/web.xml }
deployer: null
status: null
state: INIT_WAITING_DEPLOYER
watch: file:/C:/jboss-3.2.5/server/default/deploy/web.xml
lastDeployed: 1097729979578
lastModified: 1097729979562
mbeans:

Incompletely deployed packages:
org.jboss.deployment.DeploymentInfo@298761db { url=file:/C:/jboss-3.2.5/server/d
efault/deploy/cloudscape-service.xml }
deployer: org.jboss.deployment.SARDeployer@12bb7e0
status: null
state: FAILED
watch: file:/C:/jboss-3.2.5/server/default/deploy/cloudscape-service.xml
lastDeployed: 1097729968203
lastModified: 1097729968171
mbeans:

org.jboss.deployment.DeploymentInfo@83207d9a { url=file:/C:/jboss-3.2.5/server/d
efault/deploy/web.xml }
deployer: null
status: null
state: INIT_WAITING_DEPLOYER
watch: file:/C:/jboss-3.2.5/server/default/deploy/web.xml
lastDeployed: 1097729979578
lastModified: 1097729979562
mbeans:

MBeans waiting for other MBeans:
ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
state: CREATED
I Depend On: jboss.mq:service=Invoker
jboss.web:service=WebServer

Depends On Me:
ObjectName: jboss.mq:service=StateManager
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS

Depends On Me: jboss.mq:service=DestinationManager
MBeanException: org.jboss.mq.SpyJMSException: Error creating connection to the d
atabase.; - nested throwable: (java.lang.SecurityException: Invalid authenticati
on attempt, principal=null)
Cause: org.jboss.mq.SpyJMSException: Error creating connection to the database.;
- nested throwable: (java.lang.SecurityException: Invalid authentication attemp
t, principal=null)
ObjectName: jboss.mq:service=DestinationManager
state: CREATED
I Depend On: jboss.mq:service=MessageCache
jboss.mq:service=PersistenceManager
jboss.mq:service=StateManager

Depends On Me: jboss.mq.destination:service=Topic,name=testTopic
jboss.mq.destination:service=Topic,name=securedTopic
jboss.mq.destination:service=Topic,name=testDurableTopic
jboss.mq.destination:service=Queue,name=testQueue
jboss.mq.destination:service=Queue,name=A
jboss.mq.destination:service=Queue,name=B
jboss.mq.destination:service=Queue,name=C
jboss.mq.destination:service=Queue,name=D
jboss.mq.destination:service=Queue,name=ex
jboss.mq:service=SecurityManager
jboss.mq.destination:service=Queue,name=DLQ

ObjectName: jboss.mq:service=PersistenceManager
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS

Depends On Me: jboss.mq:service=DestinationManager
RuntimeMBeanException: java.lang.SecurityException: Invalid authentication attem
pt, principal=null
Cause: java.lang.SecurityException: Invalid authentication attempt, principal=nu
ll
ObjectName: jboss.mq.destination:service=Topic,name=testTopic
state: CREATED
I Depend On: jboss.mq:service=DestinationManager
jboss.mq:service=SecurityManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Topic,name=securedTopic
state: CREATED
I Depend On: jboss.mq:service=DestinationManager
jboss.mq:service=SecurityManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Topic,name=testDurableTopic
state: CREATED
I Depend On: jboss.mq:service=DestinationManager
jboss.mq:service=SecurityManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=testQueue
state: CREATED
I Depend On: jboss.mq:service=DestinationManager
jboss.mq:service=SecurityManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=A
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=B
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=C
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=D
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me:
ObjectName: jboss.mq.destination:service=Queue,name=ex
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me:
ObjectName: jboss.mq:service=Invoker
state: CREATED
I Depend On: jboss.mq:service=TracingInterceptor

Depends On Me: jboss.mq:service=InvocationLayer,type=HTTP
jboss.mq:service=InvocationLayer,type=JVM
jboss.mq:service=InvocationLayer,type=UIL2

ObjectName: jboss.mq:service=TracingInterceptor
state: CREATED
I Depend On: jboss.mq:service=SecurityManager

Depends On Me: jboss.mq:service=Invoker

ObjectName: jboss.mq:service=SecurityManager
state: CREATED
I Depend On: jboss.mq:service=DestinationManager

Depends On Me: jboss.mq.destination:service=Topic,name=testTopic
jboss.mq.destination:service=Topic,name=securedTopic
jboss.mq.destination:service=Topic,name=testDurableTopic
jboss.mq.destination:service=Queue,name=testQueue
jboss.mq:service=TracingInterceptor
jboss.mq.destination:service=Queue,name=DLQ

ObjectName: jboss.mq.destination:service=Queue,name=DLQ
state: CREATED
I Depend On: jboss.mq:service=DestinationManager
jboss.mq:service=SecurityManager

Depends On Me:
ObjectName: jboss.mq:service=InvocationLayer,type=JVM
state: CREATED
I Depend On: jboss.mq:service=Invoker

Depends On Me:
ObjectName: jboss.mq:service=InvocationLayer,type=UIL2
state: CREATED
I Depend On: jboss.mq:service=Invoker

Depends On Me:

MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.mq:service=StateManager
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS

Depends On Me: jboss.mq:service=DestinationManager
MBeanException: org.jboss.mq.SpyJMSException: Error creating connection to the d
atabase.; - nested throwable: (java.lang.SecurityException: Invalid authenticati
on attempt, principal=null)
Cause: org.jboss.mq.SpyJMSException: Error creating connection to the database.;
- nested throwable: (java.lang.SecurityException: Invalid authentication attemp
t, principal=null)
ObjectName: jboss.mq:service=PersistenceManager
state: FAILED
I Depend On: jboss.jca:service=LocalTxCM,name=DefaultDS

Depends On Me: jboss.mq:service=DestinationManager
RuntimeMBeanException: java.lang.SecurityException: Invalid authentication attem
pt, principal=null
Cause: java.lang.SecurityException: Invalid authentication attempt, principal=nu
ll

10:29:40,515 INFO [Server] JBoss (MX MicroKernel) [3.2.5 (build: CVSTag=JBoss_3
_2_5 date=200406251954)] Started in 21s:62ms
10:29:40,515 INFO [Tomcat5] Saw org.jboss.system.server.started notification, s
tarting connectors
10:29:40,562 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808
0
10:29:40,734 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
10:29:40,750 INFO [JkMain] Jk running ID=0 time=0/79 config=null
10:34:32,609 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl [Format
Id=257, GlobalId=satrun//1, BranchQual=] timed out. status=STATUS_ACTIVE


Can any body help me out
Thanks in advance
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
BTW,what version of Jboss were you using and what database you were trying to connect(Mysql, Hsql etc.) and their versions.Did you copied the JDBC connector jar file to the lib directory of JBoss?

Regards,
Karthik
reply
    Bookmark Topic Watch Topic
  • New Topic