Java

98K

Solutions

32K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi
I can find all the users I want to entice to my cause, because they like certain Twitter posts.
Can I send them each a DM in Java code?
0
Optimize your web performance
LVL 1
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

hi experts
could you help with below please

Sample string for this question
Could not find '/dir1/dir2//dir3/null_component_deploy.properties'
Could not find '/dir1/dir2//dir3/valid_file.properties'

1. how to ignore line 1
2. but catch line 2



Existing sample string/regex rule that experts exchange helped me which is working fine only for reference
/tmp/path - No such file or directory.
/tmp/shm - No such file or directory.
/dir1/validate_path - No such file or directory.

Working regex to exclude first two lines but catch the third line
/^(?!.*(tmp|log|shm))(.*No such file or directory.*)$/
0
I am using Log4j2 with the JUL plug-in.

For example:
	... 18 more
1500642924477	Marionette	INFO	New connections will no longer be accepted
1500642924501	addons.xpi	DEBUG	Calling bootstrap method shutdown on webcompat@mozilla.org version 1.1

Open in new window

0
Hi I am using applet for doing some client side operation. i just used cache parameter tag "<PARAM NAME="cache_archive" VALUE="a.jar,b.jar,c.jar">" for making server jars are cached. problem is my jars are caching but once i close the browser and open the applet, again my applet is downloading all the jars it is not looking jvm cached jars.

my requirement is once the jars are cached it should not load again. it has to download from local cache.


any body have solution ..?
0
When I replaced the JARs of POI-3.9 with POI-3.16, I am getting a popup "We found a problem with some content in file.xlsx. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes." while opening the downloaded excel. After clicking Yes, I am getting another popup "Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded."

I have used below JARs.
1. poi-3.16.jar
2. poi-ooxml-3.16.jar
3. poi-ooxml-schemas-3.16.jar
4. xmlbeans-2.6.0.jar
5. commons-codec-1.10.jar
6. commons-collections4-4.1.jar
7. commons-logging-1.2.jar
8. junit-4.12.jar
9. log4j-1.2.17.jar

Please suggest a proper solution.
0
I have my code like below
      response = orch.process(request);

when i mover on to process method and click control and left mouse click it supposed to go to process method implementation but it is not doing in eclipse mars.

it used to work earlier not sure suddenly what happened stops working.

i restarted my laptop still not working.

please advise
0
I'm using 11.2.0.4 for Windows 64bit. It comes with Java 5 as part of the install (I'm assuming so you don't need to have Java installed to use Oracle). How do I update that version of Java? I'm running into an error where I need the unlimited crypto package but I can't use it on Java 5 (I tried and it grenaded parts of Windows if I update the security files). I did then install Java 8 on the system but Oracle seems to look at it's own vs what is installed outside of Oracle.
0
We have a small java program that connects to an Oracle (11.2.0.4 Windows) DB. There is a jks file that has the certs in it (4096 key size). When we try to connect we get:

sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Algorithm constraints check failed: MD5withRSA

If I make changes to entries below in the java.security file in Java:

jdk.certpath.disabledAlgorithms
jdk.tls.disabledAlgorithms

and remove MD5 and MD5withRSA parameters it works. From what I've read this is supposed to be an issue in JRE 7.4 and above but it is only supposed to happen when they key length is 1024 or less. Not sure why it's happening with a 4096 key length cert.
0
we have web application, it is currently supported IP4.it is developed with Spring mvc.
now i want to support IPV6.. how could be the changes.. and how it will effect.
0
hi,

in eclipse java project i have below stored procedure in a DAO class say LMN.java


abc_TerminalXYZ_Select

wen i search on it eclipise not finding.
how to find all the stored proc similar to above in all DAO classes?
what are best search strategies to find what i want in eclipise?
please advise
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

We are using ELK(Elastic search, logstash, and Kibana) for our log management. Everytime I will export the setting from kibana UI from Management--->Save Objects--->Export Everything. For demo, one can checkout the url: Kibana Demo

cURL
I want to automate this export process with some scripting on linux. I tried CURL but the header/payload data looks to be dynamic and might have to update frequently. I want to try some web scraping techniques with some web automation tools like Selenium and pythion.

Selenium Webdriver
I tried to record this export action with Selenium IDE and from the IDE I exported the test plan/case into pythonkibana_python.py . As we click on Export Everything button on Kibana, a firefox window opens asking where to save. This action is not handled by selenium, meaning download file is not supported by selenium.

So, I'm looking for some scripting to export the json(Export Everything) file from Kibana UI and it mush be Headless as I would be scheduling this script in linux server. To be headless, I also tried phantomjs, but even this doesn't support file download.

