Author Topic: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.  (Read 74900 times)

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« on: March 03, 2015, 08:58:45 PM »
Hi, I encoutered a problem in running a single workload(specjappserver2004).
In primectrl.out:

[root@client1 SPECvirt]# cat primectrl.out
2015-03-03 17:11:02:676 Tue Mar 03 17:11:02 CST 2015
2015-03-03 17:11:02:731 RMI server started: client1:9990
2015-03-03 17:11:02:735 [INFO] This is a perf-only benchmark run. Skipping active idle polling interval.
2015-03-03 17:11:02:735 PrimeControl: preparing client drivers.
2015-03-03 17:11:02:804 PrimeControl: starting clients...
2015-03-03 17:11:02:867 PrimeControl: PTDs not used for this benchmark run!
2015-03-03 17:11:02:867 PrimeControl: starting 4 masters.
2015-03-03 17:33:00:334 PrimeControl: waiting on 4 prime client(s).
.
2015-03-03 17:33:01:342 setting hostsReady = true
2015-03-03 17:36:12:062 PrimeControl: Workload and prime controller builds: 79


In Clientmgr1_1088.out:

-> INFO: corbaloc url ==> iiop:1.2@specdelivery:3700
-> Initial Audit
-> For txRate(100), loadFactor(5), and load_scale_factor(1.0), your DBIR must be built for 500IR
-> Exception encountered in auditor.validateInitialValues(). Aborting.
-> java.rmi.RemoteException: Failure in calling validateInitialValues() java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
->      java.rmi.RemoteException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB; nested exception is:
->      javax.ejb.EJBException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB


Then I checked the file: 
/opt/glassfish3/glassfish/domains/spec2004-1/logs

[#|2015-03-04T08:52:21.323+0800|SEVERE|glassfish3.1.2|javax.enterprise.resource.jdo.persistencemanager|_ThreadID=116;_ThreadName=Thread-2;|com.sun.jdo.api.persistence.support.JDOFatalUserException: JDO76604: JNDI lookup for cmp-resource 'jdbc/SPECDB' failed.
NestedException: javax.naming.NamingException: Lookup failed for 'jdbc/SPECDB' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: SPECDB not found]|#]

[#|2015-03-04T08:52:21.323+0800|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.entity.lifecycle|_ThreadID=116;_ThreadName=Thread-2;|JDO74004: Bean 'POLineEnt' method setEntityContext:
com.sun.jdo.api.persistence.support.JDOFatalUserException: JDO76604: JNDI lookup for cmp-resource 'jdbc/SPECDB' failed.
NestedException: javax.naming.NamingException: Lookup failed for 'jdbc/SPECDB' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: SPECDB not found]
        at com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunContainerHelper.getPersistenceManagerFactory(SunContainerHelper.java:333)
        at com.sun.jdo.spi.persistence.support.sqlstore.ejb.CMPHelper.getPersistenceManagerFactory(CMPHelper.java:222)
        at org.spec.jappserver.supplier.polineent.ejb.POLineCmp20EJB353820924_ConcreteImpl.jdoLookupPersistenceManagerFactory(POLineCmp20EJB353820924_ConcreteImpl.java:406)
        at org.spec.jappserver.supplier.polineent.ejb.POLineCmp20EJB353820924_ConcreteImpl.setEntityContext(POLineCmp20EJB353820924_ConcreteImpl.java:352)
        at com.sun.ejb.containers.EntityContainer$EntityContextFactory.create(EntityContainer.java:2513)
        at com.sun.ejb.containers.util.pool.NonBlockingPool.preload(NonBlockingPool.java:338)
        at com.sun.ejb.containers.util.pool.NonBlockingPool.doResize(NonBlockingPool.java:586)
        at com.sun.ejb.containers.util.pool.NonBlockingPool$IdleBeanWork.run(NonBlockingPool.java:684)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: javax.naming.NamingException: Lookup failed for 'jdbc/SPECDB' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: SPECDB not found]
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at com.sun.jdo.spi.persistence.support.sqlstore.ejb.SunContainerHelper.getPersistenceManagerFactory(SunContainerHelper.java:302)
        ... 13 more

