This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!

Shamu Somasundaram

Ranch Hand
+ Follow
since Aug 25, 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 Shamu Somasundaram

Hi,
In my mail application, I am using blockquote for mails in html as follows:


header="<br><br><br><blockquote style=\"PADDING-LEFT: 5px; MARGIN-LEFT: 0px; BORDER-LEFT: #0000ff 2px solid\">
-----Original Message-----\n";
req.setAttribute("body", header +cleanHtml.getContent() + "</blockquote>");

A left border will appear in the original message. But if I want to introduce some text or new line in this original text,
and press enter, the left border should not be dispalyed for the new line.
You can try this as it is available in Gmail when u reply to a mail in html content
I know it is something with css, but can't get the idea. Can anyone help me on how to do this.


Thanks,
Shanmugavel.

Originally posted by vishwanath nadimpally:
fname = new String(fname.getBytes(),"UTF-8");

Why do you need this? you can just use the file name as it is.



no..it didn't work..the name was appearing as junk even then..
can anyone help me out?
14 years ago
Hi,
I want to display the file name in Unicode when I download the file.
In IE it's not displaying properly.

My code goes like this

res.setContentType("application/octet-stream;charset=UTF-8");
fname = new String(fname.getBytes(),"UTF-8");
res.setHeader("Content-Disposition", "attachment; filename=\"" + fname + "\"");

When I run eclipse in debug mode, the filename is displayed properly in Watch expression. But while downloading in IE, in Save As dialog box, the file name appears as junk characters.
Can any of the ranchers help me out?

Thanks in advance.
Shanmugavel
14 years ago
Hi,
I am implementing multi-language support(I18N) for mails.
I am facing an issue while exporting the address contacts which are stored in multi-languages. If I save the address contacts .csv file, all the foreign languages characters are displayed as ??? in csv file. So I am not able to import the same CSV file in my program. How can I get the correct characters in UTF-8 charset?
Has any one done this before? Pls help in solving this issue.
Thanks in advance,
Shanmugavel.
14 years ago
here is my code..

Session session = HibernateUtil.getSession();
Query crit = session.createQuery("select msg from com.model.Messages msg where msg.messageId="+messageId);


List msg = crit.list();

Thanks,
Shan
[ August 18, 2006: Message edited by: Shanmugavel Gnanasambandham ]
HI,
I am getting this null pointer when I try to retrieve any records from db. but insertion of data into db works fine. Has anyone faced this? Pls help.

java.lang.NullPointerException
at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372)
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:869)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:838)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.EntityType.resolve(EntityType.java:303)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.earthlink.elnkads.dao.HomeDAO.getPosts(HomeDAO.java:98)
at com.earthlink.elnkads.handler.HomeHandler.getPosts(HomeHandler.java:82)
at com.earthlink.elnkads.presentation.home.HomeAction.execute(HomeAction.java:81)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372)
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:869)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:838)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.EntityType.resolve(EntityType.java:303)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.earthlink.elnkads.dao.HomeDAO.getPosts(HomeDAO.java:98)
at com.earthlink.elnkads.handler.HomeHandler.getPosts(HomeHandler.java:82)
at com.earthlink.elnkads.presentation.home.HomeAction.execute(HomeAction.java:81)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by:
Hi,
I was connection to Oracle 10g database from my application.
I am not able to get the connection as I am getting the following error. I have the latest driver ojdbc.jar. Has anyone faced this before? Please help me.

Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:318)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1492)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at Test.main(Test.java:13)
Caused by: java.sql.SQLException: Io exception: Got minus one from a read call
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:315)
... 12 more
can anyone file B1-visa when his H1-B interview is after 5 months from now. I just want to know if there could be any problems when a person appears for h1-B after having already B1 stanped very recently.
pls share your opinions and experiences..
14 years ago
Hi,
I was also in the same situation. I waited for two weeks. No replies from them. So I joined another company. But after that, I got the ofer letter from them and they started calling me asking my joining date :-)
So better decide whether to move on or keep waiting.
Regards,
Shanmugavel.
14 years ago
Hi,
In our application, we are using two datasources. One for writing to database and another for reading. Now in Hibernate how can I create the session factory for two datasources and how will I determine which data source has to be used for getting the connection?
Normally what will be the approach for such a scenario?
Please give your inputs.
Thanks in advance.
Shanmugavel.
Hi,
I have got an offer from CTS Chennai. I have couple of other offers also.
I have 3.5 yrs exp in Java/J2EE. Just want to know how CTS chennai is.
I am given the designation of Associate. Can anyone working in CTS tell me what level in the hierarchy does Associate stand?
Thanks,
Shanmugavel.
15 years ago
Hi All,
In our application, Useers are authenticated from LDAP. LDAP will return me the user id of the logged in user after authentication. Infact I am using personppidx attribute to get the user id of the logged in person.
Now, If the logged in user belongs to some lotus mail group in LDAP, how will I get the mail group the user belongs to from my Java class.

