Ramesh Krishna

Greenhorn
+ Follow
since May 17, 2004
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 Ramesh Krishna

Hi,

I am using RAD 7.5.5 to create String binding resource references in web.xml. But i am not getting option to select String reference type like <res-type>java.lang.String</res-type> . Could you please help me the steps to create in RAD 7.5?

Below is the expected output in web.xml.

<resource-ref id="ResourceRef_1187107405678">
<res-ref-name>string/someValue</res-ref-name>
<res-type>java.lang.String</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

Thanks
Ramesh
8 years ago
Hi,

I am having trouble while inserting nodes using JPA with the following mapping.

I am using Hibernate JPA 2.0 and the persistance.xml is like the below

<persistence-unit name="ecc" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:comp/env/jdbc/xxxx</jta-data-source>

<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.transaction.manager_lookup_class" value ="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
<property name="transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
</properties>

-----------------------
I have Master entity and child entity with oneToMany relation like below.

@OneToMany(mappedBy = "userPreference", fetch=FetchType.EAGER)
@org.hibernate.annotations.CascadeType.ALL

When i process the request then it was trying to do two insert statements(according to hibernate logger statements) for the same and getting exception the unique key violation exception.

Please help me.

Thanks


I am using JPA 2.0 and Hibernate JTA transactions. I am having a problem when trying to insert row on a one to many relationship:

my parent Class: public class UserPreference implements Serializable


@OneToMany(mappedBy = "userPreference",fetch=FetchType.EAGER,orphanRemoval=true)
@Cascade(value={org.hibernate.annotations.CascadeType.ALL})
private Set<UserHeader> userHeaders; // child class reference

Child Class:

public class UserHeader implements Serializable

@ManyToOne
@JoinColumn(name="user_sr_id")
private UserPreference userPreference; (Master reference)


When I try to insert a child entity (userHeaders) then it is inserting two rows and the same leading to Unique Key Constraints exception

5/2/11 19:44:24:085 IST] 00000021 SystemOut O Hibernate: select header_.header_uid, header_.attribute_name as attribute2_4_, header_.header_type as header3_4_, header_.mandatory_ind as mandatory4_4_, header_.header_name as header5_4_, header_.header_order_nbr as header6_4_ from ECAB2.header header_ where header_.header_uid=?
[5/2/11 19:44:24:272 IST] 00000021 SystemOut O Hibernate: insert into ECAB2.user_header (creation_date, header_uid, modify_date, header_order_nbr, user_sr_id, user_header_uid) values (?, ?, ?, ?, ?, ?)
[5/2/11 19:44:24:491 IST] 00000021 SystemOut O Hibernate: insert into ECAB2.user_header (creation_date, header_uid, modify_date, header_order_nbr, user_sr_id, user_header_uid) values (?, ?, ?, ?, ?, ?)
[5/2/11 19:44:24:632 IST] 00000022 SystemOut O Hibernate: select docbase0_.docbase_uid as docbase1_2_, docbase0_.docbase_name as docbase2_2_ from ECAB2.docbase docbase0_
[5/2/11 19:44:24:882 IST] 00000022 SystemOut O Hibernate: select objecttype0_.docbase_uid as docbase4_2_1_, objecttype0_.object_type_uid as object1_1_, objecttype0_.object_type_uid as object1_5_0_, objecttype0_.docbase_uid as docbase4_5_0_, objecttype0_.object_type_name as object2_5_0_, objecttype0_.object_desc as object3_5_0_ from ECAB2.object_type objecttype0_ where objecttype0_.docbase_uid=?
[5/2/11 19:44:24:897 IST] 00000021 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1, SQLState: 23000
[5/2/11 19:44:24:897 IST] 00000021 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

[5/2/11 19:44:24:897 IST] 00000021 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1, SQLState: 23000
[5/2/11 19:44:24:897 IST] 00000021 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

