 |
 |
Index ‹ java-programmer
|
- Previous
- 8
- code conventions - validationAnyone know of a code validator that follows this:
http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html
TIA
--
Mike W
- 9
- JTable emulate a HTML Table?Hi,
I want to display a table of user inputted information as a table but I am
having problems formatting the layout as I want it. I have a fixed cell
width and want the cell height to adjust to fit the text entered by the
user.
I can set the widths but can only set a fixed height for a cell and am
unable to get text to wrap within it,
for example. Also with the fixed height, the single line cells would float
to the vertical center of the cell, not stay at the top. Can alignments be
set?
[date textfield][item textfield][description textarea][idenifier
textfield][cost textfield]
[submit button]
Date Item Description
Identifier Cost
12/12/03 Big Pan This is a description field that BPI420
$60
15:30 spans multiple lines an needs
to wrap. The cell height
should dynamically alter to
accomodate the text.
1/1/04 Aspirin This is a much shorter
AS123 $20
description
Am I able to do this and if so how?
Is there a better way to do this than with using a JTable? I tried doing it
with a gridbag layout but the consecutive items wouldn't stay aligned.
Please help!
Cheers
Xav
- 10
- reading values from JTableI am looking for a working example of a JTable that is constructed
with initial values in the cells, allows the user to change those values,
and reads the values out.
I've got three books on Swing, none of them show a write/read table.
I have no problem creating tables with nothing in some cells, and
reading the values out that the user entered.
Here is how I construct the tables:
DefaultTableModel model01= new DefaultTableModel(rowData,colNames);
JTable table01= new JTable(model01);
Any help greatly appreciated.
--
Robert Metzger
Hewlett-Packard Company
High Performance Computing Division
- 11
- I can not get data from Table cellHi every one
I try to get String from cell in jTable
every time I try to get data from cell I only get null
and this is my code
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Class.forName("com.mysql.jdbc.Driver");
Connection con;
con = DriverManager.getConnection("jdbc:mysql://localhost/
uni","root","java");
Statement stat = con.createStatement();
ResultSet result;
result = stat.executeQuery("select max(no) from student_info_table");
result.next();
int mx, c;
mx = result.getInt(1);
mx = mx +1;
String inserting_Data = "insert into fee_part_table (feeNO, feeParts,
fee_1st_part) values(?, ?, ?)";
PreparedStatement ps = null;
ps = con.prepareStatement(inserting_Data);
ps.setInt(1, mx);
ps.setInt(2, c);
String st;
st = String.valueOf(jTable2.getValueAt(0, 0));
JOptionPane.showMessageDialog(this, st);
ps.setString(3, String.valueOf(jTable2.getValueAt(0, 0)));
ps.executeUpdate();
///////////////////////////////////////////////
- 11
- 11
- Curb Your Spam RageRoedy Green wrote:
Leave it to good ol' Roeds to feel the spammers' pain.
[snippysnipsnip]
- 13
- JTextArea SizeHello, I'm writing a java app for a pda and as the screen size is tiny I
want to write a MiniDialog class. I only want a JTextArea and an OK button
on it and I want the JTextArea to fit the size of the modal dialog.
If I pass in a long line of text then the JTextArea appears to get wider and
I have to scroll across the screen to see the text. I want it to wrap onto
the second line etc.
I must be doing something stupid!
Thanks, Kevin.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MiniDialog {
JDialog dialog=new JDialog(new JFrame(),"Info",true);
public MiniDialog() { }
public void show(String label) {
Container c=dialog.getContentPane();
JButton ok=new JButton("OK");
dialog.getRootPane().setDefaultButton(ok);
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}
});
JTextArea txt=new JTextArea(5,20);
txt.setEditable(false);
txt.append(label);
JScrollPane scroll=new JScrollPane(txt);
scroll.setSize(1,1);
dialog.setSize(200,200);
dialog.setLocation(20,40);
c.add(scroll,BorderLayout.CENTER);
c.add(ok,BorderLayout.SOUTH);
dialog.show();
}
}
- 13
- HashMap with primitive int keyDear All,
I have a class like this:
class CustomerOrder {
int globalID;
...
}
I have an array of these.
I'd like to store an index of globalIDs, so I can do:
CustomerOrder o = index.get(123)
I could modify my class to be:
class CustomerOrder {
Integer globalID;
...
}
Perhaps it is my C++ background, but the idea of allocating an object for every
ID when I can just use an int bothers me.
I figure a HashMap is the right tool of choice, e.g.:
HashMap<Integer, CustomerOrder> index = new ...
Has anyone out there already written a modified hashmap class that uses int as
the key?
Thanks for any tips :)
Andrew
- 13
- Tomcat4: Default Page Encoding UTF8Hi,
I am using Tomcat 4.1.27 running servlets which worked
perfectly under Tomcat 3. The problem is: (unfortunately)
the special characters (like german umlaute) are not
html encoded. Under tomcat 3 this was no problem, but with
the new tomcat the page-encoding is wrong. When I manually
change the page encoding in the browser to utf-8 everything
is OK. I could now go through all servlets and change the
content-type to charset utf-8, but I try to avoid this.
(as there where not written by me).
Is there any possiblilty the change the default page encoding
to utf-8? (like in the server.xml or so)
Thank you for any help!!!
Christian
- 14
- Future of 3Djava
Why comp.lang.java.3d doesn't exist ? If is not dead, for what purpose is
using: games or some engineering tools ? Does java have a future in a
gaming industry?
- 14
- Where have all the wintrolls gone...
"Phil Earnhardt" <email***@***.com> wrote in message
news:email***@***.com...
> >> >> No, Luke. Why don't *you* tell *us*: What would be the point of
> >having
> >> >> the language in 1441 and then doing *nothing* when Iraq was not
in
> >> >> compliance?
> >> >
> >> >There wouldn't be any point. You just beat the UN in doing
something.
> >>
> >> The question is actually the opposite, Luke: given the French never
> >> ever had any intent of enforcing the consequences spelled out in UN
> >> 1441, why did they ever bother approving it in the first place? Why
> >> not just be straight with the UN: "We will veto any measure to
approve
> >> UN military action against Iraq."
> >
> >Actually the sentence doesn't end here. If we put it into context (at
> >the time) it should read:
> >
> >We will veto any measure to approve UN military action against Iraq
if
> >the potential approval is to be based on US intelligence (read:
lies).
>
> But UN 1441 wasn't based on US intelligence.
We're not talking about 1441. France didn't vote against 1441. We're
talking about the invasion "warrant" US wanted to squeeze out of UNSC.
France felt somewhat reluctant to sign that warrant because the
evidence US intelligence (sic!) produced was not so very convincing. At
the time. Later it turned out it was total bullshit. Dubya's setting up
an investigation right now. In 50 years we might get to know the...
conclusions.
> The question remains: Iraq failed to comply with the terms of UN 1441.
> What should have been the consequences of that?
Again? Well, let's hope this time you get it: the terms should have been
enforced. But not under US flag. Maybe (more than likely) under US boot.
But the flag should have been the blue UN.
- 14
- Load default web browserHello,
I want to load a default web browser from my swing application [using
JApplet].
Using Runtime.getRuntime.exec("RunDLL 32.exe
shell32.dll,shellExec.RunDLL"+url);[for windows]
default browser can be called.But it is working in normal class & with
frames only.
with Applet or in swing-JApplet
it is showing error as :- java.security.AccessControlException:access
denied(java.io.FilePermission<<All FILES>>)execute>.
I want a plateform independent solution which will work in swing-JApplet.
--
Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-jvm/200505/1
- 15
- tomcat's classpathsHi all.
I have downloaded Tomcat 4.1.27 and I would like to create some JSPs. I took
an earlier JSP app and put it on Tomcat, and I got a class not found
exception. How do I set the classpaths for Tomcat?
One more question, how do I change the web document root? For example, I
want to change it to c:\testing.
Thanks in advance.
- 15
- java/berkeley-db self-test hangHello!
The newly updated port of java/berkeley-db hangs during self-tests on one of
my machines:
dual FreeBSD/i386 6.1-stable - no hang
single FreeBSD/amd64 6.1-stable - no hang
dual FreeBSD/amd64 6.2-prerelease - hangs
There is little CPU use and all the process is doing, according to ktrace is
the repeated:
[...]
13089 java CALL clock_gettime(0,0x7ffffeff3d00)
13089 java RET clock_gettime 0
13089 java CALL kse_release(0x654f20)
13089 java RET kse_release 0
13089 java CALL kse_release(0x511f20)
13089 java RET kse_release 0
13089 java CALL clock_gettime(0,0x7ffffeff3d00)
13089 java RET clock_gettime 0
13089 java CALL kse_release(0x654f20)
13089 java RET kse_release 0
13089 java CALL kse_release(0x511f20)
[...]
Rebuilding Java did not help... Would any Java and/or thread expert, please,
try to build the port with self-testing enabled and analyze any hang? Thanks
a lot!
-mi
- 16
- create a bean on webapp startupHi,
Unsuccessfully web browsing makes me come here.
I wonder if it's possible to create a bean (used by <jsp:use-bean>) on
startup, also through web.xml. I've seen it is possible to launch a
servlet with <load-on-startup> xml element, but, as I believe I've
understood, it is NOT a persistent object.
So, i'm asking if :
- is this possible to create a persistent object through a servlet
lauched at startup ?
- is there a different way ?
Regards,
--
Mounir
|
| Author |
Message |
elvis

|
Posted: 2005-7-30 9:46:00 |
Top |
java-programmer, help:hibernate
it drive me crazy!
where is the error?
when i use hibernate to connect to the mySQL,some error happens,just
like:
net.sf.hibernate.PropertyNotFoundException: no appropriate constructor
in class:
but i have defined a constructor without parameters!
it really block me,help!
|
| |
|
| |
 |
elvis

|
Posted: 2005-7-30 9:47:00 |
Top |
java-programmer >> help:hibernate
it drive me crazy!
where is the error?
when i use hibernate to connect to the mySQL,some error happens,just
like:
net.sf.hibernate.PropertyNotFoundException: no appropriate constructor
in class:
but i have defined a constructor without parameters!
it really block me,help!
|
| |
|
| |
 |
etienno

|
Posted: 2005-8-1 22:49:00 |
Top |
java-programmer >> help:hibernate
go the forum of Hibernate at hibernate.org. You will find the
documentation needed.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Dynamic resizing of JPanelDear experts,
I have the a JDesktopPane and a JPanel added to the CENTER and SOUTH
position of a JFrame respectively.
I would like to dynamically resize the JPanel upon mouseExited like the
Windows TaskBar.
On mouseExited of the JPanel i set the bounds of the JPanel to a new
size. However, the sizes do not reflect visually. I have called
invalidate(), validate(), repaint() and none seems to work.
Other than using JSplitPane to create a resizable JPanel, how can I make
this work?
Others have suggested using LayoutManagers but which one and how?
Thank you in advance.
- 2
- How to get the path of remotly run application by knowing the port numberHi,
I am new to this group, and i request you all to help in solving the
issues i have.
Thank you for having this group.
I need to know the path or install directory of an application,
I am able to access the the application by port number.
but i need to wright a java programe thr which i need to get the path
or install directory of the application.
Eg
http://servername:2000/
I request you all to help in the same.
- 3
- Bug#438188: RFP: schemaspy -- Graphical Database Schema Metadata BrowserPackage: wnpp
Severity: wishlist
* Package name : schemaspy
Version : 3.1.1
Upstream Author : John Currier <email***@***.com>
* URL : http://schemaspy.sourceforge.net/
* License : LGPL
Programming Lang: Java
Description : Graphical Database Schema Metadata Browser
SchemaSpy is a Java-based tool (requires Java 1.4 or higher) that
analyzes the metadata of a schema in a database and generates a visual
representation of it in a browser-displayable format. It lets you click
through the hierarchy of database tables via child and parent table
relationships. The browsing through relationships can occur though HTML
links and/or though the graphical representation of the relationships.
It's also designed to help resolve the obtuse errors that a database
sometimes gives related to failures due to constraints.
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 4
- JPEG manipulationHi all,
I was just wondering if there is a way of changing a JPEG image in
Java, what i mean is, can i edit a JPEG (manipulate pixels in the
image) ?
Thanks in advance
- 5
- String comparision efficencyHI!
I have an appliation that will need to parse a text of unkown length.
I get the data as an array of strings (and thus I know then how much
data it is)
I want to do several things on each "row" (that is each element in the
array) I want to
1. look for a specific word (start) and count how many of them there
are in total.
2. Highlight the word alarm and append a short description to the end
of the line
my first thought was to use
for(int i=0;i<data.length++){
if(data[i].endsWith("start"){
// do the work..
}else if(data[i].startsWith("Alarm")){
//do different work
}
}
this seems to be rather inefficent as I get two (and possibly more, my
employer did not seem think these few features were enough..)
Is there a better way to do this.
As the alarm line also contains an alarm code, I do not know what it
looks like. Any suggestions?
regards
/daniel
- 6
- wats the cluefrnds wen we connect with Oracle server from java,we use
getConnection(oracledriver,IPadress of
server,servername,username ,password);
forgive me if they r not in the same order.now my question is wat is
the server name if we use same system for server as well as
client.Ofcourse the IP address is loop back address.
Thanks in Advance.
Srinivas Reddy Thatiparthy.
- 7
- 8
- Software Development Kit 1.5Im starting with learning Java, and a book i got about it says i need
Software Development Kit 1.4. If i download and install it, i build a
java program and i try running it with command prompt.
But, commandprompt says i need version 1.5... :( Does some1 know where
i can download this or does some1 know another program to build Java
programs with and where can i download it...
- 9
- message Driven bean problemhi,
i am trying to design an EJB application using session , entity and
message beans
it's a messaging board , a user can add a message , reply to a
message , and delete the message
when glasfish is running more than one application,
the board client side keeps calling the wrong jms\
// the addTopic class
package web;
import ejb.Topic;
import java.io.*;
import java.util.Date;
import javax.annotation.Resource;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.Session;
import javax.servlet.*;
import javax.servlet.http.*;
public class AddTopic extends HttpServlet {
@Resource(mappedName = "jms/BoardTopicFactory")
private ConnectionFactory connectionFactorys = null;
@Resource(mappedName = "jms/BoardTopic")
private Queue queue = null;
private Connection connection = null;
private Session session = null;
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
try {
try {
// creating a connection
connection = connectionFactorys.createConnection();
session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageProducer messageProducer =
session.createProducer(queue);
ObjectMessage message = session.createObjectMessage();
Topic topic = new Topic();
// getting and setting all attributes required for the
topic
topic.setTopicDate(new Date());
// topic name validation , if empty , do not add it to
the database
if (request.getParameter("topicName").equals("")) {
} else {
topic.setTopicName(request.getParameter("topicName"));
message.setObject(topic);
messageProducer.send(message);
messageProducer.close();
// connection.close();
}
} finally {
if (session != null) {
session.close();
}
if (connection != null) {
connection.close();
}
}
} catch (JMSException ex) {
ex.printStackTrace();
}
getServletConfig().getServletContext().getRequestDispatcher("/
index.jsp").forward(request, response);
}
@Override
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
/**
* Returns a short description of the servlet.
*/
@Override
public String getServletInfo() {
return "Short description";
}
// </editor-fold>
}
----------------------------------------------------------------------------------------------------
///the jms class
package ejb;
import javax.annotation.Resource;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.ejb.MessageDrivenContext;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@MessageDriven(mappedName = "jms/BoardTopic", activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue")
})
public class BoardTopicBean implements MessageListener {
@PersistenceContext
private EntityManager em;
@Resource
MessageDrivenContext mdc;
public BoardTopicBean() {
}
public void onMessage(Message message) {
ObjectMessage msg = null;
try {
msg = (ObjectMessage) message;
persist(msg.getObject());
} catch (JMSException e) {
e.printStackTrace();
mdc.setRollbackOnly();
} catch (Throwable te) {
te.printStackTrace();
}
}
public void persist(Object object) {
// save the object (MessageTable or Topic)
em.persist(object);
// if the object is a MessageTable then add this newly created/
persisted object to the list of messages in the topic
if (object instanceof MessageTable) {
MessageTable msg = (MessageTable) object;
Topic topic = msg.getTopic();
if (topic == null) {
em.remove(msg);
} else {
topic = em.find(Topic.class, topic.getId());
topic.getMessages().add(msg);
em.merge(topic);
}
} else {
System.out.println("Wrong type in
merge..................");
}
}
}
----------------------------------------------------------------------------------------------------------------------
some of the exceptions thrown to the console
DirectConsumer:Caught Exception delivering
messagecom.sun.messaging.jmq.io.Packet cannot be cast to
com.sun.messaging.jms.ra.DirectPacket
MQJMSRA_DM4001: :Exception:ObjectMessage.getObject()DeSerializing
object::message=ejb.Topic
javax.jms.MessageFormatException:
MQJMSRA_DM4001: :Exception:ObjectMessage.getObject()DeSerializing
object::message=ejb.Topic
at
com.sun.messaging.jms.ra.DirectObjectPacket.getObject(DirectObjectPacket.java:
169)
at ejb.HockeyMessagesBean.onMessage(HockeyMessagesBean.java:
34)
at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:
1067)
at
com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
at
com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:
2895)
at
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:
3986)
at
com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:
1111)
at
com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:
74)
at
com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:
179)
at $Proxy52.onMessage(Unknown Source)
at
com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258)
at
com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl
$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: java.lang.ClassNotFoundException: ejb.Topic
at
com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:
718)
at
com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:
631)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.messaging.jms.ra.DirectObjectPacket
$ObjectInputStreamWithContextLoader.resolveClass(DirectObjectPacket.java:
301)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
1575)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
1732)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:
351)
at
com.sun.messaging.jms.ra.DirectObjectPacket.getObject(DirectObjectPacket.java:
155)
... 15 more
DirectConsumer:Caught Exception delivering
messagecom.sun.messaging.jmq.io.Packet cannot be cast to
com.sun.messaging.jms.ra.DirectPacket
MQJMSRA_DM4001: :Exception:ObjectMessage.getObject()DeSerializing
object::message=ejb.HockeyEntity
javax.jms.MessageFormatException:
MQJMSRA_DM4001: :Exception:ObjectMessage.getObject()DeSerializing
object::message=ejb.HockeyEntity
at
com.sun.messaging.jms.ra.DirectObjectPacket.getObject(DirectObjectPacket.java:
169)
at ejb.BoardTopicBean.onMessage(BoardTopicBean.java:33)
at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:
1067)
at
com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
at
com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:
2895)
at
com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:
3986)
at
com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:
1111)
at
com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:
74)
at
com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:
179)
at $Proxy56.onMessage(Unknown Source)
at
com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:258)
at
com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:76)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl
$WorkerThread.run(ThreadPoolImpl.java:555)
Caused by: java.lang.ClassNotFoundException: ejb.HockeyEntity
at
com.sun.enterprise.loader.EJBClassLoader.findClassData(EJBClassLoader.java:
718)
at
com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:
631)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.messaging.jms.ra.DirectObjectPacket
$ObjectInputStreamWithContextLoader.resolveClass(DirectObjectPacket.java:
301)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:
1575)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:
1732)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:
351)
at
com.sun.messaging.jms.ra.DirectObjectPacket.getObject(DirectObjectPacket.java:
155)
... 15 more
DirectConsumer:Caught Exception delivering
messagecom.sun.messaging.jmq.io.Packet cannot be cast to
com.sun.messaging.jms.ra.DirectPacket
MQJMSRA_DM4001: :Exception:ObjectMessage.getObject()DeSerializing
object::message=ejb.HockeyEntity
-----------------------
any idea guys???
- 10
- FYI: A new open source/free O/R mapping tool and server page frameworkAnnounce:
A new open-source O/R mapping tool has just been released. There
are many such programs out there...but this one is very
special because it's simple (no xml configuration ! yay) and has
been tested extensively with postgres (and a bit with mysql).
This tool has been used in production enviroments so the
generated code has most bugs squeezed out by now.
If you have a minute, you can check it out at:
http://www.mollypages.org/dbo/
There's also a server-side page type thingy (like JSP) but with
much cleaner syntax (and easy typing).
Enjoy !
- 11
- BZip2-Files & JavaOk two things:
I'm trying to get the Apache BZip2 Library to work, but I always get a
NullPointerException. My code looks like this:
[CODE]
void load(String filename) throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream(filename);
CBZip2InputStream = new CBZip2InputStream(fis);
}
[/CODE]
As soon as the creation of the CBZip2InputStream is reached, a
NullpointerException is thrown. Why?
Secondly: if the library is corrupted (e.g. doesn't work stable) is
there an alternative to it (Googleing did not help me very much)?
Snyke
- 12
- Eclipse bug?Eclipse bug? Using most recent version (as of a couple weeks ago,
anyway), if it sits idle for a day or two in the taskbar, it stops
responding -- or at least it is really sluggish if you try to use it
again, and not just for a short time, but until you quit and restart it.
- 13
- 14
- GUI locking up, but code running fine.I'm using Netbeans 5.0 beta for an IDE, with swing components. The
situation is something like this:
The program is a board game - the user chooses a building from a panel,
and then is supposed to get a message to choose what resource to pay
for it with. Here's a trace of the code:
Game (main object):
....
board[i].activate():
Game.game.setPlayer(worker);
Game.game.playerMessage("Choose a wooden building
from the building panel.");
Game.game.waitForBuild(type) :
built = false;
state = type + Game.BuildWood -
1;
mainPanel.buildings.getBP().setSelectedIndex(type-1);
while(!built)
{ Thread.yield(); }
No problems yet. This works fine, unless a building that needs to call
chooseResource is selected.
So, the user clicks one of these buildings, which activates the
following code, which is where the freeze occurs:
String r = Game.game.chooseResource():
state = Game.chooseResource;
resource = "";
while(resource.length()==0)
Thread.yield();
return resource;
Now chooseResource does work in any other context - resource gets set
by a mouseClicked event handler in a panel out there. But at this
point, the GUI stops responding. The playerMessage never gets printed,
and the click event never gets triggered. I did some investigating,
printing out numbers inside the two inmost loops, and the
chooseResource loop is continually running. I know the code's ugly,
but even so, the cause of this behavior is beyond me. Any suggestions
would be greatly appreciated!
- 15
- richtext componentIsn't there a richtext component available within java sdk? I know I don't
see any in the pallette, is there a class where i can initiate one? or 3rd
party?
|
|
|