Win a copy of Spark in Action this week in the Open Source Projects forum!

ch praveen

Ranch Hand
+ Follow
since Mar 08, 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 ch praveen

How about using opensource tools like hibernate for object/relational persistence instead of your own implementation for coding all synchronizing
stuff wrt. database and objects in memory. Correct me if I wrongly understood your question.

Best Regards,
Praveen.
13 years ago
Hi Friends,

Hello to all after a long break.

I want to explore the webservices arena in java. I want to create a simple Hello world webservice application.

I have gone through some tutorials and found that there are many ways to implement a webservice - GLUE, AXIS, JAX-WS etc. Anyone guide me what are these libraries for how do we implement webservices in Java.

Feel free to post any good links pertaining to this.

Thanks and regards,
Praveen.
14 years ago
Hi All,

Iam using a clob column in a table, which Iam accessing through java. Sometimes Iam
able to insert rows without any problem. But sometimes various errors are encountered during
insertion into database. Any help is highly appreciated.

platform::
********
oracle 8.1.7
Jbdbc driver:: classes12.jar [found in ora92\jdbc\lib folder of oracle 8]

database structure::
*******************
XLDOCUMENT
----------
PREFIX VARCHAR2(30) not null,
ENGINEID VARCHAR2(40) not null,
INITIALENGINEID VARCHAR2(40) not null,
WFDURL VARCHAR2(255) not null,
WFDNAME VARCHAR2(50) not null,
WFDREVISION VARCHAR2(40) not null,
WFINSTANCEID VARCHAR2(40),
EXPRESSIONNAME VARCHAR2(40) not null,
EXPRESSIONID VARCHAR2(50),
XLDOC CLOB not null


Java method that insert rows in XLDOCUMENT table::
************************************************




Exceptions List::
****************
1]
Caused by: java.sql.SQLException: Io exception: Unexpected packet
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at openwfe.org.xlob.XlobSessionImpl.store(XlobSessionImpl.java:510)
... 10 more

---------

2]
2005-12-22 17:03:55,005 [Thread-31] DEBUG openwfe.org.xlob.XlobSessionImpl - fei.getExpressionId() = 0.0.1.0
2005-12-22 17:03:55,036 [Thread-36] INFO openwfe.org.sql.ds.OwfeDataSource - isConnectionInvalid() Yes : java.sql.SQLException: Io exception: Bad packet type
2005-12-22 17:03:55,036 [Thread-31] DEBUG openwfe.org.sql.ds.OwfeDataSource - releaseConnection()
2005-12-22 17:03:55,036 [Thread-36] DEBUG openwfe.org.sql.SqlUtils - closeStatement() problem when disposing of sql resources
java.sql.SQLException: Io exception: Size Data Unit (SDU) mismatch
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:648)
at openwfe.org.sql.SqlUtils.closeStatement(SqlUtils.java:91)
at openwfe.org.sql.ds.OwfeDataSource.isConnectionInvalid(OwfeDataSource.java:251)

--------

3]
2005-12-21 19:23:42,995 [Thread-49] DEBUG openwfe.org.xlob.XlobSessionImpl - fei.getExpressionId() = 0.0.0.1.0
2005-12-21 19:23:42,995 [Thread-55] DEBUG openwfe.org.sql.SqlUtils - closeStatement() problem when disposing of sql resources
java.sql.SQLException: Io exception: Bad packet type
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleResultSetImpl.internal_close(OracleResultSetImpl.java:1466)
at oracle.jdbc.driver.OracleResultSetImpl.close(OracleResultSetImpl.java:92)
at openwfe.org.sql.SqlUtils.closeStatement(SqlUtils.java:90)
at openwfe.org.sql.ds.OwfeDataSource.isConnectionInvalid(OwfeDataSource.java:251)
at openwfe.org.sql.ds.OwfeDataSource.getConnection(OwfeDataSource.java:181)

--------

