JavaSponsored by jamf

99K

Solutions

33K

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

How to call vb script function from java?
I have tried below code. nothing worked.

 File file1 = new File("D:\\calbyd.vbs");
        try {
        Process p = Runtime.getRuntime().exec("wscript " + file1.getPath());
        p.waitFor();
int a = p.exitValue() ;
 } catch (Exception e) {
}


Attached vbs file for ref.



Thank you.
0
Free Tool: IP Lookup
LVL 12
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi Experts,

HashSet<TestData> hashset = new HashSet<>();

using select query getting data from Test1 table and adding data in TestData Object, then finally adding it in hashset.
now hashset is haviing 1000 records.

i want to insert this data in Test2 table(different database).

in Test2 table might have the same record if the record is available need to do update the values
if no data available in Test2 table need to do insetion.

Can some suggest me best way to do insert or update in Test2 table using jdbc.
0
I was going through http://www.lambdafaq.org/can-lambda-expressions-be-used-to-define-recursive-functions/ and tried to use the following code in a method but it failed to compile:
UnaryOperator factorial = x -> x == 0 ? 1 : x * factorial.apply(x - 1);

Open in new window

Also, I am not able to understand how to call this recursive method to return the factorial of an integer.
0
Dear Sirs,
I have a quick question.
I need to choose between Vaadin and JavaFx for an urgent app that has to run into a browser.
I would like to get some advices.
I will be mixing the technologies mentioned above with Spring.
On JavaFx, I have a question: can a JavaFX app integrated into Spring run into a browser after being deployed as it does for a normal pure Html/Jsp with Spring? A sample code will be highly appreciated.

I am looking forward to hearing from you.

Omer P Ntumba.
0
There is an entity class defined as DepartmentBase.java which has 200 setter methods and 200 private variables declared for the same.

I'm having Department.java which extends the base class DepartmentBase.java which has few fields as well.

Now i want to create Random values for all the fields in Department.java and return Department object.

I'm not sure how to set all the values of setter which exist in Department and in base class.

Please help me.

