Per Lovdinger

Ranch Hand
+ Follow
since Jun 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Per Lovdinger

WSAD 5.1.2 - DB2 DSRA8100E: Unable to get a XAConnection from the DataSource
============================================================================
When trying to retrive a XA-connection using a datasource version, I get an exception. See below
(I have DB2 Connect installed)


Info:
----
Operating system= Windows 2000
IDE= WSAD 5.1.2
Database type= Ibm DB2
Jdbc provider type= DB2 Legacy CLI-based Type 2 JDBC Driver (XA)
Implementation class name= COM.ibm.db2.jdbc.DB2XADataSource
Jdbc driver= db2java.zip
datasource version= 5

Exception:
2005-03-30 23:55:39:059 CEST] 387c0a6d SystemOut O TestDataSource ataSource com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@6a64ca4e
[2005-03-30 23:55:40:532 CEST] 387c0a6d FreePool E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource sid/sidDB_XA, throwing ResourceAllocationException. Original exception: com.ibm.ws.exception.WsException: DSRA8100E: Unable to get a XAConnection from the DataSource.
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:244)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:171)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:208)
at com.ibm.ws.rsadapter.DSConfigurationHelper.getPooledConnection(DSConfigurationHelper.java:777)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:641)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:726)
at com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1281)
at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:1065)
at com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1603)
at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:677)
at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:461)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:217)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:192)
at TestDataSource.doSelect(TestDataSource.java:60)
at TestDataSource.doGet(TestDataSource.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672)
Caused by: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1032N Inget kommando f�r att starta databasen har getts. SQLSTATE=57019

at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.connect(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Connection.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2ReusableConnection.<init>(Unknown Source)
at COM.ibm.db2.jdbc.DB2PooledConnection.getConnection(Unknown Source)
at COM.ibm.db2.jdbc.DB2XAConnection.<init>(Unknown Source)
at COM.ibm.db2.jdbc.DB2XADataSource.getXAConnection(Unknown Source)
at COM.ibm.db2.jdbc.DB2XADataSource.getXAConnection(Unknown Source)
at com.ibm.ws.rsadapter.DSConfigurationHelper$1.run(DSConfigurationHelper.java:759)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:111)
at com.ibm.ws.rsadapter.DSConfigurationHelper.getPooledConnection(DSConfigurationHelper.java:754)
... 32 more
---- Begin backtrace for nested exception
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] SQL1032N Inget kommando f�r att starta databasen har getts. SQLSTATE=57019

at CO
18 years ago
Info:

<message-resources parameter="ApplicationResources" factory="MyOwnFactory"
class=MyOwnConfig"
>
<set-property property="xProp" value="xValue"/>
</message-resources>
MyOwnFactory extends PropertyMessageResourcesFactory
MyOwnFactory instansiates MyOwnMessageResources
MyOwnMessageResources extends PropertyMessageResources
MyOwnConfig extends MessageResourcesConfig
MyOwnConfig has a property called xProp


Problem:
How can my class MyOwnMessageResources access property in MyOwnConfig ?
Is there a static method somewhere in Struts api ?


thanks in advance
18 years ago
Hi there,

I have a question concerning validator framework:

If have the same attribute for example salary in two forms is there any possibility
to define the validation rule in one place.
So that my form-field can depend on that rule.

regards


<form-validation>
<formset>

<form name="userFormVF">
<field property="userId" depends="required">
<arg0 key="prompt.userId"/>
</field>
<field property="salary" depends="double">
<arg0 key="prompt.salary"/>
</field>
</form>

<form name="userFormDVF">
<field property="userId" depends="required">
<arg0 key="prompt.userId"/>
</field>
<field property="salary" depends="double">
<arg0 key="prompt.salary"/>
</field>
</form>
</formset>
</form-validation>
19 years ago
Environment:
J2EE 1.3
WebSphere Studio Application Developer (Windows)
Version: 5.1.1
===================================================================
Title: Connection to JMS from J2EE-Client
===================================================================
Hi there,
Have a couple of questions:
1: In my deployment descriptor for the j2ee-client,since I want to make a call to
JMS, I need to create references to QueueConnectionFactory and Queue.
How should I declare them as resource-references or resource-environment-references ?

2: I tried to declare them as resource-references, but I'm not sure how I do a
proper lockup.
When I do a lockup I get a reference to a "Reference-object" which I can't cast to a Queue for example.
How do I get a handle to the Queue and QueueConnectionFactory ?
*** My lockup locks like this:
String jndiQueue = "java:comp/env/jms/myOeeQueue";
Object obj = ctx.lookup(jndiQueue);
Is there a better way to do a lockup from the client ?
regards
Per
Hi All,
My environment: wsad 5.1.1 J2EE 1.3
I'm trying to run this scenario for test purpose:
Servlet -> Messaging Bean -> EJB Session bean
The servlet starts the the Messaging Bean using a Connection factory and queue.
In the web-deployment descriptor I have declared them as refererences.
This works fine.
I get the messaging bean to start, but then I get an exception in messaging bean
doing lockup for the Session Bean.
In the EJB deployment the 2 EJB beans are declared.
I'm confused over how I should do a lockup to the session bean from the messaging bean
1. Should I create a new InitialContext ?
Context ctx = new InitialContext();
2. I have tested with this:
Context ctx = new InitialContext();
String name = "ejb/jmstest/ValidationBeanLocalHome";
Object objref = ctx.lookup(name);