thanks.

ChrisFloyd

  • Moderator
  • Jr. Member
  • *****
  • Posts: 52
  • Karma: +2/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #1 on: March 03, 2015, 09:05:40 PM »
From the error log, it appears that the database name "SPECDB" is not found when being accessed from the Application server VM.  Can you verify that you can access "SPECDB" from the application server VM?  (Another good test is to access the main SPECjApp application via a web browser from the application server [glassfish] VM, as well as the client VM to ensure all host names are resolved and the database service is up and properly built for SPECDB. )

-Chris Floyd

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #2 on: March 03, 2015, 10:05:34 PM »
I know very little about java,so I made the following test,the database named "SPECDB"  can be accessed from the Application server VM:

[root@appserver ~]# psql -h dbserver1 -U spec -d SPECDB
psql (9.2.5)
输入 "help" 来获取帮助信息.

SPECDB=# \d
                     关联列表
 架构模式 |         名称         |  型别  | 拥有者
----------+----------------------+--------+--------
 public   | c_customer           | 资料表 | spec
 public   | c_customerinventory  | 资料表 | spec
 public   | c_parts              | 资料表 | spec
 public   | c_site               | 资料表 | spec
 public   | c_supplier           | 资料表 | spec
 public   | m_bom                | 资料表 | spec
 public   | m_inventory          | 资料表 | spec
 public   | m_largeorder         | 资料表 | spec
 public   | m_parts              | 资料表 | spec
 public   | m_workorder          | 资料表 | spec
 public   | o_item               | 资料表 | spec
 public   | o_orderline          | 资料表 | spec
 public   | o_orders             | 资料表 | spec
 public   | s_component          | 资料表 | spec
 public   | s_purchase_order     | 资料表 | spec
 public   | s_purchase_orderline | 资料表 | spec
 public   | s_site               | 资料表 | spec
 public   | s_supp_component     | 资料表 | spec
 public   | s_supplier           | 资料表 | spec
 public   | txn_log_table        | 资料表 | spec
 public   | u_sequences          | 资料表 | spec
(21 行记录)

SPECDB=# \q
[root@appserver ~]#

AnoopGupta

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #3 on: March 04, 2015, 02:01:20 PM »
Thanks for the update. It does mean that the App VM is able to access the DB. Next need to verify the following:
[1] Check that the specj application deployed in GlassFish successfully. After starting GlassFish server, check if you are able to access:
http://specdelivery:8000/SPECjAppServer
Otherwise, check GlassFish server log for errors.

[2] Did the load complete successfully for IR500? See https://www.spec.org/forums/index.php?topic=12.0

[3] Verify that database is properly configured and accessible by the SPECjAppServer application on AppServer:
curl http://specdelivery:8000/SPECjAppServer/app?action=atomicityTests
The resulting text should show PASSED for the three Atomicity tests.
Otherwise, check PostgreSQL DB properties configured in /opt/glassfish3/glassfish/domains/spec2004-1/config/domain.xml 


For instruction and scripts to help you setup, please see https://www.spec.org/forums/index.php?topic=15.0

Thanks,
Anoop

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #4 on: March 11, 2015, 03:20:02 AM »
hi :
when I run step 2,I found that there is no table "Llr" in datebase "specdb" and other tables are correct.

when I run step 3,all of three tests are all failed.

please help me to how to check it,thanks a lot.

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #5 on: March 11, 2015, 03:25:35 AM »
in database "specdb":

[root@dbserver opt]# ./getDBcounts.sh
+ psqlpath=
+ dbname=specdb
+ username=spec
+ /psql -s specdb -U spec
./getDBcounts.sh: line 16: /psql: 没有那个文件或目录
+ set +x
[root@dbserver opt]# ./getDBcounts.sh /usr/bin
+ psqlpath=/usr/bin
+ dbname=specdb
+ username=spec
+ /usr/bin/psql -s specdb -U spec
***(单步(Single step)模式:验证命令)*******************************************
select count(*) from c_site ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
     1
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from c_supplier ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
    10
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from c_customer ;
***(按 Enter 键继续或键入 x 来取消)********************
  count 
