Ken Liao

Greenhorn
+ Follow
since Dec 15, 2008
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 Ken Liao

Actually we want to find something which works as "jmap" in JDK1.4, any idea about this?
7 years ago
we're maintaining an old EJB production which is still using JAVA 1.4, and now one server is using more and more memory; there is no "jstack" in Java1.4;

Is there any way that we can dump our all the JVM objects? we want figure out which objects cost too much memory and tune it;

Thanks!
7 years ago

Erik Brandsberg wrote:Just a guess, but I would check for DNS resolution issues.



Yeah, actually we found out that it could be DNS issue; our production is using ODA (Oracle Database Appliance‎) box which have two DB nodes (oda1, oda2) clustered;

and then there are two oda-scanners which is working as load balancer in front of the ODA listner; we defined one domain name as "oda-scan" for these two scanner:

Name: oda-scan
Address: xx.xx.xx.35
Name: oda-scan
Address: xx.xx.xx.34


The JDBC URL in weblogic is: jdbc:oracle:thin:@(description=(address=(host=oda-scan)(protocol=tcp)(port=1521))(connect_data=(service_name=xxx)))

The it takes 15s to create new connection, we checked that DNS works fine in weblogic server,

But if we change the URL as: jdbc:oracle:thin:@(description=(address_list=(address=(host=xx.xx.xx.35)(protocol=tcp)(port=1521))(address=(host=xx.xx.xx.34)(protocol=tcp)(port=1521))(load_balance=yes)(failover=yes)) (connect_data=(service_name=xxx)))'; and it works fine;

we have no idea why is this, but after we tried to restart the oda-scanner; and it just works; it could be ODA-SCANNER has something wired settings;




we set up the JDBC Connection pool as below:

<JDBCConnectionPool
Name="ejb-pool"
CapacityIncrement="2"
DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="30"
MaxCapacity="100"
Properties="user=xxxx;password=xxxxx"
ShrinkingEnabled="true"
URL="jdbc:oracle:thin:@//xxxxxx1521/xxxxx"
TestTableName="SQL select 1 from /*wl:jdbc:ejb-pool*/dual"
TestConnectionsOnReserve="true"
ConnLeakProfilingEnabled="false"
StatementCacheSize="10"
Targets="myservers
/>



It takes 15 seconds create each single connection, E.g, by settings, it should init 30 connections when starting up weblogic; and it the log file, we noticed that it takes 15s to create each one:



####<Aug 17, 2014 4:59:26 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001068> <Connection for pool "ejb-pool" created.>
####<Aug 17, 2014 4:59:26 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001132> <Initialized statement cache of size "10" for connection in pool "ejb-pool".>
####<Aug 17, 2014 4:59:41 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001068> <Connection for pool "ejb-pool" created.>
####<Aug 17, 2014 4:59:41 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001132> <Initialized statement cache of size "10" for connection in pool "ejb-pool".>
####<Aug 17, 2014 4:59:57 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001068> <Connection for pool "ejb-pool" created.>
####<Aug 17, 2014 4:59:57 AM GMT> <Info> <JDBC> <eng-xps5> <ncs0> <main> <<WLS Kernel>> <> <BEA-001132> <Initialized statement cache of size "10" for connection in pool "ejb-pool".>




I'm wondering is there any attribute which may cause this issue in weblogic settings?


Basically this issue only happens on our production environment which is using Oracle ODA (Oracle Database Appliance‎) database;

This setting works fine for our testing and developing environment which is a normal Oracle DB;

We thought it might be the ODA settings; but we have another application which is running with Jetty Apache Datasource:


<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="driverClassName">oracle.jdbc.driver.OracleDriver</Set>

<Set name="url">jdbc:oracle:thin:@xxxxxx1521:xxxxx</Set>
<Set name="username">xxxx</Set>
<Set name="password">xxxx</Set>

<Set name="initialSize">10</Set>
<Set name="maxActive">100</Set>
<Set name="maxIdle">50</Set>
<Set name="minIdle">10</Set>
</New>



And this one is working fine, that means this is not the ODA issue;

So I'm wondering is there any settings in weblogic which may cause this issue?







I have a very strange issue; MYSQL max_allowed_packet is already set as 32MB;

max_allowed_packet 33554432



And below is my JDBC code to get MYSQL connection:


String url = "jdbc:mysql://" + server + ":" + port;
if (database != null)
url += "/" + database;
url = url + "?user=" + username + "&password=" + password;
connection = DriverManager.getConnection(url);



But it still throw out exception that max_allowed_packet is too small;

com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4739923 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.



Can someone know why this happen? or is there any other place may cause this issue too?


Thanks!

I added the following plugin for launcher and it works now

org.eclipse.e4.ui.workbench.addons.swt
org.eclipse.equinox.ds
org.eclipse.equinox.event
org.eclipse.equinox.util
I'm trying to upgrade my plugin application to eclipse 4 which was developed with eclipse3.
I added the necessary plug-ins:

And also specified "org.eclipse.platform/LegacyIDE.e4xmi" for product node in plugin.xml:

But it started up failed while trying to start it:


can anybody tell me how can I fix it? Thanks!
I'm developing a plug-in project and I create a "Editor" class which extends the class "AbstractDecoratedTextEditor" defined in "org.eclipse.ui.editor.jar".
This "Editor" is able to open a file and edit it. But if the file size is too large(>10M), it will throw an out of memory exception. I found that the "Editor" reads all the file content into the memory not uses the buffer.
I want to extend this function with buffer reader, so I need to look through the eclispe SDK source.
I've downloaded the eclipse SDK, but I don't know how to attach it?
I changed the "Target platform" Location to eclipse SDK directory from eclipse installation directory, and all the sources are found and listed in "Source Code Locations" tab.
But after that, most of the original plug-in dependencies in project "JAVA Build Path-->Libraries-->Plug-in Dependencies" were lost, I don't know how to add it.
Is there anybody can help me?
Is there anybody could tell me how to attach source for the plugin-in dependencies in eclipse?
The eclipse version is 3.4.1. I've downloaded the eclipse SDK. But I don't know how to attach it.
I tried to declare the source at: "Windows" --> "preferences" -->"Plug-in Development" --> "Target Platform" -->"Source Code Locations", but it seems not effect.
Create a instance need a constructor, but not just only a constructor. All of its components must be defined clearly including abstract method.
15 years ago

Originally posted by Henry Wong:



You have a couple of options... (1) you can use the Calendar class to calculate the two weeks from the current date, or (2) you can just get the time in milliseconds from the date, add two weeks worth of milliseconds, and then create a new data object.

Henry


I agree, and I recommend Calendar class because the code will be more readable.
15 years ago

Originally posted by Rob Prime:

I think we have a winner!



I agree.^_^
15 years ago