and this:
Context ctx = new InitialContext();
String name = "java:comp/env/ejb/jmstest/ValidationBeanLocalHome";
Object objref = ctx.lookup(name);

Help regarding this deeply appreciated.
..Per
======================= EJB Deployment ========================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>JMSTestEJB</display-name>
<enterprise-beans>
<session id="TestFacade">
<ejb-name>TestFacade</ejb-name>
<home>jmstest.TestFacadeHome</home>
<remote>jmstest.TestFacade</remote>
<local-home>jmstest.TestFacadeLocalHome</local-home>
<local>jmstest.TestFacadeLocal</local>
<ejb-class>jmstest.TestFacadeBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref id="ResourceRef_1080135215816">
<description></description>
<res-ref-name>jms/myQueueConnectionFactory</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref id="ResourceEnvRef_1080132922692">
<description></description>
<resource-env-ref-name>jms/myQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</session>
<message-driven id="TestMDB">
<ejb-name>TestMDB</ejb-name>
<ejb-class>jmstest.TestMDBBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
<session id="ValidationBean">
<ejb-name>ValidationBean</ejb-name>
<local-home>jmstest.ValidationBeanLocalHome</local-home>
<local>jmstest.ValidationBeanLocal</local>
<ejb-class>jmstest.ValidationBeanBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
Web deployment descriptor ======================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>JMSTestWeb</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<resource-ref id="ResourceRef_1081168157808">
<res-ref-name>jms/MyConnectionFactoryRef</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-ref id="ResourceRef_1081168223965">
<res-ref-name>jms/MyQueueRef</res-ref-name>
<res-type>javax.jms.Queue</res-type>
<res-auth>Application</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<ejb-local-ref id="EJBLocalRef_1080132757050">
<ejb-ref-name>ejb/myFacade</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>jmstest.TestFacadeLocalHome</local-home>
<local>jmstest.TestFacadeLocal</local>
<ejb-link>JMSTestEJB.jar#TestFacade</ejb-link>
</ejb-local-ref>
<ejb-local-ref id="EJBLocalRef_1081237979566">
<ejb-ref-name>ejb/myValidation</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>jmstest.ValidationBeanLocalHome</local-home>
<local>jmstest.ValidationBeanLocal</local>
<ejb-link>JMSTestEJB.jar#ValidationBean</ejb-link>
</ejb-local-ref>
</web-app>
Hi,
The problem is this:
When I deploy different Java applications, it could be war applications,
ordinary application, in most cases it's practical to use a propertyFile
so that the properties are not hardcoded.
Sometimes I want to deploy the application to Windows and sometimes it could be Unix.
I'm using ant as a deployment tool...
The problem is that I do not want to hardcode the location of the propertyFile.
One idea would be to:
- create a text file "propertyFileLocation.txt" where the location is edited
- put that file in the jar file
- and have the application to read the location from the jar
Does anyone have a better idea ?
thanks in advance,
Per
20 years ago
Hi,
If I have a jar file which also includes a text-file,is there any way I can read that text-file
from another class in the same Jar ?
Thanks in advance
Per
20 years ago
Thanks, my locale is Swedish, so I will try to
initialize a gregorian date with the swedish
locale and see if that works...
20 years ago
Hi,
Question about gregorian date...
I initialize a GregorianCalendar to the 4th of January of 2005 like this:
Calendar newCal = new GregorianCalendar(2005,0,4);
System.out.println("Week is =" + newCal.get(Calendar.WEEK_OF_YEAR));
it prints out
Week is =2
The problem is that the 4th of January of 2005 actually is week 1.
What am I doing wrong ???
Thanks in advance ...
Per
20 years ago
I want to calculate the exact number of seconds between 2 times
in this format: String yyyymmddmmss.
public int secondsBeteen(String fromTime,String toTime)

Anyone that have a good approach for this ?

thanks in advance
Per
20 years ago
Hi,
I have a ServletA that forwards requests to ServletB.
ServletA reads a file as a stream and that stream should be passed to ServletB as
inputStream. How can this simpliest be achieved ?
I know that ServletA can open an urlConnection and write to that ?
Is that the only solution ?
thanks in advance
21 years ago
Hi,
From an Java-application I want to call a servlet with a post request that includes a text-file
in the inputstream.
How do I do that ? I tried the following,but I'm confused about how the servlet can read the stream .
URL url = new URL("http://plovdinger:80/xmlReceiver");
URLConnection uc = url.openConnection();

uc.setDoOutput(true);
OutputStream os = uc.getOutputStream();

OutputStream buf = new BufferedOutputStream(os);
OutputStreamWriter out = new OutputStreamWriter(buf,"8859_1");
out.write("one little line\r\n");
out.write("Two little line\r\n");
out.flush();
out.close();

//return the response
readInputStream(uc.getInputStream());
21 years ago
Hi,
In a http scenario I want to communicate between 2 system sending and receiving xml-files over the internet:
So that the request should include one xml-file and the response should include one xml file.
What is the recommended mechanism to include xml-file content for a request ?
- As parameter ?
- As inputStream with character data ?
- some other way
What is the recommended mechanism to include xml-file content for a response ?
- As outputStream with character data ?
- some other way
thanks in advance
Per
Hi,
When parsing a big xml-document using DOM I get
a OutOfMemoryError.
I'm using apache.xerces as parser.
I read that a "deferred DOM" might solve the problem.
What is the syntax in xerces to use a "deferred DOM" when I parse ?
..thanks in advance Per
Hi,
Is Swing included in the exam,I don't see it
in the objectives....
Can I completely ignore it ?
..Per