Sunoo Varghese

Greenhorn
+ Follow
since Sep 11, 2004
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 Sunoo Varghese

Any tips on where the problem could be? Does anyone know about XSun processes and how it is used by sun's AWT toolkit??
17 years ago
Has anyone got the following error message before..

java.lang.InternalError: Error code 9:
at sun.awt.motif.CheckExitCodeRunnable.run(PSPrintControl.java:602)
at java.lang.Thread.run(Thread.java:479)

Our application has a functionality using which the application users can print manually something known as a worksheet through a print button available in the screen. Also it automatically prints the worksheet when the first activity is done in the worksheet. Our problem is that the application prints the worksheet automatically but when the user tries to manually print it we get the above error.

The application initially generates and keeps the document to be printed into a particular directory structure in the server and then it prints the document from directory structure. The application uses an Xsun process that is configured on the Solaris Box. We tried restarting the Xsun process and then the application server instance as some suggested over here. But that also did not solve the problem.

Initially we thought that the file permissions in the the directory structure would have been changed and had that checked. But it seems thati has not changed. Moreover, both the QA and the Prod environments (on different servers ) are configured to the same Printers but both of them are having the same problem. All this would point to some problem being on the Hardware (ie the Printer) but then it gets printed the first time.

Any pointers on where to look next would be really appreciated. Thanks a lot..

Regards,
Sunoo
17 years ago
Has anyone got the following error message before..

java.lang.InternalError: Error code 9:
at sun.awt.motif.CheckExitCodeRunnable.run(PSPrintControl.java:602)
at java.lang.Thread.run(Thread.java:479)

Our application has a functionality using which the application users can print manually something known as a worksheet through a print button available in the screen. Also it automatically prints the worksheet when the first activity is done in the worksheet. Our problem is that the application prints the worksheet automatically but when the user tries to manually print it we get the above error.

The application initially generates and keeps the document to be printed into a particular directory structure in the server and then it prints the document from directory structure. The application uses an Xsun process that is configured on the Solaris Box. We tried restarting the Xsun process and then the application server instance as some suggested over here. But that also did not solve the problem.

Initially we thought that the file permissions in the the directory structure would have been changed and had that checked. But it seems thati has not changed. Moreover, both the QA and the Prod environments (on different servers ) are configured to the same Printers but both of them are having the same problem. All this would point to some problem being on the Hardware (ie the Printer) but then it gets printed the first time.

Any pointers on where to look next would be really appreciated. Thanks a lot..

Regards,
Sunoo
17 years ago
Thanks Mandar & Martin.. Will try that out..
17 years ago
Hi,

This is the code that write the file to the location. I just noticed that the closing of the DataOutputStream has not been handled properly. Could that be the cause of this problem?
public static void writeToFile(String stFile, String stFileBody, String mfgCode) throws Exception {

DataOutputStream dataOs = new DataOutputStream( new BufferedOutputStream(new FileOutputStream(stFile, false)));
if(!"VL".equals(mfgCode))
{
dataOs.writeUTF(stFileBody);
}
else
{
int count = 0;
while(count+4096 <= stFileBody.length())
{
dataOs.writeUTF(stFileBody.substring(count,count+4096));
count += 4096;
}
dataOs.writeUTF(stFileBody.substring(count,stFileBody.length()));
}
dataOs.close();
}

Sunoo
17 years ago
Hi Guys,

Could someone please help me on this. This problem occurs quite regularly and i've been sitting here scratching my head for quite sometime.
We've got an application that posts XML is an particular folder and after that our application reads the XMLs from that folder and processes the XML. However , of late, we've been noticing that in the error logs there have been lots of FileNotFoundException exceptions been thrown. The stack trace that we get is as follows..

java.io.FileNotFoundException: /XYZ/unix/cen/WebSphere/AppServer/POE/ORDER/InboundXml20060522191616451.xml (Too many open files)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:135)
at java.io.FileOutputStream.<init>(FileOutputStream.java:89)
at com.ford.pms.externalinterface.inbound.utils.FileIOUtils.writeToFile(FileIOUtils.java:25)
at com.ford.pms.externalinterface.inbound.utils.InboundRequestManager.processInterfaceRequest(InboundRequestManager.java:451)
at com.ford.pms.externalinterface.inbound.service.InboundSOAPReceiverServlet.doPost(InboundSOAPReceiverServlet.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:721)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:374)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:118)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:154)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:317)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:391)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:274)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)

Any suggestion on what the problem could be? I believe that this problem does not occur often. And that it occurs only when there are lots of files to be processed. Because of this problem our application fails to update the information being posted at times.. We are using Solaris and Websphere Application Server..


Sunoo
17 years ago
For the record, #2.
18 years ago
Tim & Praveena,

Thanks a lot guys. Would try implementing your suggestions and get back.

Regards,
Sunoo
18 years ago
Hi,

