Go Premium for a chance to win a PS4. Enter to Win







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

I have a Java web application that uses Hibernate to retrieve objects within the back-end.

For one particular class, when doing a snapshot query I keep getting the correct results in every way - except for the IDs are null.

I know that my setup is basically correct - I'm able to query for a number of other objects with everything right including the IDs - it's just with this one class I keep getting null IDs.

Here's my code. I know there's not much to see - it's the exact same lines of code that give me results fine with all of my classes except one. Just wondering if anyone has any ideas of why one class can give you the results with null IDs...?

    Criteria searchCriteria = buildQBECriteria(exampleObj, orderings,                  
                          startIndex, maxQuantity, matchMode,
                          criteria, false, session);
    List ret = searchCriteria.list();
    Whenever exampleObj is anything but one particular class - the results are fine including the IDs.

    Whenever exampleObj is one particular class - it returns the correct results in every way except the IDs are all null.
New feature and membership benefit!
LVL 11
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

hello, im using sockets and i have created different servers (with clients each), but how do i send a message from a client of serverA to client of serverB? please help!
Hello Experts,
I would like to know if there are any PC utilities to read CSV files other than Excel. I see a host of them online, but I would really like your recommendation based on your personal experiences.
Does some sort of it security baseline / hardening / security best practice document/check list for Jetty already exist?

If so where can it be found?
I am working with around over millions elements in the concurrent hash map. Default concurrency level is 16 . can anyone help me with some algorithm or factors from which I can identify the concurrency level ( & load factor) suitable for my scenario.Since the number of threads that concurrently access my CHM depends on the number of users that are currently logged in , am not expecting you to tell me the exact but I need a base configuration for my CHM load factor and concurrency level.

Please, this questions has been asked but left without concrete answer much time, I really need someone to give me a good answer.
ConcurrentHashMap<String, String> map=new ConcurrentHashMap<String, String>(50,000,????,?????);
I need to split an xml file which has multiple roots into files having one root. How can I achieve this?
Hello Experts,
I am testing a newly developed windows service and need to see how it handles system exceptions (something like outofmemory, etc). Is it possible to simulate any such occurrences from outside (without modifying the underlying code)? Please suggest.

while doing maven install i got below error
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

while doing maven clean it is success though
i follwed below steps to resolve

 maven clean
maven install
maven update
are different?
why maven clean is success and no issues in doing maven update as well where as maven install complained above jre?
Hey all,

I've recently become part of a team that uses BIRT in combination with Actuate/OpenText iHub.

One of my tasks involves programmatically retrieving a full list of reports running on the iHub server. I've already discovered that iHub has a web service API that could possibly be used but I cannot find what method to use that achieves this.

Any experienced BIRT/iHub users on here that could help me get somewhere?

Looking forward to those reponses! :)


while executing below xquery

for $x in doc("Books.xml")/books/book
return if{$x/@category="XML")then<XMLBOOK>{data($x/title)}</XMLBOOK>
else <NONXML>{data($x/title)}</NONXML>

on below xml

<?xml version="1.0" encoding="UTF-8"?>
	<book category="JAVA">
		<title>Master Core Java</title>

	<book category="DOTNET">
		<title>Get Certified in .Net</title>

	<book category="XML">
		<title lang="en">XML and XML Schema Definition in easy steps</title>

	<book category="XML">
		<title lang="en">XSLT XPATH and XQuery Fundamentals</title>

Open in new window

getting below error