Simply, I just want a script to automate clicking export everything button on kibana and want it be saved in a file. Please share your thoughts or any idea,  i'm trying this for days...
0
I'm trying to configure SSL(https) for tomcat 8 and have done below steps but still its not working

1) Create the keystore file using

keytool -genkey -alias myservername -keyalg RSA

Open in new window


2) Generated CSR as below

keytool -certreq -alias myservername -file C:\tomcat_ssl\local_machine\test.csr -keystore C:\tomcat_ssl\local_machine\test.keystore

Open in new window


3) Then we had Generated the Certificate and then imported the chain certificate and certificate as below

keytool -import -alias root -keystore C:\tomcat_ssl\local_machine\test.keystore -trustcacerts -file C:\tomcat_ssl\local_machine\srv_chain.cer

Open in new window


keytool -import -alias myservername -keystore C:\tomcat_ssl\local_machine\test.keystore -file C:\tomcat_ssl\local_machine\srv_main.cer

Open in new window


4) Finally Did the changes in tomcat server.xml as below

<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="C:\tomcat_ssl\local_machine\test.keystore" keystorePass="123" keystoreAlias="myservername"/>

Open in new window


Restarted the tomcat and its not working and showing below screen

Tomcat Error Screen for SSL
In tomcat logs it's not showing any errors and also i have tried other options like keeping cipher tag in connection, Enabled TLS 1,2,3 , changing https port etc no avail.

Also i have tested the https port 443 and it's showing as listening when i netstat. Any idea why this is not working
0
Hi.
I converted  dex reader code sample  from the python  example Python version  to java but i am failing on   master handshake (after slave in master mode).
Failed on State 3 - Sending master key.
Have some one experience to read audit data from DEX  vending machine from android Bluetooth or DEX  cable.
File Provided.
My task: Allows the user to read DEX from a vending machine using a Bluetooth DEX device.
DexReader.java
0
I am trying to print Persian character on my Zebra Z410 label printer. But for some reason it is printing ?????. The ZPL code I am sending to the printer via Zebra Settings Utilies

^XA
^FO50,50
^PA1,1,1,1
^A@N,50,50,E:TT0003M_.TTF^FDعاسشاتعفثه^FS
^XZ

Open in new window


 1
