on 04-29-2008 1:41 AM
Hi,
Can somebody help me resolving this warning?
Description:
1. Warning exception has been returned while the 'sap.com/JDBCTestJBEAR' was starting. Warnings:
Warning occurred on server 3425650 during startApp sap.com/JDBCTestJBEAR : Application sap.com/JDBCTestJBEAR has a weak reference to resource MY_PRODIN_DB with type javax.sql.DataSource but the resource is not available and the application may not work correctly.
Many thanks,
Dharmi
Edited by: Dharmi Tanna on Apr 29, 2008 2:44 AM
Hi Dharmi,
Go to nwa and check whether the resouce MY_PRODIN_DB is currently running.
For doing this you have
1. Go to nwa by url http://<host-name>:<port number>/nwa
2. Go to Configuration management
3. Select Infrastrucutre
4. Select Application Resources
There check whether your resource is ingreen(fully available) or not.
If not start it
Hope it helps.
Regards,
Srinivasan Subbiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dharmi,
Is your code not working?
I think it is just a warning and you can go ahead to execute and see whether it works.
Also check whether you code for lookup is correct.
public static final String DATASOURCENAME="jdbc/MYSQLDB_DS1_ALIAS1";
ctx=new InitialContext();
ds=(DataSource)ctx.lookup(DATASOURCENAME);
This is an example with MYSQLDB_DS1_ALIAS1 as a custom alias.
Hope it helps.
Regards,
Srinivasan Subbiah
Hi Srinivasan,
I do see the WSDL, but when I execute it from WS navigator, I get the following error:
javax.ejb.EJBException: Exception in getMethodReady() for stateless bean sap.com/ProdinSQLEJBEARannotation|ProdinSQLEJB.jarannotation|ProdinPartsBean; nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException: javax.ejb.EJBException: Cannot perform injection over bean instance service.ProdinPartsBean@56a2601e for bean sap.com/ProdinSQLEJBEARannotation|ProdinSQLEJB.jarannotation|ProdinPartsBean; nested exception is: com.sap.engine.lib.injection.InjectionException: Injection on field em of instance service.ProdinPartsBean@56a2601e failed. Could not get a value to be injected from the factory.
Any ideas?
Best regards,
Dharmi
Hi dharmi,
Ok. Just try puting this code in and check whether it works. This is what i uased after creating the data source.
public static final String DATASOURCENAME="jdbc/MYSQLDB_DS1_ALIAS1";
/**
* Constructor for initialization
*/
private DAOFactory(){
Context ctx=null;
try{
ctx=new InitialContext();
ds=(DataSource)ctx.lookup(DATASOURCENAME);
}
catch(NamingException ne){
PLogger.getInstance().logException(CLASSNAME,"DAOFactory()",ne);
}
}
Hope it helps.
Regards,
Srinivasan Subbiah
Hi,
You are right. Just write a DAOFactory class.
This DAOFactory is going to have two methods and one private constructor.
1. Private Constructor- is where the context is lookedup for datasource. This is the code i gave you.
2. getInstance()- just checks whether a DAOFactory object exits if not creates a new one. In this way you maiontain only one connection at any time.
3. getConnection()- creates the connection from the datasource object you created.
From the class where you want to create a connection and execute a statement, first just call the getInstance()(static method). Then call getConnection() using the object you got from getInstance().
getConnection will return a Connection using which you can execute any statement.
This i think is the standard procedure.
Hope it is clear and helps you.
Regards,
Srinivasan Subbiah
Hi Srinivasan,
I am now getting the following error when testing the Web Service from WS Navigator.
javax.ejb.EJBException: Exception in getMethodReady() for stateless bean sap.com/JDBCTestJBEARannotation|JDBCTestEJB.jarannotation|ProdinEmpBean; nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException: java.lang.NullPointerException
Can you help?
Thanks much,
Dharmi
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.