Rácz György

Greenhorn
+ Follow
since Nov 12, 2008
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 Rácz György

Hi uttam kumar!

I am using Liferay 5.2 SP4 bundled with JBoss. I think my problem is that, JBoss doesn't picked up correctly my jboss-log4j.xml.

<category name="com.geosoft">
<priority value="WARN" />
<appender-ref ref="LIFERAY"/>
</category>

But if i modify the jboss-log4j.xml, the category settings load correctly, and works. It works only modify the .xml file. Why?

You think, if i create log4j.properties every portlet, the log messages is write correctly the liferay.log or server.log?

Thanks for you help
Geo
10 years ago
Hello All!

Sorry for my bad english!

I am writing simple JSP portlet application, i want to log the details. So i am using the log4j which is in jboss/server/default/conf folder.
The content of jboss-log4j.xml is as follows:



I have inserted a appender and a category (com.geosoft) in the jboss-log4j.xml, but after server started still my data are logged to the console
not in liferay.log file.



After i modified jboss-log4j.xml (insert some enter), i am finding that it is hanging on the line below (via the console):
14:46:49,308 INFO [Log4jService$URLWatchTimerTask:599] Configuring from URL: resource:jboss-log4j.xml

Then liferay.log and server.log file is cleared and WORKS FINE (contains this):



I think that, when start jboss as, doesn't load jboss-log4j.xml fully...

Please help me to solve this....

Thanks for you help
Geo
10 years ago
Hi Gurus!

Sorry for my bad english!

I am trying to create an J2ME midlet application. This application is received data from Nokia SU-1B digital pen over bluetooth Obex connection. At the time of the first running of the program I paired (pin pairing) the phone and the digital pen device.

When the pen is sending data the phone (Nokia E50-1) is start automatic bluetooth device search process. I would like to disable the automatic bluetooth device search process! I don't understand that who and why starts it! I check my source code, but my bluetooth device search method doesn't run here.

On my other phone (Sonny Ericcson k750) everything is work fine. (No automatic bluetooth device search process, when the pen sending datas).

OS: Win XP
IDE: NetBeands IDE 6.7.1
WTK 2.5.2 CLDC 1.1 and MIDP 2.0
Phones: Nokia E50-1 (probleam), Sonny Ericcson k750 (good)

If anyone has the solution please help me!

Thanks in Advance!!!

George
12 years ago
Hi Gurus!

Sorry for my bad english, im still learn it.
I have a big probleam. My J2ME application receive files from bluetooth connection, and i need to know the current time when the datas received. I tried many way to get accurate current time, but im always get inaccurate time (2hrs before the actual time). I checked my system time, and i set and use my location TimeZone settings etc. I use winXP and NetBeans 6.7.1 This is my test code:



When i running this code i received this:

cal1: Mon Sep 07 07:25:00 UTC 2009
cal2: 1252308300917
sBuf: 9/7/2009 8:25:0

The accurate current time is : 9:35...

In Eclipse ive got:

cal1: Mon Sep 07 09:36:07 CEST 2009
cal2: 1252308967467
sBuf: 9/7/2009 8:36:7

This code (cal1) is work fine in Eclipse J2SE...

Please help me! Thanks!

George
12 years ago

R�cz Gy�rgy wrote:

William Brogden wrote:Is there a reason you are using raw sockets?

Why not use the classes in the standard Java library - see the java.net package for classes like HttpURLConnection. This is a class designed to handle all the tricky socket details for you.

Bill



Hi Bill!

Here is some line from my NewsAction source code. If statusCode = 301 vagy 302 (site redirect) then I need read RSS xml file with Socket.

How I read redirected site with HttpURLConnection?



Thank you! Please post example source code...

Best regards!




Hi Coders!

I found what is the problem...I copy my source code and create a new thick (not a web app) java program, this java code work fine, I received the RSS XML file. Then I comment the following lines in my new thick java application, and I received same IOException: java.net.SocketTimeoutException: Read timed out exception as my web application. So in Apache webapp I can't write my request to the Socket. I dont know why! Can anybody help me? Why I cannot write to the output socket OutputStream?

