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

While hitting a get request on rest wadl using advanced rest client getting 401 error.

How to resolve it.

how to change to basic authentication where i can ignore the username and password part as that wadl do not need any creadentials

please advise
0
Containers & Docker to Create a Powerful Team
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

public ModelAndView EditDetails(Http Request req,Http Response res,SampleDTO sampleDTO)
{
ModelAndView mvc=new ModelAndView();
String n=req.getParameter("name");
List<String>details=//some list values;
mvc.addObject("details",details);
mvc.setviewname("ll.jsp");
return mvc;
}
 

in jsp , can u say how to use spring bind and set to dto and use it in controller
0
while doing maven clean and then maven insall i am getting below error while doing maven install





COMPILATION ERROR :
[INFO] -------------------------------------------------------------
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------






[INFO] BUILD FAILURE



how to fix this error.

what is root cause of this.
why not eclipse always remember my jdk?
do i ned to set up separately and tell eclipse about my jdk1.8??

please advise
0
while importing unzipped code as import as maven project to eclipse getting below error



Project testproject already exists


 Add a version or custom suffix using "Name template" in "Advanced" settings



how to fix this error. pLEase advise
0
Please help, I am trying to run my project through debug as it helps me see my break points and if my code it working line by line but now when i try to debbug i get this exception. I tried using this link below to resolve my issue but now I am worried it could be something in my code.

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014690354 

When I run it straight with the server its fine but I want to debug. I am fairly new in JAVA and feel very very DUMB



[2017/08/16 10:03:01:061 CAT] 00000087 LocalTranCoor E   WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
[2017/08/16 10:03:01:061 CAT] 00000087 webapp        E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[GenericServletWrapper]: javax.el.ELException: Unable to find ExpressionFactory of type: com.ibm.javart.debug.resolution.InterpExpressionFactory
      at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:190)
      at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:118)
      at com.ibm.ws.jsp.configuration.JspConfiguration.<init>(JspConfiguration.java:63)
      at com.ibm.ws.jsp.configuration.JspConfigurationManager.getConfigurationForUrl(JspConfigurationManager.java:99)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:560)
      at …
0
I need to send a POST request using java. The server i am trying to access has a username and password i need to pass those parameters as well.

1.) I have installed Tomcat in my machine and configured the developer environment. I am using eclipse. There are different types of projects i could create using Eclipse, and i need to know what is the best project i should create to develop my application ?

2.) Can someone show me some sample code or tutorial which would help me to develop my task ?

My Eclipse version : Eclipse Java EE, Indigo service release 2

EDIT

Is it a JPA project, Enterprise Application Project, Dynamic Web Project, Dynamic Web Application, EJB project, Application Client project, Static Web Project.
1
tomcat wont start in debug

where as tomcat is staring fine in regular mode.

i increased time out from 45 to 450 still similar error.

Server Tomcat v8.0 Server at localhost was unable to start within 450 seconds. If the server requires more time, try increasing the timeout in the server editor.
i wonder why server starts in regular mode but takes forever to start in debug mode.

regular startup happens in 10 seconds asap.

Aug 14, 2017 5:40:21 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:wsdlfirstws' did not find a matching property.
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/8.0.39
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Nov 9 2016 08:48:39 UTC
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         8.0.39.0
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 10
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            10.0
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Aug 14, 2017 5:40:21 PM org.apache.catalina.startup.VersionLoggerListener log…
0
Hi,

I have  abc.zip which i unzipped and imported to eclipse as maven project.

Later i got updated version of abc2.zip. I extracted to differnt folder called new_folder. Now when i try to import abc2.zip i am getting error as

 Project wsdlfirstws already exists
 Add a version or custom suffix using "Name template" in "Advanced" settings



how to fix this error and import updated abc2 project
0
Hi, I'm Pradip Kumar, Java Developer. I need some help to Develop My Java application for my desktop.
To show registry key, subregistry key till n number,
To show control panel Installed software under J Frame Java .
0
While installing tomcat how to know which http free port is free?8080 is always busy occupied by glassfish etc.

