Sandeep Bhoyar

Greenhorn
+ Follow
since May 17, 2010
Sandeep likes ...
Hibernate Spring Java
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 Sandeep Bhoyar

Thanks Richard.
10 years ago
Hi,
I am trying to execute sqlcmd from java.but I am getting error,Please check the below given code and let me know what I am doing wrong.



While running sqlcmd from sqlclient its working fine but from Java 7 I am getting error:

Msg 4145, Level 15, State 1, Server SUNIL-PC, Line 1 An expression of non-boolean type specified in a context where a condition is expected, near 'employeeId'.


10 years ago
Hi,

Can any one explain How Annotation internally works.

can any one provide me link of any article where annotation is explained in details.
11 years ago
Hi,

Can any one know how t fetch data from two different schema using hql.

eg:
select orderId,orderDescription from order where companyId = (select companyId from company where id = 23432)

in this company table is in config schema and order table is in trans schema
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<constant name="struts.objectFactory.spring.autoWire.alwaysRespect" value="true" />
<constant name="struts.objectFactory.spring.autoWire" value="Flo" />
<!-- -->


<package name="invoice" namespace="/jsp" extends="struts-default">
<interceptors>
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<interceptor name="SessionVerify" class="net.foodlink.core.common.utils.SessionInterceptor"></interceptor>
<interceptor-stack name="FLODefStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="SessionVerify"/>
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="FLODefStack"/>
<action name="InvPageLoad" class="invoicesAction" method="getPOs" >
<result name="success">invoicelist.jsp</result>
</action>
<action name="InvoiceList" class="invoicesAction" method="getInv" >
<result name="success">invoicelist.jsp</result>
</action>

<!-- Start of Shipping actions -->
<action name="ShippingPageLoad" class="shippingAction" method="getShipHeaderData" >
<result name="success">shippinglist.jsp</result>
</action>
<action name="ShippingPageList" class="shippingAction" method="getShipLineData" >
<result name="success">shippinglist.jsp</result>
</action>
<action name="ShippingListProcess" class="shippingAction" method="getShipProcessData" >
<result name="success">shippinglist.jsp</result>
<param name="actionName">noprint</param>
</action>
<action name="ShippingListDetails" class="shippingAction" method="getShipProcess" >
<result name="success">shippingdetails.jsp</result>
</action>

<!-- Shipping Details -->
<action name="shippingdetails" class="shippingAction" method="getshipdetails" >
<result name="success">shippingdetails.jsp</result>
</action>

<action name="shippingprocess" class="shippingAction" method="shipProcess" >
<result name="success">shippingconfirmation.jsp</result>
</action>
<action name="shippingConfirmation" class="shippingAction" method="displayCon">
<result name="success">shippingconfirmation.jsp</result>
</action>
<!-- End of Shipping actions -->

<!-- Start of receiving actions -->
<action name="receivingList" class="receivingAction" method="getUserProfile">
<result name="success">receivinglist.jsp</result>
</action>
<action name="filterClick" class="receivingAction" method="getPOsForR">
<result name="success">receivinglist.jsp</result>
</action>
<action name="receivingJob" class="receivingAction" method="receivingJob">
<result name="success">receivingconfirmation.jsp</result>
</action>
<action name="receivingdetail" class="receivingAction" method="getPoLinesForR">
<result name="success">receivingdetail.jsp</result>
</action>

<action name="receivingprocess" class="receivingAction" method="polinesProcessForR">
<result name="success">receiveConfirmation.jsp</result>
</action>

<action name="receiveConfirmation" class="receivingAction" method="displayCon">
<result name="success">receiveConfirmation.jsp</result>
</action>


<!-- End of receiving actions -->



<action name="MenuAction" class="menusAction" method="getMenuData">
<result name="success">Menu.jsp</result>
</action>

<!-- For TransMonitor -->
<action name="transMonitor" class="transMonitorAction" method="displayTransError" >
<result name="success">transMonitorError.jsp</result>
</action>
</package>
</struts>
12 years ago
yes Mohan , the Action name is correct. actually I am using custom interceptor also I tired with that also but still i am getting exception

<interceptors>
<interceptor name="tokenSession" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/> -->
<interceptor name="SessionVerify" class="net.foodlink.core.common.utils.SessionInterceptor"></interceptor>
<interceptor-stack name="FLODefStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="SessionVerify"/>
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
</interceptor-stack>
</interceptors>

12 years ago
Hi,

I want to use token session in one of my action shippingAction .Below is given my strut config Details


<action name="shippingdetails" class="shippingAction" method="getshipdetails" >
<interceptor-ref name="tokenSession" />
<interceptor-ref name="basicStack"/>
<result name="success">shippingdetails.jsp</result>
</action>

but I am getting this exception, Can any one know what I am doing wrong


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [shippingAction]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:100)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:227)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:368)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

root cause

java.lang.ClassNotFoundException: shippingAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
org.apache.struts2.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java:111)
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:98)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:385)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:274)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:227)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:368)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.19 logs.
Apache Tomcat/7.0.19
12 years ago
Hi,

Can we write HQL for two different datasource or sessionfactory. if yes, please provide dummy HSQL

here is the part of my query

strQuery =
....
and ((po.punumber != 'Multiple' and cp.splitPoflag = 1) or (cp.splitPoflag = 0))
.....


Hibernate :
....
and (purchaseor0_.PUNumber<>'Multiple' and compprofil4_.SplitPOFlag=1 or compprofil4_.SplitPOFlag=0)
....


I am showing the hql query on console

<prop key="hibernate.show_sql">true</prop>

and I tried the same query directly in SQL SERVER (with parenthesis) its working fine but then I the same query I am using in HSQL its giving me wrong.
I'm using Hibernate and I am facing Problems with OR parenthesis in HQL.
Hibernate removes parenthesis and my search in the database gets broken.
Dose any one know why this is happening and how I can solve this issue.
@ Paul : Can you please share where Generally we set Heap Memory or where we get Heap memory Error ?

@ William : Then Code is workin fine on my QA server this problem I am facing in my local System. William I can't disclose my code but you are right the code that I collect in string builder is bigger can you please share instead of stringBuilder what I can use ?
12 years ago
I am getting out of memory error while running the web appl.

Even though I set the java_opt= -Xms512m -Xmx1024m but still I am getting error . can any one tell me why this is happening

Exception in thread "http-bio-8080-exec-3" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515)
at java.lang.StringBuilder.append(StringBuilder.java:189)


12 years ago

Raja Pal wrote:Please check if the checkbox for auto re-write files is on....not sure if this option is available in Indigo but I remember a similar problem caused me a some trouble way back in 2009 when I was working on Eclipse 3.4 (Ganymede) with webservices plug-in for ant 1.4 and axis 2 with an ant based compilation target! The over-write option saved the trouble of manually starting the server instance. Let me know if that helps!



Thanks Raja. I got the solution....
12 years ago

Raja Pal wrote:@Sandeep: Specifically which version of Axis and Eclipse are you using?



I am using plugin provided by apache foundation http://axis.apache.org/axis2/java/core/tools/index.html

and Eclipse Version: Indigo Release (3.7)
12 years ago