Win a copy of Securing DevOps this week in the Security forum!

Vo Hien

Greenhorn
+ Follow
since Mar 27, 2007
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 Vo Hien

Hi Everyone,

I am a java developer but new to J2ME platform. I want to set up the environment to develop some J2ME apps but I don't know which tools need to be installed and what are they used for?

Please suggest me some links that have that kind of information to download and setup environment (on Eclipse IDE).

Regards,
Hien




8 years ago

Hi Everyone,
I am working with JXTable and I add an dataModel to the table. The dataModel contains about 200 items. One of the item is selected as default (The checkbox in the row is selected) when the table is displayed.

When the selected row is about 180, the table will not display the selected row, because all the items in display inside a scrollpane, so when can see only the first item(ex: from 0 ->50).

How can we set the table so that when the table is displayed, it will show the selected row as default.

Thanks and regards,
Hien

8 years ago

Hi Everyone,

I run a java desktop application that has the multithread run inside, I open it and not use it for a period of time (go out for lunch) about 30 minutes. When I come back,
the application is hangup. I wonder if the multithread run inside the application that cause the JVM running out of the memory.

Anyone please help me about this.

Thanks,
Hien

Hi friends,
I am developing a web application using JSF. The requirements is that the web app will support multi user. Each user has an count to login to the web app.

Depend on the user account, the web pages will display the the theme for that specific user (differnt theme or user interface for the same content). That means differnt user log in to the web app will have different theme but the same content.

Do you have any solutions for this requirements.
Thank and Regards,
Hien
10 years ago
JSF
Hi,
I use java code to create a Datasource as below:

Properties props = new Properties();
props.setProperty("hibernate.connection.driver_class", "net.sourceforge.jtds.jdbc.Driver");
props.setProperty("hibernate.connection.url", "jdbc:jtds:sqlserver://hienvo:1433;databaseName=SkillPortMaster");
props.setProperty("hibernate.connection.username", "sa");
props.setProperty("hibernate.connection.password", "VoHi!");
props.setProperty("hibernate.connection.pool_size", "2");

DataSource myDataSource = BasicDataSourceFactory.createDataSource(props);

where BasicDataSourceFactory is the class that I import from
import org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory; (naming-factory-dbcp.jar)

But I get an error as below:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.skillsoft.mgs.email.queued.EmailDispatcher.<init>(EmailDispatcher.java:52)



Do you have any idea for this error ?
Regards,
Hien
Hi,
I have a list of text and I want to display the text random position, random text and random font color for each text in the JSP page.

Do you have any example or suggestion for this ?

Thank you in advance !!!
Hien Vo
10 years ago
JSP
Hi,

Does Tomcat 5.5 Auto deploy DataSource (When Tomcat is startup and you make change to the DataSource in the Server.xml file) ?
Regards,
Hien
10 years ago
Hi,
My project uses Hibernate to lookup datasource. The datasource name is in the hibernate.cfg.xml file.

The rule of my web app is that the datasource info will be written in to the server.xml file after Tomcat 5.5 already startup. I follow the rule but when I start up Tomcat 5.5, it has an error because Hibernate Configuration needs a datasource name when Tomcat startup.

My questiion is:
Are there any ways to use Hibernate with a Datasource info added to the server.xml file when Tomcat 5.5 already startup.
Do you have any solution for this.

Thank you in advance !
Hi friends,

I deploy my web application in to Tomcat 5.5.20 and it got an error in the log file as below:

Do you know the reason why and how to fix it.

Regards,