William Brogden wrote:Is there a reason you are using raw sockets?

Why not use the classes in the standard Java library - see the java.net package for classes like HttpURLConnection. This is a class designed to handle all the tricky socket details for you.

Bill



Hi Bill!

Here is some line from my NewsAction source code. If statusCode = 301 vagy 302 (site redirect) then I need read RSS xml file with Socket.

How I read redirected site with HttpURLConnection?



Thank you! Please post example source code...

Best regards!
Hi Coders!

I set up socket.setSoTimeout(2000); then I receive java.net.SocketTimeoutException: Read timed out. The socket connected: true and socket closed: false.

How can I read the socket correctly?
How can I handle SocketTimeoutException?

Please help me!
Hi!

Sorry for my bad english! I have got a big problem... I develop struts web application java 6 with apache tomcat. This web application one most important function is read RSS sites. One RSS site (www.ft.com/rss/world) redirected (statusCode = 302), so I connect this site with Socket and send GET /rss/world HTTP/1.0 User-Agent: Wget/1.9.1 message, respose I give RSS site in XML format. This is work fine in sample java programme, but not in web application.
Simple java program source code:


And here is my web application class code:


When the program execute on while ((str = rd.readLine()) != null) { then nothing happend...no exception but my web app not response!

Please help me!
This is the prod. server UserStoage.class decompiled code:

public User getUser(Integer integer, Connection connection)
throws SQLException
{
PreparedStatement preparedstatement;
ResultSet resultset;
preparedstatement = null;
resultset = null;
User user;
preparedstatement = connection.prepareStatement("SELECT * FROM USRD WHERE USID=?");
preparedstatement.setInt(1, integer.intValue());
resultset = preparedstatement.executeQuery();
if(resultset.next())
{
user = getUserFromResultSet(resultset);
addOffice(user, connection);
addProjects(user, connection);
addPositions(user, connection);
addVacations(user, connection);
} else
{
user = null;
}
if(null != resultset)
try
{
resultset.close();
}
catch(SQLException sqlexception)
{
logger.fatal(sqlexception);
}
if(null != preparedstatement)
try
{
preparedstatement.close();
}
catch(SQLException sqlexception1)
{
logger.fatal(sqlexception1);
}
break MISSING_BLOCK_LABEL_196;
Exception exception;
exception;
if(null != resultset)
try
{
resultset.close();
}
catch(SQLException sqlexception2)
{
logger.fatal(sqlexception2);
}
if(null != preparedstatement)
try
{
preparedstatement.close();
}
catch(SQLException sqlexception3)
{
logger.fatal(sqlexception3);
}
throw exception;
return user;
}

This is a UserStorage source code:

public User getUser(Integer userId, Connection connection) throws SQLException{
User user = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = connection.prepareStatement("SELECT * FROM USRD WHERE USID=?");
stmt.setInt(1, userId.intValue());

rs = stmt.executeQuery();
if (rs.next()) {
user = getUserFromResultSet(rs);
addOffice(user, connection);
addProjects(user, connection);
addPositions(user, connection);
addVacations(user, connection);
} else {
user = null;
}

} finally {
if (null != rs) {
try {
rs.close();
} catch (SQLException e) {
logger.fatal(e);
}
}
if (null != stmt) {
try {
stmt.close();
} catch (SQLException e) {
logger.fatal(e);
}
}
}

return user;
}

Can anybody help me?
Sorry!

I'm was very tired when put this code...the UserStorage has a many user set and get methods. This is the correct code:

Test



Prod



Sorry...
If i not use -dis parameter, then Jad create readable output too.
(Jad UserStorage.class)
DJ Java Decopiler create more readable result:
Test:



Production

Hi Shailesh!

I decompiled local and production UserStoage.class files. Here is the result:
I used this command: jad -dis UserStorage.class

Test UserStorage.class:

production:

Every methods different on parameter names.
Hi Shailesh!

Ok! I download the program and decompile .class files.

I say thank you for the help!

George