Java EESponsored by jamf





Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

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

Sign up to Post

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.
Cloud Class® Course: Microsoft Azure 2017
LVL 12
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Recently got frustrated trying wsimport on several old SOAP sites. Found out its all been deprecated so no SOAP sites to run wsimport on.
Can anyone give me a few just to see that wsimport is working as I expect it should?
I would appreciate a chance to test these things also .
So other than web pages processing JAX-RS(Restful) links exactly what if anything is equivalent to WSDLs in the JAX-RS world
I mean put, post, get delete insert? httpd protocol.
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:-
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();

//other methods as a part of my work

Open in new window

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

				    while (line != null) 

Open in new window


Wonder why screen 2 approach better than screen 1 approach.
Please advise
I created a web service with jax-rpc 1.1 for a QCM. The main class is defined as:

public class QCM_WebService  implements Serializable{

    public void fillQcm (QCMUserResponse [] userResponse) {

Class QCMUserResponse:

class QCMUserResponse implements Serializable{
     private int questionID;
     private QcmResponse [] qcmResponseList;    
Class QcmResponse:

class QcmResponse implements Serializable{

    private int responseID;
    private String response;
This is an example of SoapUI request generated by the WSDL of this service:

<soapenv:Envelope xmlns:soapenv=""
   xmlns:ws="http://org.example" xmlns:qcm="http://com.Test">
     <!--Zero or more repetitions:-->
        <!--1 or more repetitions:-->
When I try to test…
Websphere 8.5.5 :- Launch Client (Bypass the Authentication)
I want to bypass the authentication.
My soap.client.props details :-{xor}HggrAC8KZCgXa2QmZS5o

opt/was/85/AppServer/profiles/node1/bin/ /tciservices/gts/fehComm/FehFcsPutCli.ear -CCverbose=false -CCBootstrapPort=9813 -CCexitVM=true
IBM WebSphere Application Server, Release 8.5
Java EE Application Client Tool
Copyright IBM Corp., 1997-2011
WSCL0012I: Processing command line arguments.
WSCL0013I: Initializing the Java EE Application Client Environment.
[5/22/18 10:19:15:205 EDT] 00000001  W UOW=null org=IBM prod=WebSphere component=Application Server thread=[P=755014:O=0:CT]
          CWPKI0041W: One or more key stores are using the default password.
WSCL0035I: Initialization of the Java EE Application Client Environment has completed.
WSCL0014I: Invoking the Application Client class
Starting FehFcsPutCli --> main is being executed
Connecting to EJB server...
Realm/Cell Name: defaultWIMFileBasedRealm
User Identity: XXXXXXX
User Password:                                                                                                                                                    Processing...
Execution complete ET(ms):16
I have created a module topo-webapp
and I have created an action using the example of struts. When I enter the url http://localhost:8080/topo-webapp/index.action I got the following error
Where does the problem come?

Problem accessing /topo-webapp/index.action. Reason:

    Server Error

Caused by:

java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;ZZ)Ljava/lang/annotation/Annotation;
      at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(


Hi Am getting following exception while launching FCUBS app which was deployed in weblogic domain :-

cab anybody explain reason for java.lang.IllegalStateException: Can't reset and how to solve it .

####<May 18, 2018 5:31:37,626 AM EDT> <Error> <HTTP> <> <fcubs> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <991e3a3c-01bd-4f28-ab4f-31165dac048e-000000ea> <1526635897626> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-101020> <[ServletContext@8473769[app:FCUBSApp module:FCJNeoWeb path:null spec-version:3.1]] Servlet failed with an Exception
java.lang.IllegalStateException: Can't reset
        at com.github.ziplet.filter.compression.ThresholdOutputStream.reset(
        at com.github.ziplet.filter.compression.CompressingServletOutputStream.reset(
        at com.github.ziplet.filter.compression.CompressingHttpServletResponse.resetBuffer(
        at weblogic.servlet.internal.RequestDispatcherImpl.forward(
        at com.ofss.infra.web.LoginServlet.doPost(
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(
        at …
Need few working, tested and verified spring boot web sample application projects to walk through

1. a real time open source application would be very good to explore the patterns, configuration, style etc.,
2. working example projects might be helpful to verify any feature quickly

any back-end database is fine
how utf-8, unicode are different for latin kind of characters with carrot or cap etc on them

in java are those both same?
are they different in other languages?

how html decimal code is different?
what other formats out there?
which one to use when?
which one to use to support sms on emails, sms text and different browsers, gif. pdf kind of reports etc without having to see some junk ?? kind of display issues
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

what does below command do
maven update

i am using above from eclipse

what are other commonly used maven commands and their uses, advantages, differences
i can do maven update on multiple projects once i select them in one stroke.

After this maven update one project java file keep on complaining
Error: Could not find or load main class

some junits keep on complaining junit not found

then i have to do maven clean
then maven install on each individual 10 projwect i have( not sure why i cannot do maven clean and maven install on multiple projects in one stroke)
how maven clean different from regular eclipse project clean at the top of th eclipse after  File, Edit, Navigate, Search etc options?

please advise
Eclipse has tabs File,Edit,Navigate,Search, Project etc at top

Under project there is Clean and 'Build All' options to clean and build 10 different projects(project_1, project_2....project_10) i have at one stroke

but after doing that i get error as below for project_10
Error:Counld not fine or load main class

if i do maven install on project _10 then above error is resolved but later stage i get

javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory]

how maven install or maven build is different from Eclipse-->Project--->Build All
I am doing migration struts 1.3 to spring 5.
1. please provide steps change struts-config.xml to spring-servlet.xml.
2. Please provide steps dojo form submission
I am writing java code to make api calls to dynamics 365...
Is there any standard library that i can use to for this...
Especially with the case when in the response i get a new link :
],"@odata.nextLink":"[Organization URI]/api/data/v9.0/accounts?$select=name&$filter=contains(name,'sample')&$skiptoken=%3Ccookie%20pagenumber=%222%22%20pagingcookie=%22%253ccookie%2520page%253d%25221%2522%253e%253caccountid%2520last%253d%2522%257b695EAF89-F083-E511-80D3-00155D2A68D3%257d%2522%2520first%253d%2522%257b655EAF89-F083-E511-80D3-00155D2A68D3%257d%2522%2520%252f%253e%253c%252fcookie%253e%22%20istracking=%22False%22%20/%3E"  

Normally i would fetch the result and then check for nextLink and make an http call then again check ...
Whats the best way to do this... Is there any spring framework.

Hi all! I build a JUnit BookTestCase to test the minPrice() method in the BookApp class. The method is to find and return the minimum price of an array of book objects. But the test fails, and it shows "AssertionFailedError: expected: <34.99> but was: <0.0>". I don't know where the problem is, and where the 0.0 comes from. Thanks in advance!


class BookTestCase {
	private BookApp obj;
	private Book[] book = new Book[5];

	void setUp() throws Exception {
		this.obj = new BookApp();
		book[0] = new Book(1, "HTLM", 56.0);
		book[1] = new Book(2, "Java", 128.0);
		book[2] = new Book(3, "Python", 34.0);
		book[3] = new Book(4, "C#", 40.0);
		book[4] = new Book(5, "C", 115.0);

	void testPopulateBooks() {
		Assertions.assertThrows(IllegalArgumentException.class, () -> obj.populateBooks(6));
	void testMinPrice() {
		assertEquals(34.0, BookApp.minPrice(book), 0.0001);

Open in new window

the minPrice() method in BookApp class:

public class BookApp {
        public static double minPrice(Book[] b) {
		double min = b[0].getPrice();
		for (int i = 1; i < b.length; i++) {
			if (b[i].getPrice() < min)
				min = b[i].getPrice();
		return min;

Open in new window


I would like to know how to disable the Java security warning screen below from coming up each time run a jnlp file from my desktop.  The users complain that this is distracting because you always have to click the check box and the run button every time before the Java program starts.  To run the file you need to enable Java security HIGH and add this site to the exception site which we already did but it still isn't disabled.  

What additional setting or command line parameters would disable the warning screen below?

Java Security Warning Screen
Hello All,
How we can read footnotes from word file by using java (docx4j)?

I am using OAuth for Microsoft dynamics CRM.
For some strange reason its not returning accesToken when i used a refreshToken to generate a new token.
Its only retruning refreshToken and idToken. What could be the reason for that ?

Here is the screen shot of postman request -
Is this a valid OaUth protocl response ??

I was making a spring web application. Where there are lot of handlers for GET request etc.
One thing came to my mind -
Suppose I make a GET request from my chrome browser from a particular tab.
And then in the response i add some values which gets back to this same chrome tab and machine.
How exactly does that happen.
How does a response object gets linked to a particular tab in a chrome broswer.

Also is it possible to send a response object without receiving a request object from spring to a particular machine and application.
I guess it should not be possible... But what makes it impossible.
Cloud Class® Course: Microsoft Exchange Server
LVL 12
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Here is my code:

(assume that inFS, habitat, habitatData and i are already created/initialized, as they are initialized earlier in the code)


case "aquarium":


            habitat = inFS.nextLine();


            while(!habitat.contains("Aquarium")) {


               habitat = inFS.nextLine();



            for (i = 1; i <= 4; i++) {


               habitatData = habitatData + habitat + "\n";

               habitat = inFS.nextLine();



            habitatData = habitatData.substring(4, habitatData.length());


            return habitatData;



The habitats.txt file it is looking at is attached.  The two other habitats, using identical code to the above (with the exception of !habitat.contains(“Aquarium”) being “Bird” or “Penguin” instead) and they both work.


When I hit the “aquarium” case, I get:


                at java.util.Scanner.nextLine(

                at zooprogram.FileParser.habitatInfo(

                at zooprogram.ZooProgramMenus.habitatMenu(

                at zooprogram.ZooProgramMenus.mainMenuDecision(

                at zooprogram.ZooProgram.main(

<redacted>\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1

I have installed Windows 10 OS and Sybase Central 4.3 installed in my system. When i run sybase it showing Java error

in my system
Java 8 update 66
Java 8 update 66(64 bit)
Java SE Development Kit update 66
Java SE Development Kit update 66(64 bit)

installed already

Please suggest what need to be done to make this work?

How to license each module in Spring MVC application ?

We need to develop several modules and each modules should be licensed separately

1. How to create license for each module?
2. How to enable/activate/disable the license dynamically?
3. Which open source softwares are available to license modules in J2EE spring mvc application?
Getting an error when referencing a js file from an xhtml file.

using this code...
 <h:outputScript library="js" name="jquery-3.1.1.min.js"  taget="body"/>
 <h:outputScript library="js" name="customerDetails.js" target="body"/>

I understand the target attribute, but less sure on the library attribute. obviously defining the path to the js directory but can't seem to point in the right direction.

Attached is the file structure from the resources folder...

Also attached are images of the xhtml file, and one of the js files.

Thank you very much in advanced. First Question so apologies for poor formatting.
If i have a rest controller in spring boot how can I validate the contract that comes in if certain values of the parameters need to have certain values??? ANy code examples are appreciated!
I am using a Mule Enterprise Service Bus for one of our integration project.I keep  getting  WeaveExecutionException everytime I test  it.Can any one please help or point me to the right direction?Below is the error details:-

Caused by: com.mulesoft.weave.mule.exception.WeaveExecutionException: Exception while executing: 
[row,col]: [1,1]
Unexpected character '[' (code 91) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1].
	at com.mulesoft.weave.mule.exception.WeaveExecutionException$.apply(WeaveExecutionException.scala:10) ~[mule-plugin-weave-3.8.5.jar:?]
	at com.mulesoft.weave.mule.WeaveMessageProcessor.execute(WeaveMessageProcessor.scala:121) ~[mule-plugin-weave-3.8.5.jar:?]

Open in new window


Java EESponsored by jamf





Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

Top Experts In
Java EE