---------
 3750000
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from c_parts ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 550164
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from c_customerinventory ;
***(按 Enter 键继续或键入 x 来取消)********************
  count   
----------
 28129096
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from o_item ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
 50000
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from o_orders ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 375000
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from o_orderline ;
***(按 Enter 键继续或键入 x 来取消)********************
  count 
---------
 1126178
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from m_parts ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 550164
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from m_bom ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 500164
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from m_workorder ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
 50000
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from m_inventory ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 550164
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from m_largeorder ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
     0
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_site ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
     1
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_supplier ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
    10
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_component ;
***(按 Enter 键继续或键入 x 来取消)********************
 count 
--------
 500164
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_supp_component ;
***(按 Enter 键继续或键入 x 来取消)********************
  count 
---------
 5001640
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_purchase_order ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
 10008
(1 行记录)

***(单步(Single step)模式:验证命令)*******************************************
select count(*) from s_purchase_orderline ;
***(按 Enter 键继续或键入 x 来取消)********************
 count
-------
 49843
(1 行记录)

+ set +x
[root@dbserver opt]#

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #6 on: March 11, 2015, 04:53:30 AM »
test result:

[root@client1 other_scripts]# ./jApp-testappserver.sh
Stopping Appserver (will fail if already stopped)
Waiting for the domain to stop .....
Command stop-domain executed successfully.

Stopping Emulator (will fail if already stopped)
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-openjdk
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Starting Appserver
Waiting for spec2004-1 to start ..............
Successfully started the domain : spec2004-1
domain  Location: /opt/glassfish3/glassfish/domains/spec2004-1
Log File: /opt/glassfish3/glassfish/domains/spec2004-1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
Starting Emulator
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-openjdk
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar

Test Appserver - should show three tests PASSED
Press Enter to continue...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>Atomicity Tests</TITLE>
</HEAD>
<BODY bgcolor="#ffffff" link="#000099" vlink="#000099">

<TABLE width="645" align="left">
                <UL>



                        <FONT size="5" color="#000000"><b>SPECjAppServer2004 Transaction Atomicity Test</b></FONT>
                        <BR></BR>
                </UL>
<P><BR>
</P>
<UL>
        <b>Definition:</b>  The System Under Test must guarantee that all Transactions are atomic; the system will either perform all individual operations on the data, or will assure that no partially-completed operations leave any effects on the data. The tests that were executed with their results below were used to determine if the System Under Test you are operating on meets all the transactional atomicity requirements. If any of the tests have a result of "FAILED" your system is not set up to ensure transaction atomicity