I would like to know whether anyone has come across the following error trace. Could someone please suggest a solution for the same. We have been stuck up with this issue for quite sometime now. What is even more frustrating is that the code seems to be working perfectly allright on our local development workspace (Web Sphere Application Developer 4.0.1). However when the code is deployed on the Web Sphere Application Server (4.0) we get this error. Is this some error with the code or is something to do with the servers it is being deployed on.Any Suggestions?

Thanks in Advance. Any Help would be really appreciated.

Regards,
Sunoo

[7/27/05 18:49:32:761 SGT] 4f1541 WebGroup X Servlet Error: : java.lang.ExceptionInInitializerError: java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:147)
at org.apache.soap.util.xml.XMLParserUtils.refreshDocumentBuilderFactory(Unknown Source)
at org.apache.soap.util.xml.XMLParserUtils.<clinit>(Unknown Source)
at org.apache.soap.rpc.Call.invoke(Unknown Source)
at com.ford.pms.externalinterface.outbound.utils.SOAPOutboundTransportHandler.processOutbound(SOAPOutboundTransportHandler.java:67)
at com.ford.pms.externalinterface.outbound.handler.RequestResponseHandler.sendRequest(RequestResponseHandler.java:67)
at com.ford.pms.externalinterface.outbound.handler.PartsAvailabilityHandler.process(PartsAvailabilityHandler.java:42)
at com.ford.pms.externalinterface.outbound.handler.RequestResponseHandler.processRequest(RequestResponseHandler.java:36)
at com.ford.pms.externalinterface.outbound.utils.RequestResponseManager.process(RequestResponseManager.java:118)
at com.ford.pms.parts.struts.PartsOrderAction.perform(PartsOrderAction.java:1436)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at com.cts.yardelligent.utils.YardelligentServlet.process(YardelligentServlet.java:208)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:721)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:374)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:118)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:154)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:317)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:391)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:284)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)
18 years ago
Thanks a lot sanat.

Regards,
Sunoo
18 years ago
Hi,

I am getting the following Parsing Exception when i try to run my code using Hibernate.

"The content of element type "class" must match "(meta*,(cache|jcs-cache)?,(id|composite-id),discriminator?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,(subclass*|joined-subclass*))"."

Could someone please give an insight on what the error might be. I think it has to do with something regarding my User.hbm.xml.

The Code is as follows.

===================================User.hbm.xml============================
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>

<class name="User" table="loginInfo">
<property name="userName" column="user_name"/>
<property name="password" column="password"/>
<property name="accountNumber" column="account_number"/>
</class>
</hibernate-mapping>


==============================hibernate.cfg.xml============================

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/accountsDB</property>
<property name="connection.username">root</property>
<property name="connection.password">satyam</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">2</property>
<!-- SQL dialect -->
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<mapping resource="User.hbm.xml"/>
</session-factory>
</hibernate-configuration>

==================================== ================================
And i get my session factory object by doing...

sessionFactory = new Configuration().configure().buildSessionFactory();


Thanks & Regards,
Sunoo
Tried Out your code. Seems to be perfectly fine for me. Probably its just that you have to restart the server once you have made some change in your struts config.

Regards,
Sunoo
18 years ago
Hi,

I recently downloaded a plugin (jseditor) from the sourceforge site. However i have not been able to configure the Plugin in my WSAD(Version 5.1). I have copied the jar file into the plugins folder in eclipse. Is there anything else i have to do? Please do help me out. Looking forward to some responses.

Thanks & Regards,
Sunoo
18 years ago
Hi Ramina,

I cannot understand your requirement. Why do you have to explicitly call the action form reset method?

Regards,
Sunoo
18 years ago
Hi Stu,

Have not tried what you are asking for but i guess this article would help you in doing what you trying to achieve. The whole article (Struts Best Practices ) can be read @ http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts.html

Regards,
Sunoo

Safeguard your JSP pages
Problem
When developers use Web-based applications, they often try to break into the security. The most common habit is to view the source of HTML in the browser and somehow determine the path of JSP pages and access them. The intent is to highlight the vulnerability of JSP pages accessible without authorization. Users who lack authorization to view the source might observe the source URL while sitting with another user who is authorized to work on that specific screen. Later, this unauthorized user could log in to the application and type the URL in the browser. In some cases, such users are able to make their way through.

Struts best practice
The possible solutions to this problem:


Do not let users access any JSP page directly. The starting page can be an HTML document. Add the following lines to the web.xml file to prevent users from accessing any JSP page directly:

<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>no_access</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
...
</web-app>




The most popular option is to keep JSP pages behind the WEB-INF folder. This has a few tradeoffs. For example, you cannot take the JavaScript/CSS (Cascading Style Sheets) files behind WEB-INF, and if using Struts modules, you may encounter some context-related problems. Refer to the section "Context-Related Problems," which appears later in this article, to circumvent such issues.
The second approach allows some JSP pages (which are not behind WEB-INF) to be visible directly. It does not require a descriptor file entry, therefore the best practice is to keep the pages behind WEB-INF.
[LIST][LIST]
18 years ago