Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x

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 how to see post man response. i installed post man now instead of advance res client
postMan401.png
postMan200.png
0
Tech or Treat! - Giveaway
LVL 10
Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

hi,
how to see options in advanced rest client options missing in latest version.
latest AvancedRestClient Launched From StartMenu looks quite different as attached.
i am not able to see actual response as well but just able to see response header alone

please advise
AdvanceRestClientOptions.png
latestAvancedRestClientLaunchedFromS.png
latestAvancedRestClientLaunchedFromS.png
0
Hi,
I'm writing an API guide for an application that accepts input - and generates output - in JSON format.

Suppose I have the following (redacted) code:
{
   SSN :  "012-34-5678",
   DOB: "1986-10-27",
   Age: 30,
   name: {
      first: "Daffy",
      last : "Duck"
    },
   Department: "Sales"
}

Open in new window


1. Is this entire entity referred to as a block or object?
2. Same for the name element, which contains first/last name.

Also, is JSON syntax considered closer to Java? Or to JavaScript?  The reason I need to know the latter is that I'm showing code samples in Confluence. While Confluence has a Code Block Macro, it does not come with prepackaged JSON formatting.

Thanks,
Steve
0
By mistake i removed the jre default from eclipse java project instead of updating jre with jdk as beow

Here is the complete sequence in Eclipse Luna:
Right click your project > properties.
Select “Java Build Path” on left, then “JRE System Library”, click Edit…
Select "Workspace Default JRE"
Click "Installed JREs"
If you see JRE you want in the list select it (selecting a JDK is OK too)

how to add jdk 1.8
please advise
0
hi,

when i  try to missing junit to build path showing 2 options. i wonder why it shows same option 2 times. please advise
JUNitBuildPAth.png
0
hi,

i am importing existing project into eclipse as non maven project. Everytime i import new project i see bunch of errors. when i go to error and say fix project set up and give jdk 1.8 then issues resolves. why i have to do this everytime to every new project. can i teach eclipse some how to rememebr so that i do not have to give this again and agian. please advise
errorJDK.png
errorJDK2.png
0
I am working in a new project on a complex GUI with Java 8 and Swing. We use among others the Container class that has a void add(Component comp, Object constraints) method that adds the component with constraints information. I want to build a dialogue with three panels, where pressing a button would result in switching the constraint information of the components that do not include the button object. How is it possible to switch the constraint information easily?
0
I wear multiple hats. I am a developer, software teacher and each day I learn a lot of things and tend to forget them?
I want to keep track of self-updates that I easily RETRIEVE it from office or home or if possible from mobile.
Some knowledge I want to keep private, share with the selected group and some with the public.

Topics:-
1) Errors & solutions - Private to me
2) Interview questions & solutions:- I keep interviewing on different technologies and wish to record Q&A - open to public
3) Best Practices in Programming - where i could receive updates from outside world
4) Keep track of teaching updates from students and friends
5) My Idea Logs and Suggestion from public
0
Hi Experts.

I'm having trouble configuring Flume to stream data from a website to my HDFS. As some tutorial i've read on the Internet such as TutorialPoint, Hadoop Pravendees... They all have the same example that stream data from Twitter to HDFS using Twitter Apps API.

Is there any source code PHP, Java or ASP.NET to do this without getting token like that example? The thing i want to do is setup an Agent in the website i want to get data and have data stream to my HDFS architecture.

Thanks for reading this, best regards.
0
while opening team explored in eclipse mars getting below error

Plug-in "com.microsoft.tfs.client.common.ui" was unable to instantiate class "com.microsoft.tfs.client.common.ui.views.TeamExplorerView".


how to resolve this.

Please advise
0
Ask an Anonymous Question!
LVL 10
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Hi,

i wrote my web application with web.xml as below

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://xmlns.jcp.org/xml/ns/javaee"
	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
	id="WebApp_ID" version="3.1">
<welcome-file-list>
    <welcome-file>simple.jsp</welcome-file>