Syntax error on line 2 at column 9 of file:/C:/Users/sg/gpJava/ud/xsl_xpath_jquery/XQuery/Books2.xqy near {....xml")/books/book return if...}
  XPST0003: Unrecognized node constructor if{}
Static error(s) in query

how to fix it
please advise
What does it mean to be "Always On"?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


eclipse java perspective kind of messed up as i tried to expand console which went to top right corner from bottom. I further tried to move which moved outline some where else etc. How bringing back to default view of java perspective so that i can see everything as origninal? if i restart the eclipse this problem resolved or there is any trick or command to fix this java perspective(even any other perspective for that matter like J2ee etc)
i tried restarting eclipse did not help though
please advise
when we use multiple xsl templates and apply them

<xsl:template match="/">
                        <h1>order info:</h1>

what are the practical use cases and sample examples on using multiple xsl templates say converting one xml to other xml format or from xml to html

please advise
hello, I am tasked to create a java chat application using socket programming with clients under a main server, is there any link that can help me? thank you
I have to give a knowledge sharing session. Need some help and presentation topics...
Mainly i work on java side... web applications spring framework.
Some thing related to that or any other computer science topic will also do.

I'm currently encountering an issue with Java Development under Eclipse IDE on Mac OS X.

Eclipse cannot terminate the program, when stopping by pressing the stop-button. When i start the program in debug mode, however it can terminate the program. On Windows I also do not have this issue.

When running the .jar-file on mac, also the program cannot be terminated correctly, on Windows there is no problem.

Does anyone know how to solve this?

Any hints appreciated.

BR Klaus

i have 3 ant projects downloaded from tfs say project1, project2, project3
i need to import them to eclipse
when i unzipped there is no .project  no .eclipse etc files. so when i import as existing java project not recognizing them as existing project.

when i import as build.xml after import i am not seeing build.xml anymore to build the project


how to import regular ant project into eclipse. please advise

under eclipse -->general -->network connections
i see options like manual, native, direct

when i select manual and select http(giving usernae and password) https((giving usernae and password) socks(not giving  usernae and password) in proxy entries at the top
at bottom proxy bypass first three like local host then 12x.x.x.xx
then it is connecting.

To my friend when selecting native which choosed al other options apart from above six then it connects for him.

what is difference between native and manual
when i try to do remote debugging on one unix server they are suggesting to change to mative from manual but my fear is i cannot connect to tfs any more. if i change to native and come back to manual again does it save the configurations as earier?

when to use direct?
please advise
good day,
i am developing a java web application on netbean,
when running the app  i get the internal server error 500,  i dont know why, please i need your help to solve this error
how do i fix this issue
How do I create a  a for-each loop to search the full list and count the total number of girls born since 1880?
import java.util.ArrayList;
import java.util.Scanner;
import java.util.*;
import java.io.*;
public class BabyNamesDatabase
    // instance variables - replace the example below with your own
    ArrayList<BabyNames> db;
     * Constructor for objects of class BabyNamesDatabase
    public BabyNamesDatabase()
        // initialise instance variables
        db = new ArrayList <BabyNames> ();
    public void readBabyNameDatabase(String filename) {
        // Read the full set of data from a text file
            // open the text file and use a Scanner to read the text
            FileInputStream fileByteStream = new FileInputStream(filename);
            Scanner scnr = new Scanner(fileByteStream);
            // keep reading as long as there is more data
             while(scnr.hasNext()) {
                // FIX ME: read the name, gender, count and year
                String name = scnr.next();
                String gender = scnr.next();
                int count = scnr.nextInt();
                int year = scnr.nextInt();
                // FIX ME: remove this print statement after method works
                // FIX ME: assign true/false to boolean isFemale based on
                // the gender String

Open in new window

Free Tool: Path Explorer
LVL 11
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

need to compare two lines in the program(eg Line 1:this is a test#1,test#4, Line 2:this is a test#2,test#4)
if the line differs by any word,that word should append at the certain position,
 i want the output like    this is a test#1,test#2,test#4.
give me a suggestion how to do
This is planning to setup Jenkins on a Red Hat Enterprise Linux 6.9. We are plan to setup a new jenkins server on linux os. We are thinking to make use of the yum package. However, I heard that some other packages, such as, Java with certain version need to be installed before Jenkins can be setup.

Please show step-by-step how to get Jenkins setting up and configure to use.
I am using     private static final ObjectMapper mapper = new ObjectMapper();
and trying to do :
        mapper.readValue(value, List.class);
Its giving compile time error: cannot resolve method readValue...
Here my value will be a string liek = ["option1", "option2"]
a json array and i want to convert it to List<String> object.

How should i do it ?

I have a userinfo hibernate class
class userinfo {

@GeneratedValue(strategy = GenerationType.AUTO)

private Integer id;
String guid;

The guid is the unique userId for each user registered inside my application.
Now i use this class in another class Comments  which will be made by some user..
ex :
class comments {
    @GeneratedValue(strategy = GenerationType.AUTO)
   private Integer id;
String comment;
userinfo user;

This is the current design. now i will get an api call when a user inside my application sends a comment.
so i was considering to send the following json from client side :
      "guid" : "sfsdf",
      "comment" : "random comment"

Now for storing this into the comments table.
I need the userinfo class element.
This will require a db query into userInfo table to fetch the userInfo corresponding to the guid. and then will insert the data
into comments table.
So there is an extra query involved. Is there any way to avoid it ?
Also is the above DB design good or there is an alternative better way ?


I am trying to run PowerSchool Gradebook from our client computers that go through a forefront tmg filtering 2010.

But for some reason i get an error message i wish to share below with you.

can anyone guide me and help me whats happening?

Launch file error message:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="https://ps.askosova.org/powerschool-gradebook"; version="">
        <title>PowerTeacher Gradebook</title>
        <vendor>Pearson School Systems</vendor>
        <description>PowerTeacher Gradebook Application</description>
        <description kind="tooltip">PowerTeacher Gradebook</description>
        <homepage href=""/>
        <icon href="wgb_dockIcon.png"/>
        <icon href="splash.png" kind="splash"/>
    <resources arch="">
        <j2se version="1.7+" initial-heap-size="256m" max-heap-size="512m" java-vm-args="-XX:MaxPermSize=384m -XX:PermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark" />
        <jar href="boot.jar" />
        <jar href="lib/powerschool-gradebook.jar" main="true"/>
        <jar href="lib/powerschool-httpinvoke.jar" />
        <jar href="lib/powerschool-i18n-sdk.jar" />
        <jar …
Input item
・ Today's date (year, date, date)
・ Birthday (year, date, date)
- Output specification
Described below
Calculate the age from the date of birth and display it.
Also, the following message is displayed from today's date of entry.
Message specification
Birthday 1 day before: tomorrow is the birthday.
Birthday day: This day is the birthday. congratulations.
One day after birthday: Last day was a birthday.
Do not display anything except the above.

The birth date of the person brought up on a leap day is as follows.
When I am a leap year, 2/29 is my birthday
When it is not a leap year, 2/28 is the birthday






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.