Pranav Kristam

Greenhorn
+ Follow
since Aug 21, 2014
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 Pranav Kristam

Currently I am facing out of memory or tomcat crash problem on the server side, where the business logic is developed using Restful APIs (Jersey-1.17) and deployed on the tomcat server.

Yes the client and server are independent of each other. As a next step I will profile the application code, meanwhile customer is asking for an immediate workaround solution to increase the heap memory size from 1GB to 2GB or more.
8 years ago
Yes my OS is 64 bit with 16 GB RAM and as reference I used this URL (http://docs.oracle.com/cd/E19900-01/819-4742/abeik/index.html) to configure the performance tuning parameters under Java Options section :

-XX:MaxPermSize=256m
-XX:+UseConcMarkSweepGC
-XX:NewSize=400m
-XX:MaxNewSize=400m
-XX:SurvivorRatio=6

Initial memory pool : 1024 MB
Maximum memory pool : 1024 MB
Thread stack size : 1024 MB
8 years ago
Thanks for the reply. Development & PROD OS are 64bit version and JDK/Tomcat is only 32 bit.

As per your information "32-bit Windows has a 3 GB limit on RAM"

Does it mean can we allocate up to 3 GB heap memory size for 32 bit JVM ? if yes, why it is not allowed to configure the same and not starting the tomcat service.
8 years ago
Hi All,

As per the project requirement I have to continue to use 32 bit JDK1.7 & Tomcat 7.x on windows environment, here tomcat is running as a windows service and I am using Tomcat7w.exe to configure the memory settings.

If I allocates more than 1 GB memory heap size the tomcat service is not starting and getting an alert as "windows could not start the apache tomcat 7 on local computer".

My application is a Java swing standalone and it is having image related data and it needs more than 1 GB memory and due to 1GB memory limitation the tomcat crashes after 5 to 6 days for a a load of around 300 users.

Can you please suggest me how to allocate more memory(2GB or 4GB).

OS : Windows 7 Enterprise with 16 GB RAM ( development machine) and Windows 2008 R2 SP1 with 16 GB RAM.
8 years ago
My application connects with Oracle and Junit connects with HSQL database. I am using in built SUBSTRING function in the named query which is working fine with Oracle database but not with HSQL database (2.2.4 version). To ensure I have tested by passing a hard coded value instead of SUBSTRING and it works fine with HSQL.

Hard coded named query

@NamedQueries({ @NamedQuery(name = InmetroSupplierEntity.QUERY_FOR_SNR, query = "SELECT e FROM "
+ InmetroSupplierEntity.NAME + " e , " + InmetroCertifBasisEntity.NAME
+ " p WHERE e.snr = p.partnum AND e.snr = :" + InmetroSupplierEntity.PARAM_SNR
+ " AND e.supplierNumber = '135245'", hints = { @QueryHint(name = TopLinkQueryHints.REFRESH, value = HintValues.TRUE) }) })

Actual named query

@NamedQueries({ @NamedQuery(name = InmetroSupplierEntity.QUERY_FOR_SNR, query = "SELECT e FROM "
+ InmetroSupplierEntity.NAME + " e , " + InmetroCertifBasisEntity.NAME
+ " p WHERE e.snr = p.partnum AND e.snr = :" + InmetroSupplierEntity.PARAM_SNR
+ " AND e.supplierNumber = SUBSTRING(p.supplier,0,6)", hints = { @QueryHint(name = TopLinkQueryHints.REFRESH, value = HintValues.TRUE) }) })

It seems to be there is some limitations with SUBSTRING function in HSQL and can you please provide some inputs in these named query to make it work with both Oracle and HSQL.
Hi,

SELECT * FROM INM_C_SUPPLIER_INFO e , INM_CERTIFICATE p WHERE e.sachnr ='7160790' and e.sachnr = p.partnum and e.lief_nr= substr(p.supplier, 0, 6)

I am new to JPA and looking some help in writing JPA named query for the above sql statement.

The below one is not completed and till now I am trying like this :

@NamedQueries({ @NamedQuery(name = InmetroSupplierEntity.QUERY_FOR_SNR, query = "SELECT e FROM "

+ InmetroSupplierEntity.NAME + " e , " + InmetroCertifBasisEntity.NAME + " p WHERE e.snr = :"

+ InmetroSupplierEntity.PARAM_SNR + " AND e.snr = p.partnum" , hints = { @QueryHint(name = TopLinkQueryHints.REFRESH, value = HintValues.TRUE) }) })


Thanks
Thanks for your inputs. yes it's correct and working as expected after initialize I placed applyTruthFlag() method and moved out from actionPerformed()

this.onOffItem = new JMenuItem("Filter");
applyTruthFlag(currentBTE.isTruthFlag());
9 years ago
Thanks. Let me rephrase my requirement in this way: Based on some value one of the JMenu item should be disabled (grayed out) this is exactly what i need to be implement. With the above code snippet the JMenu Item is disabling after i select Jmenu item from JMenu, this is happening due to actionPerformed and invokes my method where I am disabling JMenuItem. But by default this JMenuitem should be disabled.

9 years ago
Thanks for the reply. can you please elaborate with some more information or example, to which level on load method need to be defined.
9 years ago
Hi,

I want to disable one of the JMenuItem on load itself but when i tried with following code it is disabling after I selected the JMenuitem.


Please suggest me what additional changes are needed to make it work accordingly.

this.onOffItem = new JMenuItem("Filter");
this.onOffItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
applyTruthFlag(currentBTE.isTruthFlag());
}
});

