|
Does anyone know a good tutorial of how to configuare RichFaces on Eclipse ?
Paul.
|
|
|
|
|
If set up a small EJB in netbeans and deployed it through Glassfish,
In the same netbeans instance I have a client that should connect:
Context context = null;
this.remoteBean = null;
try
{
context = new InitialContext();
System.out.println("Got ic" + context);
this.remoteBean = (VotingRemote) context.lookup("VotingBean");
}
catch (NamingException ex)
{
System.out.println("Lookup failed: " + ex);
}
Am I doing something stupid [probably] ot get this error:
07-Sep-2010 19:55:22 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2348)
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2369)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:212)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:225)
at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:159)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:156)
at com.sun.corba.ee.impl.resolver.BootstrapResolverImpl.invoke(BootstrapResolverImpl.java:77)
at com.sun.corba.ee.impl.resolver.BootstrapResolverImpl.list(BootstrapResolverImpl.java:129)
at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:30)
at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:30)
at com.sun.corba.ee.impl.resolver.CompositeResolverImpl.list(CompositeResolverImpl.java:30)
at com.sun.corba.ee.impl.orb.ORBImpl.list_initial_services(ORBImpl.java:1238)
at com.sun.appserv.naming.S1ASCtxFactory.<clinit>(S1ASCtxFactory.java:141)
at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitContextFactory.java:78)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:175)
at client.VotingClient.<init>(VotingClient.java:76)
at client.VotingClient$3.run(VotingClient.java:280)
This is getting up my left nostril!
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
hi,
i have the basic knowledge about java, i can read and understand a simple java code...
but i m looking for guidance on how i can get good java programming skills. i have solid basics knowledge and did very well at school,
but unfortunately i did not get the opportunity to take the next step and be able to write real and functioning useful programs.
can somebody help show me the way?? i m also wondering if java is the best language for building software...
thanks in advance...
...i have heard that one can participate in open source projects in order to gain programming skills while "participating in the open source society"...
but i guess one need to get a certain level of skills first...
|
|
|
|
|
Take a look here[^] at the various Java tutorials, from beginner to advanced. As to whether Java is the 'best' language, that really depends on market forces. You should look around your own environment at the sort of jobs that are being advertised to see what skills are most in demand.
It's time for a new signature.
|
|
|
|
|
|
One of the best way to become a good programmer is not only to take part in project(even that is one of the best way) but to rather advance in algorithms with Design patterns: Controller, Decorator, Wrapper, Delegate, etc.
Look for tutorial with design patterns. Many open source application use design patterns, actually all of them.
Paul.
|
|
|
|
|
Hi, thanks for your answer!
i actually have had a course in design patterns and i did pretty well (i got a B..lol).
But as you mentioned, i thought participating in a project would help me a lot to practice what i know and learn more in the same time.
i guess being in group with more experienced programmers would help me put things together.
do you happen to know how i can participate in those open source Project???
i m kind of tired of just theory, i could use some practice. The good thing with these projects is that you learn while doing something useful....
Thanks
|
|
|
|
|
|
|
I am a newbie for liferay. I have created a test.jsp that will display "hello world" as an output. And I wonder how to "import" the test.jsp to liferay as a portlet.
Can anybody guide me through this? I really have no idea how to do this.
|
|
|
|
|
Try the documentation[^]. There is little point in developing a program if you have no idea how to implement it.
It's time for a new signature.
|
|
|
|
|
thanks for replied.
The test.jsp is just for testing purpose. In fact i want to "import" a graph that is created by chartDirector, i dont knw how to display it as a portlet in liferay.
Can anyone show me the example of how to accomplish this?
|
|
|
|
|
Repeating your original question is unlikely to yield a different answer. Try the documentation first and search for other liferay users or forums on the internet. They are much more likely to get you the answer you need.
It's time for a new signature.
|
|
|
|
|
i found a way already.
firstly, build a .war file for the web site.
then in liferay, install the .war, and it is prepared to be drag and drop as a new application.
|
|
|
|
|
Hi,
I am able to extract the text from the PDF file using the PDFStripper, but I would like to read the Table of content of the PDF document. How can I do that? How do I know the Page I am reading is Table of Contents? and also how to differentiate the Chapter heading and the subsection of chapter of the Table of Content?
Any help in this is highly appreciated.
Thanks
Neil
|
|
|
|
|
Do NOT cross post in multiple forums. I makes collaborating on an answer near impossible.
|
|
|
|
|
hi !
I am interfacing microcontoller to my pc and I am looking for a simple java code that will do the following :
1- send a flag char say '^' on serial port and wait for response with a '^' from micro.
2- if response found then go ahead and read the serial buffer (preferably circular )
3- do something here
4- go back to step 1.
I found online code called SimpleRead.java , it does read the incoming data but is acting strange by printing the same data multiple times, putting extra spaces between charaters etc.
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")) {
// if (portId.getName().equals("/dev/term/a")) {
SimpleRead reader = new SimpleRead();
}
}
}
}
public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {System.out.println(e);}
try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {System.out.println(e);}
try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {System.out.println(e);}
serialPort.notifyOnDataAvailable(true);
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {System.out.println(e);}
readThread = new Thread(this);
readThread.start();
}
public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {System.out.println(e);}
}
public void serialEvent(SerialPortEvent event) {
switch(event.getEventType()) {
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[20];
try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
}
System.out.print(new String(readBuffer));
} catch (IOException e) {System.out.println(e);}
break;
}
}
}
|
|
|
|
|
Your code is difficult to read, please place between <pre></pre> tags as referenced in the Forum Guidelines[^].
It's time for a new signature.
|
|
|
|
|
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")) {
SimpleRead reader = new SimpleRead();
}
}
}
}
public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {System.out.println(e);}
try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {System.out.println(e);}
try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {System.out.println(e);}
serialPort.notifyOnDataAvailable(true);
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {System.out.println(e);}
readThread = new Thread(this);
readThread.start();
}
public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {System.out.println(e);}
}
public void serialEvent(SerialPortEvent event) {
switch(event.getEventType()) {
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[20];
try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
}
System.out.print(new String(readBuffer));
} catch (IOException e) {System.out.println(e);}
break;
}
}
}
|
|
|
|
|
Did you notice that it is still not formatted properly? Please edit your original message, don't post a new one, and ensure the indentations are correct. When you have finished your edit use the preview button to check that it is correct.
It's time for a new signature.
|
|
|
|
|
<pre>
import java.io.*;
import java.util.*;
import javax.comm.*;
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")) {
// if (portId.getName().equals("/dev/term/a")) {
SimpleRead reader = new SimpleRead();
}
}
}
}
public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {System.out.println(e);}
try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {System.out.println(e);}
try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {System.out.println(e);}
serialPort.notifyOnDataAvailable(true);
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {System.out.println(e);}
readThread = new Thread(this);
readThread.start();
}
public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {System.out.println(e);}
}
public void serialEvent(SerialPortEvent event) {
switch(event.getEventType()) {
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[200];
try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
}
System.out.print(new String(readBuffer));
} catch (IOException e) {System.out.println(e);}
break;
}
}
}
</pre>
|
|
|
|
|
Amazing! do you find it impossible to understand what you are asked to do and also to review the results of your efforts.
It's time for a new signature.
|
|
|
|
|
what are you talking about ? I put the code between <pre> and </pre> and its FORMATTED.
please be nice , just being good in tech thing doesnt make you a nice person.
|
|
|
|
|
Firstly I suggested that you edit your original question and not post a new one for each attempt at formatting your code. Secondly if you look at the last post you will notice that the pre tags show up at the top and bottom, so they have been encoded rather than interpreted as HTML; I guess you did a copy and post operation. I will allow that you could be forgiven for thinking that it was correct.
Be that as it may I have looked at your code, and the original article which I think is this one[^] and can see nothing wrong. It may well be that the information you are receiving from the serial connection is not as you expect. I suggest using your debugger to trace the data as it arrives in your application.
For the record when using the <pre></pre> tags your code should look like this:
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
note the colour scheme.
But not like this:
<pre>
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
</pre>
It's time for a new signature.
|
|
|
|
|
Thanks for your suggestion Richard I will try to debug !
|
|
|
|