any tool or software etc which tells all free and occupied ports on my windows laptop to decide which port to allocate to tomcat?

what is ajp/1.3 conector port 8009 which shows while installing?
please advise
0
Application Discovery Service in AWS
Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

http://codingbat.com/prob/p152303
I am looking at above challenge description

Given an array of strings, return a Map<String, Integer> containing a key for every different string in the array, always with the value 0. For example the string "hello" makes the pair "hello":0. We'll do more complicated counting later, but for this problem the value is simply 0.

word0(["a", "b", "a", "b"]) → {"a": 0, "b": 0}
word0(["a", "b", "a", "c", "b"]) → {"a": 0, "b": 0, "c": 0}
word0(["c", "b", "a"]) → {"a": 0, "b": 0, "c": 0}

not clear on what hello has to do with unique string. please advise
public Map<String, Integer> word0(String[] strings) {
 
Map map=new HashMap(<String, Integer>);

for(String : strings){
  map.put(strings[i],0);
}
return map;
}

Open in new window


above gives below error


Compile problems:


missing '}' or illegal start of expression

see Example Code to help with compile problems


how to improve and fix my code . please advise
0
while trying below challenge
http://codingbat.com/prob/p136950

i wrote my code as below

public Map<String, String> mapAB4(Map<String, String> map) {
   if( map.get("a")!=null && map.get("b")!=null && map.get("a").length()> map.get("b").length() ){
    map.put("c",map.get("a"));
    
  }
    if( map.get("a")!=null && map.get("b")!=null && map.get("b").length()> map.get("a").length() ){
    map.put("c",map.get("b"));
    
  }
   if( map.get("a")!=null && map.get("b")!=null && map.get("a").equals(map.get("b")) ){
    map.put("a","");
    map.put("b","");
  }
  
  if( map.get("a")!=null && map.get("b")!=null && map.get("a").equals(map.get("b")) ){
    map.put("a","");
    map.put("b","");
  }
  return map;
}

Open in new window


i am failing below tests
Expected      Run            
mapAB4({"a": "aaa", "b": "bb", "c": "cake"}) → {"a": "aaa", "b": "bb", "c": "aaa"}      {"a": "aaa", "b": "bb", "c": "aaa"}      OK      
mapAB4({"a": "aa", "b": "bbb", "c": "cake"}) → {"a": "aa", "b": "bbb", "c": "bbb"}      {"a": "aa", "b": "bbb", "c": "bbb"}      OK      
mapAB4({"a": "aa", "b": "bbb"}) → {"a": "aa", "b": "bbb", "c": "bbb"}      {"a": "aa", "b": "bbb", "c": "bbb"}      OK      
mapAB4({"a": "aaa"}) → {"a": "aaa"}      {"a": "aaa"}      OK      
mapAB4({"b": "bbb"}) → {"b": "bbb"}      {"b": "bbb"}      OK      
mapAB4({"a": "aaa", "b": "bbb", "c": "cake"}) → {"a": "", "b": "", "c": "cake"}      {"a": "aaa", "b": "bbb", "c": "cake"}      X      
mapAB4({"a": "a", "b": "b", "c": "cake"}) → {"a": "", "b": "", "c": "cake"}      {"a": "a", "b": "b", "c": "cake"}      X      
0
when i am trying below challenge
http://codingbat.com/prob/p115012

as below
public Map<String, String> mapAB3(Map<String, String> map) {
  if(map.get("a")!=null ){
    
    map.put("b",map.get("a"));
  }
  
   if(map.get("b")!=null){
     map.put("a",map.get("b"));
   }
   return map;
}

Open in new window


public Map<String, String> mapAB3(Map<String, String> map) {
  if(map.get("a")!=null ){
   
    map.put("b",map.get("a"));
  }
 
   if(map.get("b")!=null){
     map.put("a",map.get("b"));
   }
   return map;
}
I am failing one edge case. how to improve my code and fix it. please advise
0
Hi,