this.menuFilter.add(this.onOffItem);

private void applyTruthFlag(boolean truthAuswertung) {
this.onOffItem.setEnabled(truthAuswertung);
//this.onOffItem.repaint();
}



Thanks
9 years ago
Thanks for the reply. yes I can export and import all data to a file except BLOB using TOAD and i am looking for an option how to export and import BLOB data type.
Hi,

Please suggest me the best approach to copy / load data from one database(PROD) to another database (TEST).

Each table is having bulk data (millions of records).

Thanks,
Thanks for the reply. Due to some reasons on PROD environment i can't add keystore / trust store to $JAVA_HOME/jre/lib/security directory. Generating those to some other directory and using the same path in the code. Still running in to same issue. Please assist me to resolve the same.
9 years ago
Hi,

My application is written in java (apache axis-1.4) and the service provider application is written in .Net webservices which is exposed through https endpoint URL.

By using below mentioned stand alone program I am able to connect with third party .Net web services and getting response. But when I implemented the same code in application and deploy on glassfish 2.1.1 server i am getting an exception as "PKIX path building failed” and “unable to find valid certification path to requested target".

please let us know how to make it work when deployed on glassfish server. do i need any additional configuration changes need to be done on Glassfish to consume the .Net webservices.

Stand alone Program:
===============

String endpoint = "https://thirdparty:8443/Orderservice.svc";

System.setProperty("javax.net.ssl.keyStoreType", "pkcs12");
System.setProperty("javax.net.ssl.keyStore","security_com.p12");
System.setProperty("javax.net.ssl.keyStorePassword", "sec2014!!");
System.setProperty("javax.net.debug", "ssl");


/*System.setProperty("javax.net.ssl.trustStore","sec.keystore");
System.setProperty("javax.net.ssl.trustStoreType", "jks");
System.setProperty("javax.net.ssl.trustStorePassword", "importkey");*/

try {
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
QName qname = new QName(endpoint + "/", "OrderAction");
call.setOperationName(qname);
call.addParameter("Order", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_INT);
call.setSOAPActionURI("urn:BMWLabelOrderIntf-IBMWLabelOrder#OrderAction");
Object[] arg1 = new Object[] { "abc" };
Object result1 = call.invoke(arg1);
System.out.println("result1 --> " + result1);
} catch (MalformedURLException urlException) {
urlException.printStackTrace();
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
9 years ago