</UL>
<UL>
        <b>Test 1: </b>This test checks to see if the proper transaction atomicity levels are being upheld in transactions associated with the benchmark. This test case drives placing an order for immediate insertion into the dealerships inventory. An exception is raised after placing the order and while adding the inventory to the dealer?s inventory table. This should cause the transaction changes to be removed from the database and all other items returned to how they existed before the transaction took place. This test case has three steps which are as follows to verify atomicity
        <p>
        1.) Query database to check how many inventory items the dealership has, the dealerships account balance, and the number of orders which have been placed for the dealer inside of the dealer domain. These numbers are the initial metrics that the final test cases should line up with after rolling back the transaction.
        </p>
        2.) Drives the above transaction which causes a transaction rollback exception to occur.
        <p>
        3.) Query database to check how many inventory items the dealership has, the dealerships account balance, and the number of orders which have been placed for the dealer inside of the dealer domain. These numbers should equal those in step 1) for the test case to be successful and the transaction to have been atomic.
        </p>

        <LI>Atomicity Test One: <b><FONT color="#ff0000">FAILED</b></FONT></LI><BR></BR>

        <p></p>
        <b>Test 2: </b>This test transaction simply tests that the application server is working properly and that it is able to insert an order as in Atomicity test 1 but without causing the exception and have it show up in the database.
        <LI>Atomicity Test Two: <b><FONT color="#ff0000">FAILED</b></FONT></LI><BR></BR>

        <p></p>
        <b>Test 3: </b>This test checks to see if the proper transaction atomicity levels are being upheld in transaction associated with the benchmark and specifically the messaging subsystem in this test case. This test case drives placing a order which contains a large order and an item to be insert immediately into the dealerships inventory. An exception is raised after placing the order and while adding the inventory to the dealer?s inventory table. This should cause the transaction changes to be removed from the database, messages removed from queue and all other items returned to how they existed before the transaction took place. This test case has three steps which are as follows to verify atomicity.
        <p> 
        1.) Query database to check how many inventory items the dealership has, the dealerships account balance, and the number of orders which have been placed for the dealer inside of the dealer domain. Also the large order table is queried to check how many large orders exist in the database before we drive the transaction. These numbers are the initial metrics that the final test cases should line up with after rolling back the transaction.
        </p>
        2.) Drives the above listed transaction which causes a transaction rollback exception to occur.
        <p>
        3.) Query database to check how many inventory items the dealership has, the dealerships account balance, and the number of orders which have been placed for the dealer inside of the dealer domain. Also query the large order table to check how many large orders there are in the table. These numbers should equal those in step 1) for the test case to be successful and the transaction to have been atomic.
        </p>
        <LI>Atomicity Test Three: <b><FONT color="#ff0000">FAILED</b></FONT></LI><BR></BR>

</UL>
</TABLE>
</BODY>
</HTML>

Test Emulator - should show 200 OK
200 OK

Test Delivery - should show 200 OK
200 OK
[root@client1 other_scripts]#

AnoopGupta

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #7 on: March 11, 2015, 02:41:45 PM »
Likely, GlassFish is not able to create connection to the DB.

You may need to update your pg_hba.conf file for postgresql to allow for the proper connections to the database.

If you still have this issue, please attach and send:
From DB VM:
  • pg_hba.conf
  • /etc/hosts

From AppServer VM:
  • GlassFish domain.xml
  • GlassFish server.log (please provide complete log file)
  • /etc/hosts

Thanks,
Anoop

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #8 on: March 11, 2015, 11:08:56 PM »
Attachment,thanks

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #9 on: March 11, 2015, 11:09:33 PM »
another attachment.

AnoopGupta

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #10 on: March 12, 2015, 02:03:12 AM »
In domain.xml, please try updating all occurrences of jdbc/specdb with jdbc/SPECDB.

If you still have issue, please attach:
  • Updated domain.xml
  • specj.ear

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #11 on: March 12, 2015, 02:47:04 AM »
1.yesterday I updated all occurrences of jdbc/SPECDB with jdbc/specdb in domain.xml,still have this issue

2.attachment Restrictions: 4 per post, maximum total size 192KB,the file size is 1.5M.
/opt/glassfish3/glassfish/domains/spec2004-1/autodeploy/SPECjAppServer.ear

thanks.

AnoopGupta

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #12 on: March 12, 2015, 02:50:35 AM »
Did you build SPECjAppServer.ear yourself or are you using the one included in the benchmark kit?
Could you please try with the ear from the kit, without rebuilding?

Thanks,
Anoop

xxltomail

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #13 on: March 12, 2015, 02:59:03 AM »
I used the ear included in the benchmark kit,thanks.

AnoopGupta

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
Re: Lookup failed for 'jdbc/SPECDB',specvirt fail to run.
« Reply #14 on: March 12, 2015, 02:59:40 AM »
Also check the following from AppServer VM:
[1] ping specdb

[2] psql -h specdb -U spec -d SPECDB

In domain.xml, you have:
<property name="serverName" value="specdb"/>

So, you should be checking connection using specdb and not dbserver1