[5/2/11 19:44:24:897 IST] 00000021 AbstractFlush E org.hibernate.event.def.AbstractFlushingEventListener performExecutions Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:1057)
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:209)
at $Proxy215.beforeCompletion(Unknown Source)
at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2408)
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1641)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1612)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1547)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:247)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:167)
at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:293)
at com.swissre.ecc.web.ECCTransFilter.doFilter(ECCTransFilter.java:68)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:680)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:588)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:524)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:125)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10768)
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeBatch(WSJdbcStatement.java:705)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 43 more

thank you
Ramesh
I am using JPA 2.0 and Hibernate JTA transactions. I am having a problem when trying to insert row on a one to many relationship:

my parent Class: public class UserPreference implements Serializable


@OneToMany(mappedBy = "userPreference",fetch=FetchType.EAGER,orphanRemoval=true)
@Cascade(value={org.hibernate.annotations.CascadeType.ALL})
private Set<UserHeader> userHeaders; // child class reference

Child Class:

public class UserHeader implements Serializable

@ManyToOne
@JoinColumn(name="user_sr_id")
private UserPreference userPreference; (Master reference)


When I try to insert a child entity (userHeaders) then it is inserting two rows and the same leading to Unique Key Constraints exception

5/2/11 19:44:24:085 IST] 00000021 SystemOut O Hibernate: select header_.header_uid, header_.attribute_name as attribute2_4_, header_.header_type as header3_4_, header_.mandatory_ind as mandatory4_4_, header_.header_name as header5_4_, header_.header_order_nbr as header6_4_ from ECAB2.header header_ where header_.header_uid=?
[5/2/11 19:44:24:272 IST] 00000021 SystemOut O Hibernate: insert into ECAB2.user_header (creation_date, header_uid, modify_date, header_order_nbr, user_sr_id, user_header_uid) values (?, ?, ?, ?, ?, ?)
[5/2/11 19:44:24:491 IST] 00000021 SystemOut O Hibernate: insert into ECAB2.user_header (creation_date, header_uid, modify_date, header_order_nbr, user_sr_id, user_header_uid) values (?, ?, ?, ?, ?, ?)
[5/2/11 19:44:24:632 IST] 00000022 SystemOut O Hibernate: select docbase0_.docbase_uid as docbase1_2_, docbase0_.docbase_name as docbase2_2_ from ECAB2.docbase docbase0_
[5/2/11 19:44:24:882 IST] 00000022 SystemOut O Hibernate: select objecttype0_.docbase_uid as docbase4_2_1_, objecttype0_.object_type_uid as object1_1_, objecttype0_.object_type_uid as object1_5_0_, objecttype0_.docbase_uid as docbase4_5_0_, objecttype0_.object_type_name as object2_5_0_, objecttype0_.object_desc as object3_5_0_ from ECAB2.object_type objecttype0_ where objecttype0_.docbase_uid=?
[5/2/11 19:44:24:897 IST] 00000021 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1, SQLState: 23000
[5/2/11 19:44:24:897 IST] 00000021 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

[5/2/11 19:44:24:897 IST] 00000021 JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: 1, SQLState: 23000
[5/2/11 19:44:24:897 IST] 00000021 JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

[5/2/11 19:44:24:897 IST] 00000021 AbstractFlush E org.hibernate.event.def.AbstractFlushingEventListener performExecutions Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:178)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:1057)
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:209)
at $Proxy215.beforeCompletion(Unknown Source)
at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2408)
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1641)
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1612)
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1547)
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:247)
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:167)
at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:293)
at com.swissre.ecc.web.ECCTransFilter.doFilter(ECCTransFilter.java:68)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:837)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:680)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:588)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:524)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:751)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:125)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (ECAB2.UNIQUE_USER_HEADER) violated

at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10768)
at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeBatch(WSJdbcStatement.java:705)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 43 more

thank you
Ramesh
Hi
we have j2ee application which runs in apache webserver and JBOSS app server. Our requirement is to upload multiple pdf files into DB. we are able to insert small size files but while uploading large size files (like more than 20 MB) , we are getting below exception in browser but backend the process got completed(all files got inserted into DB).

