Java EE

17K

Solutions

9K

Contributors

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

I have installed apache tomcat 7.0.90 on my windows 8 64bit system. This is how I have configured my tomcat-users.xml -

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  application.
-->
<!--
  NOTE:  The sample user and role entries below are intended for use with the
  examples web application. They 

Open in new window

0
Cloud Class® Course: Ruby Fundamentals
LVL 12
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Hello There ,
 I am new to Spring framework , i started to learn Spring MVC framework , i am currently trying to use internationalization (i18n)and localization (i10n) and every thin is going as expected

but here is my question in my project i have just 3 JSP and i have apply the (i18n) concept on them but i am wondering what if have 100 JSP , do i have to write a code and labels for all 100 JSP or can i make my all of my JSP app internationalized  just by clicking on a link to change between languages i want ???
0
what are differences between

stateless
stateful
singleton
mdb enterprise java beans.

when to use which one

any practical examples on them to see differences.

any links, resources, videos?
please advise
0
I am new to Spring MVC and I am trying to build a simple web App I am using Hibernate with Spring MVC. I am trying to implement CRUD operations in this web app, all CRUD operates properly except the update although DAO And Service Layers are working properly the problem here is about the JSP's and controllers. whenever I click update from the table it took me to the desired page to enter new book info but from the Update page when I click on update book submit button it stays on the same page and it does not call the desired controller method to take me where I want. I am talking about the last two methods.

Here is the Controller

package com.abed.controllers;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.abed.models.Book;
import com.abed.service.BookService;

@Controller

public class BookController {

    @Autowired
    BookService service;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public String 

Open in new window

0
Hi Experts,
According to my work , iI have a java code which generate shell script for ftp files.
So in the code
ftp.append("cd /home/user/user output/files for June ");

Open in new window

But according to shell script , If folder name contains space, then either we need to keep complete path inside quotes or space we can replace with back slash
for eg
cd "/home/user/user output/files for June " 
or
cd /home/user/user\output/files\for\June

But in java , It is not allowing me to put both  back slash \ and " saying invalid escape sequence.
How can I resolve it?
Thanks in Advance Experts............
0
Our client are calling one web API developed by us thru URL. They are getting below http response error -

406 Not Acceptable:1

What could be the reason? Previously API was called without any http request header and it worked well for many months.

my $response = $ua->get($url);

Open in new window


Suddenly we started getting above error. Now they have changed API calling code to send empty http request header with just one attribute "User Agent". They are not passing any value for this attribute. But after this change, it started working again.

my $response = $ua->get($url,'User-Agent' => '',);

Open in new window


What could be possible reasons for it to stop working suddenly and throwing back 406 error? How can I investigate?
0
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.
Help ASAP
0
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="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:ws="http://org.example" xmlns:qcm="http://com.Test">
  <soapenv:Header/>
 <soapenv:Body>
  <ws:fillQcm>
     <!--Zero or more repetitions:-->
     <ws:userResponse>
        <qcm:questionID>14</qcm:questionID>
        <!--1 or more repetitions:-->
        <qcm:qcmResponseList>
           <qcm:responseID>1</qcm:responseID>
           <qcm:response>true</qcm:response>
        </qcm:qcmResponseList>
        <qcm:qcmResponseList>
           <qcm:responseID>2</qcm:responseID>
           <qcm:response>false</qcm:response>
        </qcm:qcmResponseList>
            <qcm:qcmResponseList>
           <qcm:responseID>3</qcm:responseID>
           <qcm:response>false</qcm:response>
        </qcm:qcmResponseList>
     </ws:userResponse>
    </ws:fillQcm>
 </soapenv:Body>
</soapenv:Envelope>
When I try to test…
0
Websphere 8.5.5 :- Launch Client (Bypass the Authentication)
I want to bypass the authentication.
My soap.client.props details :-

com.ibm.SOAP.authenticationTarget=BasicAuth
com.ibm.SOAP.loginUserid=XXXXXXX
com.ibm.SOAP.loginPassword={xor}HggrAC8KZCgXa2QmZS5o




opt/was/85/AppServer/profiles/node1/bin/launchClient.sh /tciservices/gts/fehComm/FehFcsPutCli.ear -CCverbose=false -CCBootstrapHost=fc9pfwasd01.usgfoundries.com -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 source=com.ibm.ws.ssl.config.SSLConfig 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 com.ibm.invmgr.fehfcsputcli.FehFcsPutCli
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
0
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(AnnotationValidationInterceptor.java:44)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:99)