4]
2005-12-21 19:14:58,657 [Thread-13] DEBUG openwfe.org.xlob.XlobSessionImpl - prepareStatement() for SELECT count(*) / ( fei ee/ee ee ee ee __env__ )
2005-12-21 19:14:58,657 [Thread-13] DEBUG openwfe.org.xlob.XlobSessionImpl - Query for prepared stmt = SELECT count(*) FROM xldocument WHERE prefix = ? AND engineId LIKE ? AND initialEngineId LIKE ? AND wfdUrl LIKE ? AND wfdName LIKE ? AND wfdRevision LIKE ? AND wfInstanceId LIKE ? AND expressionName LIKE ? AND expressionId LIKE ?
2005-12-21 19:14:58,657 [Thread-13] DEBUG openwfe.org.sql.ds.OwfeDataSource - getConnection() (openwfe.org.sql.ds.OwfeOracleDataSource)
2005-12-21 19:14:58,657 [Thread-8] DEBUG openwfe.org.sql.ds.OwfeDataSource - releaseConnection()
2005-12-21 19:14:58,657 [Thread-13] INFO openwfe.org.sql.ds.OwfeDataSource - isConnectionInvalid() Yes : java.sql.SQLException: Refcursor value is invalid
2005-12-21 19:14:58,657 [Thread-13] DEBUG openwfe.org.sql.ds.OwfeDataSource - getConnection() closing old connection
2005-12-21 19:14:58,657 [Thread-13] DEBUG openwfe.org.sql.ds.OwfeDataSource - getConnection() failed to close old connection java.sql.SQLException: Protocol violation


Can any one throw light on what occasion, we shall get these type of exceptions.

Thanks,
Hi All,

Iam newbie to workflow systems. We need to develop a simple workflow as per business requirements and that needs to be integrated with an existing system. As a developer I can use any of the open source workflow engines available such as jBpm and can accomplish this task. Apart from this we need to provide a GUI where user could define/modify a workflow [ drag and drop interface as in case of jBpm eclipse plugin ] deponding on his/her role. We need this as business requirements are quite dynamic causing an impact on existing workflow definition. Whether any workflow ystem supports this type of web-based GUI for editing/modifying a workflow ? Or we need to define a new workflow when business flow changes?


Thanks in advance
Now Iam getting the below stack trace::

javax.naming.NameNotFoundException: HibernateFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.workflow.core.util.MightyUtilities.getHibernateSession(MightyUtilities.java:101)
at com.workflow.session.WorkflowSessionBean.getInbox(WorkflowSessionBean.java:1236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)
15:55:50,980 ERROR [LogInterceptor] Unexpected Error:
java.lang.NoClassDefFoundError: net/sf/hibernate/Session
at com.workflow.core.util.MightyUtilities.closeHibernateSession(MightyUtilities.java:142)
at com.workflow.session.WorkflowSessionBean.getInbox(WorkflowSessionBean.java:1303)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:118)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
at org.jboss.ejb.Container.invoke(Container.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)


I have included a jndi entry for my stateless session bean in jboss.xml. For Hibernate package, what are the corresponding entries to be made and in what configuration files these entries are to be reflected.

Actually, Iam trying to deploy a sample EJB application through eclipse IDE. Can anyone state howto create a sample EJB application through eclipse and what are the steps tobe taken for deployment.

Thanks in advance.
Hi Friends,

After deploying my sample application in jboss 3.2.3 server through eclipse 3.0, I started the jboss server and tried to run the below command.

C:\jdk1.4.1\bin>java -classpath %WORKFLOW_HELP%;C:\jboss-3.2.3\server\default\deploy\WorkflowEjb.jar com.workflow.test.TestClient
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at org.jnp.interfaces.NamingContext.<clinit>(NamingContext.java:102)
at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:41)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.workflow.test.TestClient.getContext(TestClient.java:47)
at com.workflow.test.TestClient.getHome(TestClient.java:32)
at com.workflow.test.TestClient.testBean(TestClient.java:57)
at com.workflow.test.TestClient.main(TestClient.java:97)