</welcome-file-list>
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>MyResources</web-resource-name>
			<url-pattern>/*</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<role-name>myuserrole</role-name>
		</auth-constraint>
	</security-constraint>
	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>FILE</realm-name>
	<!-- 	<form-login-config>
			<form-login-page>/login.jsp</form-login-page>
			<form-error-page>/error.jsp</form-error-page>
		</form-login-config> -->
	</login-config>
</web-app>

Open in new window


i added role and username and password to tomcat-users.xml as below

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

Open in new window

0
I got below error
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
i checked below which has tomcat 8 already.

Project → Properties → Target Runtimes → *Apache Tomcat worked for me. There is no Target Runtimes under Facets (I'm on Eclipse v4.4 (Luna)).

i just has to remove and add again to  resolve this error.

i wonder why i have to remove and re add to resolve. this does not make sense to me. please advise
0
Experts, please let me know if there is any free client utility that I can use for GitHub Enterprise. I think SourceTree supports GitHub.com, but not GitHub enterprise, please correct me if I am wrong. For some reasons, GitHub Desktop version can't be used. Please let me know if there are any other utilities that I can use to connect to my office GitHub repository.
0
hi,

I am trying below example

http://briansjavablog.blogspot.com/2012/09/spring-jms-tutorial-with-activemq.html

i fired 100 messages as decribed in tutorial and exepcted them to be consumed with message on console.

Intead i am gettign below error


SEVERE: Could not refresh JMS Connection for destination 'jmsReceiveJndi' - retrying using FixedBackOff{interval=5000, currentAttempts=21, maxAttempts=unlimited}. Cause: Cannot send, channel has already failed: tcp://127.0.0.1:8161

under meta-inf context.xml is as below

<?xml version="1.0" encoding="UTF-8"?>
<Context>

   <!--
               Active MQ Connection Factory manages pooled connections
               to the ActiveMQ broker. Tomcat will connect with the
               broker using a TCP connection on port 61616 - this is the
               default port for ActiveMQ
   -->
   <Resource name="jms/mqConnectionFactory"
                     auth="Container"
                     type="org.apache.activemq.ActiveMQConnectionFactory"
                     description="JMS Connection Factory"
               factory="org.apache.activemq.jndi.JNDIReferenceFactory"
               brokerURL="tcp://localhost:8161" />

   <!--
               This is a reference to the first Queue we defined
               earlier in the ActiveMQ admin console
   -->
   <Resource name="jms/testQueueOne"
                     auth="Container"
                     type="org.apache.activemq.command.ActiveMQQueue"
               factory="org.apache.activemq.jndi.JNDIReferenceFactory"
               physicalName="TestQueueOne"/>

   <!--
               This is a reference to …
0
while trying below example

i did all stepas given
http://www.javanbeyond.com/activemq/tomcat-spring-activemq/

when i execute i do not see 3 mesages there

Example Execution:

Start ActiveMQ and login as admin/admin and click on “Queues” tab.
Start Tomcat and deploy the application. You should see three listeners listening to “firstQueue”.

what is difference between
 tcp://127.x.y.z:8161
 tcp://localhost:8161
 http://localhost:8161

which one i have to use.

my active mq running on my own windows laptop locally?
when to use http wen to use ftp?
when to use local host when to use ip like number 127.x.y.z...
please advise
0
Lets say, I have below classes.

@JsonRootName(value = "car")
public class car {
private String make;
private String model;
//getters and setters
}

public class Automobile {
    private String color;
    private String type;
    private Set<Car> cars = new HashSet<>();
//getters and setters
}

When I serialize Automobile using below code
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
mapper.writeValueAsString(Automobile);

I am getting the output
{
  “Automobile”:
   {
    “color”: “red”,
    “type”: “four wheel”,
    “cars”:[{“make”:”Honda”,”model”:”cry”}]
   }
}

But I want something like below
{
  “color”: “red”,
  “type”: “four wheel”,
   “cars”: {
      “car”: [{“make”:”Honda”,”model”:”cry”}]
    }
}

How can i use jackson annotations so that i can get the output i want
0
hi,

I am looking for good sample example on below area
JMS API Durable subscriber example
can you please point me to some end to end example on this using active mq.

Please advise
0
hi,

can i open two instances of eclipse mars both pointing to same tomcat 8 pointing ?
is that is ok or do i get any error like port conflict or something else?
please advise
0
hi,

within eclipse i have tomcat 8 running. I want to know what location that tomcat running from on my local windows laptop C drive as i happened to have many tomcats in my c drive under different directories
0
Free Tool: Subnet Calculator
LVL 10
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi, i have written my first program in java and named it HelloApp.java as a java file, but when i use command prompt to compile it, it gives me this error: javac: file not found: HelloApp.java
I don't  know what is wrong and can someone please help me?
0
hi,

In webservice example i have ProductServiceImpl class IMPLEMENTING ProductService.java interface.

Instead 0f Map instructor using list.= as there is no database for that simple example

I wonder why we need database if we use Map where as no need of database if use List
List<Product> list=new ArrayList<Product>;

please advise
0
I got an email "IBM System Director (ISD) storage controller affected by the vulnerability in IBM java run time"

We have windows 2008R2 servers but I am not able to understand where this ISD is installed and how to remediate it. Is it applicable for our environment or not . Please suggest
0
Hi

At the bottom of my humanity changing blog, it says ' © 2017 YOUR COMPANY.  DESIGNED BY THEMEUM'

Can I annihilate this and put my privacy policy link there? or just above it?

not sure

Thanks
0
Hi,
i am working on below example
https://howtodoinjava.com/jms/jms-publish-subscribe-message-example/

i wrote my publisher as below

package pubSub;    
 
import javax.naming.Context;
import javax.naming.InitialContext;                                                                          
import javax.jms.Topic;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TopicPublisher;

import java.util.Properties;

import javax.jms.DeliveryMode;
import javax.jms.TopicSession;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
                                                                            
public class Publisher
{
    public static void main(String[] args) throws Exception
    {
    	// Obtain a JNDI connection
    	Properties env = new Properties();
    	env.put(Context.INITIAL_CONTEXT_FACTORY,“org.apache.activemq.jndi.ActiveMQInitialContextFactory”);
    	env.put(Context.PROVIDER_URL, “http://localhost:8161”);
    	//env.put(Context.SECURITY_PRINCIPAL, “weblogic”);
    	//env.put(Context.SECURITY_CREDENTIALS, “weblogic”);

    	InitialContext ctx = new InitialContext(env);
       // get the initial context
       InitialContext ctx = new InitialContext();
                                                                           
       // lookup the topic object
       Topic topic = (Topic) ctx.lookup("topic/topic0");
                                                                           
       // 

Open in new window

0
hi,
i have a pdf book with some code in it.
how to copy that so that i can execute that code in eclipse or IDE
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.