merci

CEdric
0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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> <mum00cdn.in.oracle.com> <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(ThresholdOutputStream.java:141)
        at com.github.ziplet.filter.compression.CompressingServletOutputStream.reset(CompressingServletOutputStream.java:110)
        at com.github.ziplet.filter.compression.CompressingHttpServletResponse.resetBuffer(CompressingHttpServletResponse.java:262)
        at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:131)
        at com.ofss.infra.web.LoginServlet.doPost(LoginServlet.java:214)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at …
0
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 com.ups.rms.testdriver.RMSTestDriver


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
0
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 com.xyz.zbc.drivertesting.Sample.java


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
0
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
0
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!


BookTestCase:

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

	@BeforeEach
	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);
	}

	@Test 
	void testPopulateBooks() {
		Assertions.assertThrows(IllegalArgumentException.class, () -> obj.populateBooks(6));
	}
	
	@Test
	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

0
Hello All,
How we can read footnotes from word file by using java (docx4j)?




Thanks,
Amzad
0
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?

Regards
Raghu
0
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.
Capture2.PNG
Capture1.PNG
Capture3.PNG
0
Page Link Based Security or Annotation based security

1. We can create page URLs as /employee/create /exployee/delete etc.,  /order/create /order/delete.  We can get the module and it's action and create an interceptor via this. Not sure what are the complexities will come in following this pattern

2. We can create custom annotation and add them to any Method in the controller and validate them based on the custom annotation

Which one would be the right and standardized approach or best approach to go-ahead ?
0
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.

Can an application use a JDBC driver that can contain the IP to both a primary and Standby instnace, so that the client can switch to standby if the primary IP is no longer reachable.

Or is there some other way an application can perform this

We are using an Oracle DB (Data Guard, primary and standby), but I am asking this from a client application failover to the correct DB instance, as opposed to a db failover
0
I'm currently using Roaster to generate a rest class, but i don't know how to implements http annotation (Get, Post,..) ?

Here's what I was trying to generate them with :

public class RestGenerator {
     public static void main(String[] args) {  

    JavaClassSource source = Roaster.create(JavaClassSource.class);
    source.setName("RestController").setPublic();
    source.addMethod().setName("Create").setPrivate().setBody("return null;")
    .addAnnotation();

    source.addMethod().setName("Delete").setPrivate().setBody("return null;")
    .addAnnotation();

    System.out.println(source);
}
}
output :

public class RestController
{

   @MISSING
   private void Create()
   {
      return null;
   }

   @MISSING
   private void Delete()
   {
      return null;
   }
0
Best Approach to validate the current action

1. Saving user details on login in the user session. For every action after login, check whether user has roles and permissions every time. DB needs to be queried since an administrator can change the privilege of the user any time. Query the roles and permissions of the current user and verify the operation every time.

2. Saving user details on login in the user session. For every action after login, check just the roles/permission associated with the session. DB doesn't needs to be queried. However if Administrator or any user changes the permission of the current user from different country invalidate the current user session which should be stored somewhere.

Which one would be the best approach on the above ?

Need sample code snippet for the above approaches and how to achieve it
0
When I deploy my ionic 2 application on the production server, I am getting the errors below. But when I run the application on the localhost, it runs fine.

vendor.js:1349 Uncaught SyntaxError: Unexpected token ?
main.js:1 Uncaught ReferenceError: webpackJsonp is not defined
    at main.js:1

Open in new window

0
hi am in oracle form 11gR2 i what to display a down arrow on top of my button how can i do that this arrow ↓ without using image
0
How to Write a simple application which will register a user and authenticate the user. You can use default H2 for database. Once authenticated, the user should be able to give a string to translate into the language he desires (French, German, Tamil versa. You can use Google or Microsoft Translate API.
0

Java EE

17K

Solutions

9K

Contributors

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
<
Monthly
>