2007-12-05 16:47:34,250 [main] ERROR Digester - Digester.getParser:
org.xml.sax.SAXNotRecognizedException: Feature: http://apache.org/xml/features/validation/dynamic
at org.apache.crimson.parser.XMLReaderImpl.setFeature(XMLReaderImpl.java:213)
at org.apache.crimson.jaxp.SAXParserImpl.setFeatures(SAXParserImpl.java:143)
at org.apache.crimson.jaxp.SAXParserImpl.<init>(SAXParserImpl.java:126)
at org.apache.crimson.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:113)
at org.apache.crimson.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:141)
at org.apache.commons.digester.parser.XercesParser.configureXerces(XercesParser.java:185)
at org.apache.commons.digester.parser.XercesParser.newSAXParser(XercesParser.java:138)
at org.apache.commons.digester.ParserFeatureSetterFactory.newSAXParser(ParserFeatureSetterFactory.java:73)
at org.apache.commons.digester.Digester.getParser(Digester.java:682)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:891)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2007-12-05 16:47:34,250 [main] ERROR ActionServlet

javax.servlet.UnavailableException
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:368)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
10 years ago
Hi Ben,
I am developing two different web apps A and B. I deploy them in the two Tomcat servers (different port) on the same computer.

Web app A is an add-on of web app B.
One web app A can have one to many web app B.
Depend on the request from the browser, the database conective information (datasource) will be identified. This information will be used in the datasource for the conection to the database. This means that the datasource is identified when Tomcat is start up but it is a must for the connection to the database.

So my question is:
If I write the datasource information to the server.xml file when Tomcat 5.5 is start up. WILL THE HOT DEPLOY OF DATASOURCE HAPPEN?


If the hot deploy happens, what about the time it takes to redeploy (this is necessary for the app performance)?

Regards
10 years ago
Hi Friends,

My web application need to connect to many databases by using multi datasource. But the datasources is not allowed to be in the server.xml file when the Tomcat 5.5 is start up. It (datasource) must be configurated when Tomcat is already start up.

Do you have any solution to deploy a datasource when Tomcat is start up without restarting the Tomcat (hot deploy) ?

Thank you and regards,
Hien Vo
Hi Friends,

My web application need to connect to many databases by using multi datasource. But the datasources is not allowed to be in the server.xml file when the Tomcat 5.5 is start up. It (datasource) must be configurated when Tomcat is already start up.

Do you have any solution to deploy a datasource when Tomcat is start up without restarting the Tomcat (hot deploy) ?

Thank you and regards,
Hien Vo
10 years ago
Hi Friends,
I have a problem with Hibernate and DataSource.
Currently my project is using Hibernate. The *.CFG.XML file contains information for loading ONE database from the SQL Server 2005. So, the project only can use one database.

My purpose is to use two databases in the project with the Hibernate.

Do you have any suggestion , example or solutions for this problem.

Many thanks and regards,

Hien Vo
Thank you very much for your reply.

I have tried with the struts2-showcase-2.war file and I solved the problem.

The problem is that I don't have a .properties file.

Thank you.
11 years ago
Dear Friends,

I have problems when using Struts 2

I use an iterator tag to display a list in jsp file.

<s:iterator value="%{functionList}" id="functionList">
<tr class="table-item">
<td >
<s roperty value="id" />
</td>
<td id="item-left">
<s roperty value="functionName" />
</td>
<td id="checkbox">
<s:checkbox name="view" value="%{view}" theme="simple"/>
</td>
<td id="checkbox">
<s:checkbox name="add" value="%{add}" theme="simple"/>
</td>
<td id="checkbox">
<s:checkbox name="delete" value="%{delete}" theme="simple"/>
</td>
<td>
<s:checkbox name="update" value="%{update}" theme="simple"/>
</td>
</tr>
</s:iterator>

functionList is a property (LinkedList) of a JavaBean and I implements two interfaces ModelDriven and Prepareble in the Action class. I can display the functionList successfully in the Jsp file but when I click on the Submit button to update the information, in the Action class I receive an null functionList while I expect an list with value that I have changed in the jsp file.

My question is how to get the the list(with the information has been changed) from jsp file and update it to database. What tag should be use to display a list of data and still remain the the changed data in Action class.

Thank you very much indeed.
11 years ago