Iam getting the same stacktrace by executing the above command even when server is not started. As Iam new to EJB stuff, please guide me in running the above sample EJB application from a command prompt

Thanks in advance
Hi Layne,

Escaping special characters in the pattern and including . at beginning of pattern is the solution. Thanks for your reply.
14 years ago
HI Mani,

I know about FileNameFilter, which is an interface. Actually I want to apply a pattern like *.*, *java* on filenames in accept() method of FileNameFilter. I have included java.util.regexp package to accomplish this, but Iam getting an exception as follows.

Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*str
^
at java.util.regex.Pattern.error(Pattern.java:1489)
at java.util.regex.Pattern.sequence(Pattern.java:1606)
at java.util.regex.Pattern.expr(Pattern.java:1506)
at java.util.regex.Pattern.compile(Pattern.java:1274)
at java.util.regex.Pattern.<init>(Pattern.java:1030)
at java.util.regex.Pattern.compile(Pattern.java:777)
at ListFiles$1.accept(ListFiles.java:19)
at java.io.File.list(File.java:951)
at ListFiles.printList(ListFiles.java:24)
at ListFiles.toString(ListFiles.java:58)
at java.lang.String.valueOf(String.java:2177)
at java.io.PrintStream.print(PrintStream.java:462)
at java.io.PrintStream.println(PrintStream.java:599)
at ListFiles.main(ListFiles.java:75)

As Iam not familiar with regexp package, can anyone suggest how to filter files with pattern *.*, *java*.
14 years ago
HI,

I want to select files from the path specified and as per the file naming pattern provided, for eg. findFiles("c:\fun","*.*") should print all files in the directory c:\fun. Can anyone illustrate an example to accomplish this.

Thanks in advance.
14 years ago
Hi Friends,

What is the regular expression to determine whether a string is empty or not.

It should work when string has either of the values ""(true here),
" "(true here),
" "(true here),
"Hi Hello"(false here)
Hi James,

Thanks for your quick reply. Can you kindly give an example for your answer.
Hello Friends,

Iam creating a simple program which extracts data from any database and stores it in an XML file and also it can extract data from an XML file and updates the database.

My program is just getting the tablename as an input and from that it builds the query (select * from tablename). Through ResultSet, Iam extracting date fields with getDate() method of ResultSet, which is yeilding converted dates [In oracle if date is 23-DEC-1980, Im getting it as 1980-12-23 in java]. Even getString() method of ResultSet doesn't work.
I want my program to work with any database engine, which may have their own date formats. Kindly can anyone suggest me a way to extract date from any database exactly as it is in java.


NOTE:: I can't use to_char(datefield) type commands in SQLQUERY as the only input to my program is tablename and my query is, select * from tablename.

Regards,
Ch.Praveen.
Hello muthu muruges,

For storing binary values, you may use getBytes() or setBytes() methods. Wish you best of luck.

Regards,
Ch.Praveen Kumar.
My initial layout with java.awt.TextArea is posted below for reference::

---------------------
import java.applet.*;
import java.awt.*;