0
At what point should I be concerned with learning data structure and algorithm in Java. I have discovered that it's a very important strategy  to be good in writing codes in any computer language.
0
[06:06:37 PM] ----  Deployment started.  ----
[06:06:37 PM] Target platform is  (Weblogic 12.x).
[06:06:41 PM] Retrieving existing application information
[06:06:41 PM] Retrieving Shared Libraries Information from the server.
[06:06:41 PM] Running dependency analysis...
[06:06:41 PM] Deploying profile...
[06:06:41 PM] Wrote Enterprise Application Module to D:\OSDA_App_New\DiscoveryUITool\deploy\DiscoveryUITool.ear
[06:06:41 PM] Deploying 0 data source(s) to the server...
[06:06:41 PM] Deploying Application...
[06:06:45 PM] [Deployer:149193]Operation "deploy" on application "DiscoveryUITool" has failed on "AdminServer".
[06:06:45 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application DiscoveryUITool on AdminServer.: [HTTP:101061][WebAppModule(DiscoveryUITool:Discovery)] Could not find Web application "C:\Oracle\Middleware\Oracle_Home2\user_projects\domains\Manju_domain\servers\AdminServer\tmp\_WL_user\DiscoveryUITool\a78nov\DiscoveryToolv2_Project1_webapp.war".
java.io.FileNotFoundException: C:\Oracle\Middleware\Oracle_Home2\user_projects\domains\Manju_domain\servers\AdminServer\tmp\_WL_user\DiscoveryUITool\a78nov\DiscoveryToolv2_Project1_webapp.war (The system cannot find the file specified)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.<init>(ZipFile.java:219)
      at java.util.zip.ZipFile.<init>(ZipFile.java:149)
      at java.util.jar.JarFile.<init>(JarFile.java:166)
      at …
0
Hi experts,

I was looking around the web trying to find an implementation, but to no avail.

What I'm actually interested in is to detect if a Printer has PostScript support enabled.

I have tried POSTSCRIPT_IDENTIFY checking for PASSTHROUGH and POSTSCRIPT_PASSTHROUGH, but that does not work; some printers that have Postscript capabilities are not detected.
MSDN link to POSTSCRIPT_IDENTIFY: https://msdn.microsoft.com/en-us/library/windows/desktop/dd162829(v=vs.85).aspx

I found that the Java PrintService.isDocFlavorSupported works exactly as I want it to, but PrintService is an interface, and I can't find the logic that shows the implementation. I can't use the Java library as the application I'm working on has requirements to be a .NET application.

Does anyone have experience in figuring out how DocFlavor detection works, or better yet how to detect PostScript capability?

EDIT: I realised I was using the wrong printer driver...  was using Samsung Universal Driver instead of Samsung Universal Driver PS. Seems like the POSTSCRIPT_IDENTIFY detection is working as intended. If anyone has any prior experience/issues with this method, please do let me know though!


Best Regards,
Zack
0
Hi All,

We are doing a small POC to migrate MF screens to JAVA based webpages. As a matter of fact, we have created COBOL SPs to call relevant MF DC online programs. In case we need to call COBOL SP, what approach do JAVA team has to follow.

NOTE : IBM MQ is not supported by customer
              IMS DC (IMS is the online component of my customer. IMS and DB2 databases are used by administration system) is not suggested as it needs additional work
              Webservice / business services help should not be used.

What could be the approach do we have to follow?

P.s : I am neither JAVA expert nor Mainframe expert. Since I am managing a project, trying to get suggestions from various areas.

Moreover I heard something like wrapping COBOL stored procedure with DB2 so that it can be converted to DB2 SP(Do we have any approaches like that). In my customer's IT landscape they can call DB2 SP by using ODBC driver.

I am looking forward to see responses from experts.

Regards,
Krishna
0
hi experts.
could you pls advise on few online book/video store including subscription option for IT

I was looking at https://www.packtpub.com/ and https://www.oreilly.com/
but they are expensive

how to get subscription with discounted price or coupon code for above sites.

pls help
0
On Demand Webinar: Networking for the Cloud Era
LVL 9
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Hi All,

I have a SQL Query below:

SELECT
*
FROM TMPRICELIST A
INNER JOIN
(
SELECT
BarangCode
, MAX(PriceDate) AS MaxPriceDate
from TMPRICELIST
GROUP BY BarangCode
) B

ON A.BarangCode = B.BarangCode
AND A.PriceDate = B.MaxPriceDate

How could I query it using GreenDao using Java ?

Thank you.
0
Dear Team,

instead of every time inserting data into stored procedure  is it possible that from front end (java) we collect data for example 3 forms we have to submit data and then we collect this data into xml and finally insert into our stored procedure
0
I would like to know what fundamentals I need to build Android Apps.
0
I am learning recursion so trying to practise it by implementing BinarySearch algorithm.
public class BinarySearch {
	public int search(int[] items, int searchTerm, int startIndex, int endIndex) {
		int midIndex = (startIndex + endIndex)/2 ;
		System.out.println("Midpoint: "+midIndex);
		if(searchTerm == items[midIndex]) {
			return midIndex;
		} else if(searchTerm > items[midIndex]) {
			search(items, searchTerm, midIndex, endIndex);
		} else if(searchTerm < items[midIndex]) {
			search(items, searchTerm, startIndex, midIndex);
		} else {
			return -1;
		}
		return -1;
	}
	
	public static void main(String[] args) {
		BinarySearch bs = new BinarySearch();
		int[] items = { 1, 7, 9, 11, 22, 55, 67 };
		int index = bs.search(items, 7, 0, items.length-1);
		System.out.println(index);
	}

}

Open in new window


'search' is the method that is called recursively with array of items, the value that I want to search and start & end index of the array where item could potentially be there.

First, I get the midpoint and if the item at midpoint matches the searchTerm then I return it. If searchTerm is greater than value at midpoint then I call the search method again with  midpoint as startIndex and last item in the array as endIndex.
Similarly, if searchTerm is less than value at midpoint, then pass startIndex and midpoint as start and end value to search in.

Lets say, I want to search for 7. In the first iteration, 3 would be the midpoint so value at index 3 would be 11. Since, 7 < 11, search will be called again with startIndex as 0 and endIndex as 3. Now, midpoint would be 7, so the index of 7 (which is 1) should be returned. However, the value returned is -1 which is not correct.

When I tried troubleshooting it using Eclipse debugger, I found that even after the match is found at

if(searchTerm == items[midIndex]) {
			return midIndex;
}

Open in new window


instead of exiting the method, the below code gets executed

else if(searchTerm < items[midIndex]) {
			search(items, searchTerm, startIndex, midIndex);
		}

Open in new window

and then it returns -1. I feel it could be something to do with recursion as the previous invocation of search() would still be in the stack due to recursive nature of the code and it might be popping out of the stack. However, I can't really understand it. What would be the correct way to implement BinarySearch using recursion?
0
What is tunneling and JRMP and DMZhow they are related to firewall and ports and network. Why we use tunneling. please advise
0
How authentication and authorization different from data integrity and Confidentiality.

why we use key, tokens, certificates, rkm etc. please advise
0

Java

98K

Solutions

32K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.