We are getting below exception
The proxy server received an invalid response from an upstream server
The proxy server could not handle the request POST/...
Reason: Error reading from remote server

For work around we have done the below change
----->We have increased the timeout property in httpd.conf file to 5 mins then it is working fine.

But is there any way to resolve this issue without modifying this httpd.conf file .

Please suggest us. It is really urgent.

Thanks in advance.
Ramesh
11 years ago
Hi
we have j2ee application which runs in apache webserver and JBOSS app server. Our requirement is to upload multiple pdf files into DB. we are able to insert small size files but while uploading large size files (like more than 20 MB) , we are getting below exception in browser but backend the process got completed(all files got inserted into DB).

We are getting below exception
The proxy server received an invalid response from an upstream server
The proxy server could not handle the request POST/...
Reason: Error reading from remote server


For work around we have done the below change
----->We have increased the timeout property in httpd.conf file to 5 mins then it is working fine.

But is there any way to resolve this issue without modifying this httpd.conf file .

Please suggest us. It is really urgent.

Thanks in advance.
Ramesh
11 years ago
Hi
Iam printing text like " AAAAAAQ" after that Printer should stop immediately with out scrolling entire paper.
plz help in this regard
14 years ago
Hi

We deployed an ear file on WAS 5.1 Server . This application contains Web, EJB and Application Client Modules. When we run this application , we are getting one problem like

OSEListenerDi E PLGN0021E: Servlet Request Processor Exception: Virtual Host/WebGroup Not Found : The web group /images/cancelation_tick.gif has not been defined

Rest of the things are working fine. The error is coming only for images and they r not displaying in Browser.

Plz help me .

Thanks in advance.
14 years ago
hi all,

we are greatfull for your valuable response

we are developing an project using j2ee & WSAD 5.1.1, we have a reusable module,which will be used in future appl's which has been packaged separately into
1) applicationclient.jar
2) Ejb.jar
3) web.war

currently we are developing an enterprise appln in which we want to use these above said files.......

our current status is that.......

we have placed ApplicationClient.jar and Ejb.jar in Enterprise Project and we are able to use them via classpath...

our current problem is........

we want to achieve the same thing for web.war also, so we request you to guide on how best this situation can be handled

note: we are using Struts frame work for front end....so web.war will also have it's own Struts-config.xml file and web.xml.


regards

Ramesh
I mean ... the war file is external file which is exported from diff ear file(diff application).I want to use this war file in new application . so in this application already webcontent is there(web.xml& struts-config.xml). so with out disturbing present application how can i use this war file
Hi Boyarsky,
Thanks for ur reply.
The thing is ...how to call this war file in that project ...Can I put that in /WEB-INF/lib? Tell me what r the ways to run the war file like import is the war file is one way like that.
Hi
In WSAD5.1.1 , J2EE Project How to use war file .
Can I put that in /WEB-INF/lib? Tell me what r the ways to run the war file

Thanks in Advance
Hi Guys,

I am Using WSAD 5.1.1 ,J2EE Project(Struts based application). I am developing J2EE Appication. In This application i want to reuse some other application war file(external war file).

*)what are the ways to use that war file in my present application.

*)Import the war file into present webmodule. Its working fine .But I want different way like it should not mix with this web module files

Is there any way plz suggest me
Hi

Context ctx = new InitialContext(this.props);
Object obj = ctx.lookup("local:ejb/ejb/MemberHome");
....
.
.

Try this may be it will work
Hi Guys,
I developed one J2EE Project on WSAD 5.1.1...
I have one more application ejb jar file is there. so i have to use that ejb jar in my current application . so i added that jar file in WEB-INF/lib/
folder in WEB Project .But its not recognising the JAR file . The JNDI name not found is coming .Is It right way to add that jar ..otherwise how and where to add that jar ...how to run that jar...

PLZ Help me

Thanks in Advance