I like to see some .class files generated in EAR file. Is there any java free decompiler to do this within eclipse and outside eclipse as well. please advise
0
i wrote my XSD as below  and getting error.
what i the meaning of error and ow to resolve it. please advise
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.gp.com/Patient"
	xmlns:tns="http://www.gp.org/Patient" elementFormDefault="qualified">
	
	<element name="patient" type="tns:Patient"/>
	
	<complexType name="Patient">
	
	<sequence>
	<element name="id" type="int"/>
	<element name="name" type="string"/>
	<element name="age" type="int"/>
	<element name="dob" type="date"/>
	<element name="email" type="string"/>
	<element name="gender" type="string"/>
	<element name="phone" type="string"/>
	
	</sequence>
	
	</complexType>
	
</schema>

Open in new window


src-resolve.4.2: Error resolving component 'tns:Patient'. It was detected that 'tns:Patient' is in namespace 'http://
 www.gp.org/Patient', but components from this namespace are not referenceable from schema document 'file:///C:/
 Users/gp/neon_workspace/spring_module4/XMLProj/Patient.xsd'. If this is the incorrect namespace, perhaps the prefix
 of 'tns:Patient' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added
 to 'file:///C:/Users/gp/neon_workspace/spring_module4/XMLProj/Patient.xsd'.
1
Hi there,
I am new to gradle.  I have a tar file uploaded to JFrog artifactory under ext-snapshot-local and it is saved as test.ambuli-1.0.0.tar
I want to download this file and extract it.  I am not sure, how to refer to the file in the dependencies.


apply plugin: 'java'
apply plugin: 'maven-publish'


configurations {
    AmbuliTar
}


dependencies {
  AmbuliTar('') ????????
}



repositories {

   println 'doing repo'

   maven {
      def repName = "ext-snapshot-local"
      println "building from $repName using"
      
      credentials {
          username artifactoryUserDev
          password artifactoryUserDevPassword
      }   
      url "http://${artifactoryHost}:${artifactoryPort}/artifactory/$repName"
   }
   
}  


task extractTar {
   File myTarFile = configurations.getByName('AmbuliTar').singleFile
     if(myTarFile.exists()) {
         ant.unar(src: myTarFile, dest: file('myDest'))

   }

}

Open in new window

0
We are still using Tomcat 6.0 and plan to move to latest version by next year. Problem with current version is to set the access deny to our web-application.

I tried adding valve with webapps/META-INF/context.xml file as below but nothing works. Can you please provide a fix.

<Context antiJARLocking="true" path="/">
<Valve className="org.apache.catalina.valves.RemoteIpValve" />
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="{IP_address}" />
</Context>

Or

<Context antiResourceLocking="false" privileged="true">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1,8\.8\.4\..*"/>
</Context>

Open in new window


Do you guys have any another solution as I want to restrict outside users from accessing Manager view and it will be accessible only from localhost?

Best Regards
0
Hi,
i am making an ajax call with text in post data. how do i capture this text in a parameter of a method in my controller or inside the method.
Thanks
0
i want to introduce JPA to my project which is developed with spring mvc.
so i want to use  both JPA and Spring datasouce.. because older DAO files have been developed with spring data source with templets.

is it possible to use both JPA and datasource in same project with out any sideeffects or future problems?
any examples?
0
Create CentOS 7 Newton Packstack Running Keystone
Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

i am using spring MVCframework for my project.

 <bean id="PurgeScheduler" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
           <property name="jobDetail" ref="PurgeJob"/>  
           <property name="cronExpression" value="${schedule.Purge.cron}"/>          
    </bean>

I have configured my job as above.. it is working fine..


My problem is , to update  'cronExpression' value.. i need to open properties file and update.
i want to move the properties to Database..

how  to read and set the cron expression value from database while starting up jboss server.
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
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
What is tunneling and JRMP and DMZhow they are related to firewall and ports and network. Why we use tunneling. please advise
0
Hi,

the create method is optional for Entity Beans. This is useful when you do not want to clients to be able to insert data into the database.

i am reading as above. I was not clear what is relation between create metnod and the insert data to the database.  please advise
0
i am using jboss7 application server for my web application.(spring MVC)
when i monitor HEAP Size, it is continuously growing when i am accessing web pages.
How to find root cause?
What could be reasons?
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.