My cosde for getting the user id goes like this.

NamingEnumeration enum = ctx.search("","uid="+userName,new SearchControls(SearchControls.SUBTREE_SCOPE,0,0,null,true,true));

while(enum.hasMoreElements())
{
Attributes attrs = ((SearchResult)enum.next()).getAttributes();
}
while(enum.hasMoreElements()){
Attributes attrs = ((SearchResult)enum.next()).getAttributes();
Attribute attr = attrs.get("personppidx");
if(attr != null)
ppidx = (String) attr.get(0);

if(ppidx == null){
enum = ctx.search("","cn="+userName,new SearchControls(SearchControls.SUBTREE_SCOPE,0,0,null,true,true));

while(enum.hasMoreElements()){
Attributes attrs = ((SearchResult)enum.next()).getAttributes();
if(attrs != null){
Attribute attr = attrs.get("personppidx");
if(attr != null)
ppidx = (String) attr.get(0);
}


}
}

so ppidx returns me the user id.
But I'm not finding any attributes giving me the details whether the user belongs to a mail group or not.
Please suggest me some ways to get the details of the mail gropu the person belongs to.

Thanks in advance.
Shanmugavel.
15 years ago
Hi,
In my application,I want to skip the LDAP authentication for a particular action.
In fact I want to call an action before the login action in my application.
Any action will be executed only if the LDAP authentication is done. If not, it will prompt the user to the login page.
But I want a particular action to be exempted for this LDAP authentication.
Please suggest me some ways to do this.

I have given in my web.xml as follows:


<Security-constraint id="SecurityConstraint_1">
<web-resource-collection id="WebResourceCollection_1">
<web-resource-name>LDAPAuthenticationRes</web-resource-name>

<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<description>LDAPAuthenticationRealm:+:</description>
<role-name>APPAdministrator</role-name>
</auth-constraint>
<user-data-constraint id="UserDataConstraint_1">
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config id="LoginConfig_1">
<auth-method>FORM</auth-method>
<realm-name>LDAPAuthenticationRealm</realm-name>
<form-login-config id="FormLoginConfig_1">
<form-login-page>login.jsp</form-login-page>
<form-error-page>loginErr.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description></description>
<role-name>APPAdministrator</role-name>
</security-role>

Thanks,
Shanmugavel.
15 years ago

Originally posted by trupti nigam:
Where is this consulting company located.I mean which state in US? If it's from California then the pay they are offering is very less as california is expensive state.
If you come to know how much the client is paying them for the position that they are trying to feel, you will be really surprised by the difference of the salary that the client is offering and what you are getting in hand.
Also I am very much sure that big clients in US are generally looking for people with more that 5/6+ years of experience. And if this consulting firm is so confident to place you to one of their big clients, I am 100% sure that they will ask you to modify your resume to fit the client job description. So When you will appear for the client interview , your resume will say person with 6/7 years of experience. This is the reality of US job market. and the people with less experience are getting placed like this.
I have seen some real examples.
I do not want to scare you but this is the reality.




Thank you Trupti and everyone for informing the real situation..well I was asked to appear in person with the HR manager of that firm and I was disapointed to have heard what they said.
They asked me for a bond of INR 90,000 and I will have to attend interviews to grab a job after going to US. till then they said they will give a stipend of 500 USD till I get a job. I thought it's a very good company. the company's name is softwareart in mumbai. And also they asked me to book flight ticket on my own cost which they say they will re-imburse in my first salary..
I am greatly disappointed over these developments and have decided to wait to go onsite from my present company. I am just givng my experiences so that other ranchers are aware of these consulting firms who approach people,saying that they would file H1 visa. I really appreciate the ranchers who advised me in such a situation. Also I request all who have been trying to go to US to be very careful in considering any offer from such companies.
Thanks everyone.
15 years ago
Hi All,
I have 2+ yrs of experience in Java/J2EE. I have been contacted by an Indian consulting firm for a job in US.
What they are saying is, they will file H1 visa for me and I will be posted in their US office. After going to US, I will be placed at client side(clients include IBM, deloitte).

I need some advices from you people.

1. How much can I expect as salary ?(they told me that they will offer ranging from 45K to 55 k). How much a person with 33 months of experience in J2EE getting paid working as a contractor?

2. Can I leave my present job relying on this consulting firm? I am presently working for one of the biggest Indian company.

3. I think many of the ranchers from India, work as contractors in US. How good is the US market now? Can anyone please guide me whether I can accpet this offer or not?

Thanks in advance.
Shanmugavel.
15 years ago