public class LayoutTest_TextArea extends Applet
{

TextArea chatarea;
java.awt.List roomslist,userslist;
TextField input;
Button sendbutton,exitbutton,privatebutton,emoticansbutton,settingsbutton;
Label userslistlbl;

public void init()
{
buildLayout();
}

private void buildLayout() {
Dimension size = getSize();

setBackground(new Color(208,208,236));
setBackground(new Color(255,255,255));
GridBagLayout gbl = new GridBagLayout();
setLayout(gbl);
GridBagConstraints c = new GridBagConstraints();

chatarea = new TextArea("",5,40,1); // v 2
chatarea.setBackground(new Color(255,255,255));

c.gridx = 0;
c.gridy = 0;
//c.fill = GridBagConstraints.HORIZONTAL;
c.fill = 1;
c.weightx = 8.5;
c.weighty = 8;
gbl.setConstraints(chatarea,c);
add(chatarea);

userslist = new java.awt.List(20,false);
userslist.setFont(new Font("SansSerif", Font.BOLD , 12));
userslist.setForeground(Color.gray);

userslistlbl = new Label("Chatters In The Room",Label.CENTER);
userslistlbl.setFont(new Font("SansSerif", Font.BOLD | Font.ITALIC , 12));
userslistlbl.setForeground(Color.gray);
userslistlbl.setBackground(Color.white);

Panel eastpanel = new Panel(); // This is the panel which holds userslist and it's caption.
eastpanel.setBackground(Color.white);
eastpanel.setBackground(Color.white);

GridBagLayout eastpanelgbl = new GridBagLayout();
eastpanel.setLayout(eastpanelgbl);
c.gridx = 0;
c.gridy = 0;
eastpanelgbl.setConstraints(userslistlbl,c);
eastpanel.add(userslistlbl);
c.gridx = 0;
c.gridy = 1;
c.fill = 1;
eastpanelgbl.setConstraints(userslist,c);
eastpanel.add(userslist);

c.gridx = 1;
c.gridy = 0;
c.weightx = 1.5;
c.weighty = 8;
c.fill = 1;
gbl.setConstraints(eastpanel,c);
add(eastpanel);

input = new TextField(32);
input.setEditable(true);
input.setBackground(new Color(255,255,255));

sendbutton = new Button("Send All");
privatebutton = new Button("Send Private");
emoticansbutton = new Button("Emotions");
settingsbutton = new Button("Settings");
exitbutton = new Button("Logout");

sendbutton.setBackground(new Color(255,255,255));
sendbutton.setForeground(new Color(0,90,142));

privatebutton.setBackground(new Color(255,255,255));
privatebutton.setForeground(new Color(0,90,142));

emoticansbutton.setBackground(new Color(255,255,255));
emoticansbutton.setForeground(new Color(0,90,142));

exitbutton.setBackground(new Color(255,255,255));
exitbutton.setForeground(new Color(0,90,142));

settingsbutton.setBackground(new Color(255,255,255));
settingsbutton.setForeground(new Color(0,90,142));

Panel southpanel = new Panel();
southpanel.setLayout(gbl);
southpanel.setBackground(new Color(208,208,236));
southpanel.add(input);
southpanel.add(sendbutton);
southpanel.add(privatebutton);
southpanel.add(emoticansbutton);
southpanel.add(settingsbutton);
southpanel.add(exitbutton);
c.gridx = 0; // Layout Constraints For input
c.gridy = 0;
c.weightx = 5;
gbl.setConstraints(input,c);
c.gridx = 1; // Layout Constraints For sendbutton
c.gridy = 0;
c.weightx = 1;
gbl.setConstraints(sendbutton,c);
c.gridx = 2; // Layout Constraints For privatebutton
c.gridy = 0;
c.weightx = 1;
gbl.setConstraints(privatebutton,c);
c.gridx = 3; // Layout Constraints For emoticansbutton
c.gridy = 0;
c.weightx = 1;
gbl.setConstraints(emoticansbutton,c);
c.gridx = 4; // Layout Constraints For settingsbutton
c.gridy = 0;
c.weightx = 1;
gbl.setConstraints(settingsbutton,c);
c.gridx = 5; // Layout Constraints For exitbutton
c.gridy = 0;
c.weightx = 1;
gbl.setConstraints(exitbutton,c);

c.gridx = 0;
c.gridy = 1;
c.fill=GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty = 2;
c.gridwidth=2;
gbl.setConstraints(southpanel,c);
add(southpanel);

}

}

---------------------

This layout is posing problems when custom multicolor text area component is used.
16 years ago
Hello Craig Wood,

I thank you once again for your interest. It seems that there is no problem with the layout that I have implemented at first. Because when I implement that layout by considering java.awt.TextArea, it's working well when browser containing applet is maximized [in IE - press F11] or restored. The problem is arising when I use multicolor textarea component. I pardon you to kindly examine the multicolor textarea component code that I have posted under this topic, which may be the primary cause of concern.
16 years ago