Thanks.
0
i have a node that contains (america-germany) and  another node contain (america&#x02010;germany),when i check for this node are equals or not it say it is not Equal, i am using java with dom parser ,but when i put entity value(&#x02010;) in both node it say Equal,why can anyone help me
0
Is any other solution to keep new Java version and have working IBM Notes? Any path or something?


http://www-01.ibm.com/support/docview.wss?uid=swg22012665
0
Hello Experts,
Cisco Configuration Professional unable to start after install of Java, please suggest.
0
1. What are signed Jars ?
2. In some application, after doing java changes, the client is requesting to build the signed jars for the client libraries changed?
3. How to create or build a signed jar?
4. Examples to build a signed jar from scratch?
0
Good day experts,

We are experiencing a weird issue with one of our network computers with regards to capcha not displaying in any web browser such as IE, Firefox, Chrome, etc.

We checked to ensure Java is updated, tried different browsers, changed settings as recommended in some google searches and still no success.  We also checked to make sure Windows updates are up to date.  The operating system is Windows 7 -64 bit.  ss-error.png I have attached a screen shot of the error.  Any guidance you can provide would greatly be appreciated.  

Thank you
0
Cloud Class® Course: CompTIA Cloud+
LVL 12
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

I have glassfish app on my Linux red hat 6.
I cant start my glassfish node it gives me next error :

There is a process already using the admin port 5858 -- it probably is another instance of a GlassFish server.Command start-domain failed.

But when i run comman in linux " netstat -tulnp | grep 5858 " It shows me:

tcp :::5858 LISTEN 47256/java

Port used by java app. But i cant log in to my glassfish interface.

How can i solve this issue, any expierenced specialist with glassfish maybe can help.
0
I am getting below error


[INFO] Scanning for projects...
Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example.howtodoinjava:spring-boot-soap-service:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.M4 in http://111.2.222.111:8081/archiva/repository/internal was cached in the local repository, resolution will not be reattempted until the update interval of archiva has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 14, column 10
 @
The build could not read 1 project -> [Help 1]
 
  The project com.example.howtodoinjava:spring-boot-soap-service:0.0.1-SNAPSHOT (C:\Users\gmy\tes\spring boot_webservices_soap_rest\spring-boot-soap-service\pom.xml) has 1 error
    Non-resolvable parent POM for com.example.howtodoinjava:spring-boot-soap-service:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:2.0.0.M4 in http://111.2.222.111:8081/archiva/repository/internal was cached in the local repository, resolution will not be reattempted until the update interval of archiva has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 14, column 10 -> [Help 2]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

0
Hi
My PyCharm is giving surprising red-underlining on import abc, object, and from abc import
Up til now, my chess engine has been working on a player class, but I'd like it to be an abstract base class. I am re-designing it
Must I do any special entries in the Project Settings panel? my code below doesn't seem to be a problem,



My abc is :
import abc

class ChessPlayer(object):
    __metaclass__= abc.ABCMeta

    @abc.abstractmethod
    def get_white_move(self, white_moves):
        """white player chooses the best move for this turn"""
        return

    @abc.abstractmethod
    def get_black_move(self, black_moves):
        """black player chooses the best move for this turn"""
        return

Open in new window

My derivative class is:
import abc
from abc_base import ChessPlayer:


class RandomPlayer(Object):
# ToBeDone, once setup is correct

Open in new window


Thanks
0
spring boot security

how SimplePasswordValidationCallbackHandler dfferent from other implementatons like
SpringCertificateValidationCallbackHandler

SpringDigestPasswordValidationCallbackHandler


what is meaning of call back handler

Please advise
0
apart from the "Elements" at top like GetCourseDetailsRequest, GetCourseDetailsResponse
 why we have Types at bottom like Status and CourseDetails at the bottom
<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://xyz.com/courses" xmlns:tns="http://xyz.com/courses"
	elementFormDefault="qualified">

	<xs:element name="GetCourseDetailsRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:int" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="CourseDetails" type="tns:CourseDetails" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetAllCourseDetailsRequest">
		<xs:complexType>
		</xs:complexType>
	</xs:element>

	<xs:element name="GetAllCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="CourseDetails" type="tns:CourseDetails"
					maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="DeleteCourseDetailsRequest">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="id" type="xs:int" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="DeleteCourseDetailsResponse">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="status" type="tns:Status" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:simpleType name="Status">
		

Open in new window

0
<wsdl:portType name="CoursePort">...</wsdl:portType>
<wsdl:binding name="CoursePortSoap11" type="tns:CoursePort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAllCourseDetails">


Similar to above SOAP over http


any examples on below

<wsdl:portType name="CoursePort">...</wsdl:portType>
<wsdl:binding name="CoursePortSoap11" type="tns:CoursePort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/mq"/>
<wsdl:operation name="GetAllCourseDetails">


basically i am looking for examples on soap over mq not soap over http
what are advantages, disadvantages, practical uses of SOAP over MQ vs SOAP over http
Please advise
0
for consuming web service apart from WSDL why we need to provide XSD of XML again?

WSDL it self has all information about request and responses right?

in <wsdl:types> element of wsdl has the xsd name in it?
xmls:tns means what in wsdl
what is
xmlns:soap means?
targetNamespace="http://xyz.com/courses"> means what?
in <wsdl:types> what is <xs:complexType name="courseDetails"> means?
why we use it?
Please advise with any good links, references, code examples, video tutorials etc
0
I am coding on the Salesforce platform using apex and I'm trying to create a class that will sort a list by two fields using the Comparable interface.

I'm trying to determine how I can sort by two fields so that each product grouping can be sorted by size. The products are clothing items. Each product has a series of sizes. For simplicity, the sizes are S, M, L, XL. What I am trying to achieve is sorting by the size field as well as the product name.

For example, if I have the following products:


Product Name            Size
black.v-neck.s               S
black.v-neck.m             M
black.v-neck.l                L
black.v-neck.xl             XL


I would want them sorted by smallest to largest:

black.v-neck.s
black.v-neck.m
black.v-neck.l
black.v-neck.xl

There is a size__c field for each product that holds the size value.

I started by creating a generic sorting utility using the comparable interface to test sorting by product name:
public class GenericSortingUtil {

    public class ObjWrapper implements Comparable {
        
        public sObject obj;
        
        public ObjWrapper() {}

        public ObjWrapper(Sobject obj) {
            this.obj = obj;

        }

        public Integer compareTo(Object compareTo) {
            
            ObjWrapper compareToObj = (ObjWrapper)compareTo;

            if((String)obj.get('Name') > (String)compareToObj.obj.get('Name')) {
                return 1;
            }

            

Open in new window

0
hi,
while working with the SOAP web service i gave below as request from wizdler.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
   
   
    <Body>
        <GetCourseDetailsRequest xmlns="http://xyz.com/courses">
            <id>123</id>
        </GetCourseDetailsRequest>
    </Body>
</Envelope>

i am getting below response when i click go button with POST method selected from drop down

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Client</faultcode>
            <faultstring xml:lang="en">com.sun.xml.wss.XWSSecurityException: Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found; nested exception is com.sun.xml.wss.XWSSecurityException: com.sun.xml.wss.XWSSecurityException: Message does not conform to configured policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found</faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


can you please advise how to resolve this
whizler1.png
0
Cloud Class® Course: Microsoft Windows 7 Basic
LVL 12
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

When I attempt to instal, Java on a Windows 212 R2 server, the installation errors out.  See screen shot below

error1
I download the file from the website:  https://www.java.com/en/download/help/windows_manual_download.xml

That clearly states Windows 2102. As soon as I click 'Next' from the wizard, the error comes up.  What can I do to install Java on Windows Server 2012 R2.
0
while executing spring boot soap example keep getting error like below

Description:

The Tomcat connector configured to listen on port 8081 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8081, or configure this application to listen on another port.


I tried 8080 as well in application.properties even that did not work


how to find what ports are free on my windows 10 laptop to use that ?

please advise
0
what are differences between project explorer and package explorer in eclipse.

how to open package explorer by default when opening eclipse

Please advise
0
Hi Team,

According to my work, I have to run 7000+ sql statements in DB2 .I have the java code of the same.But by default DB2 java can only run 1338 dynamic statements at one time.
So what I was doing that Split the input data (7000 + ) into mulitiple txt files and run program more than 7 times .Each time I have to change the input path file.

Now  instead of running program 7+ times and manually changing input path everytime,I m trying to dynamically read all the input files from that folder.
Here I am attaching a part of my program only..only the method to read input file.
Below is the code for single input file case. Assume I have files named as a.txt,b.txt,c.txt.....etc.
Text file contains data in the below format:-
----------------------
abc-465747        
dfr-756372
---------------------
Existing code which executes fine  for single input file

declared input file path
static String fileName="C:\\Users\\john\\Desktop\\policies.txt";

Open in new window


main method.
 public static void main(String[] args)
        
    {
    Pre pd = new Pre();
   
      
    pd.read_Policy_list_file(fileNames);

//other methods as a part of my work
}

Open in new window


read+policy method
public void read_Policy_list_file (String fileName)
		{
			try
			{
				BufferedReader br = new BufferedReader(new FileReader(fileName));
				try {
				    StringBuilder sb = new StringBuilder();
				    String line = br.readLine();

				    while (line != null) 
				    {
				    
				

Open in new window

0
Are SOAP web services are state-full

I read REST ones are stateless

https://www.tutorialspoint.com/restful/restful_statelessness.htm

Please advise
0
Hello everyone!. I am currently using wildfly 12 (on centos 7) in domain mode. I was wondering how to configure it so that the controller runs independently from the nodes. I need this because it has happened to me that for instance node1 failed but it happens to be the controller too and so I don't know how to restart that node without shutting down the entire cluster.
Is there any recommended configuration for this?.
0

JavaSponsored by jamf

99K

Solutions

33K

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.