Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6850285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:06:19+00:00 2026-05-27T01:06:19+00:00

I have a Java application that has a line of code that says: String

  • 0

I have a Java application that has a line of code that says:

String myString="Some Text";
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(myString, null);

And this works great when I run my application in Eclipse with Java 5. When I create a .ear file and deploy it on websphere i get an exception that looks like this:

Caused by: java.awt.HeadlessException
      at sun.awt.HeadlessToolkit.getSystemClipboard(HeadlessToolkit.java:306)
      at something.something.something.package$MyButtonListener.buttonClick(View.java:271)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)

I can’t seem to solve this, does anyone have any ideas? I understand that it is trying to set the clipboard on the server but how do I set it on the user of the webapplications computer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:06:20+00:00Added an answer on May 27, 2026 at 1:06 am

    Your WebSphere environment does not have a monitor-based GUI (“head”).

    What is your intention in setting the clipboard on a server?

    EDIT: All the Toolkit methods apply to the computer running the Java code. If you want to manipulate the client, you need to deploy client-side code. See Set clipboard content in any browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a Java application that has some dependencies (~10). I would like
I have a java application that has Web Services published using Axis. With the
I have a Java application that launches another java application. The launcher has a
I have a Java application that's very String-heavy - it takes a feed of
I have been working on a java application that has a connection to a
All, I have written a PhoneBook application in Java that is command line based.
Folks, I have android application that presently has 1 warning, in line 80 of
I have a Java application that monitors a folder for incoming XML files. When
I have a java application that is connected to a view on a remote
We have a Java application that needs to be brought to the foreground when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.