Win a copy of Rust Web Development this week in the Other Languages forum!

Ioan Berciu

Greenhorn
+ Follow
since Nov 17, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ioan Berciu

Thank you for your answer I manage to make it work.
12 years ago
Hi,

I have a seam generated application with Statles sessions beans.
The app name is myapp and inside it there is a myapp.jar file wich contains the stateless sessions.

After jboss 4.2.3 is started I can see my statless session beans mapped to myapp/EJBNAME/local
EJBNAME = name of the Statles EJB class

I am able to lookup any statless session bean using the jndi mapping above as long as myapp.jarfile name is unchanged.

If I change myapp.jar file name to test.jar and also change the in application.xml this :
<module>
<ejb>myapp.jar</ejb>
</module>
to:
<module>
<ejb>test.jar</ejb>
</module>

I am unable to lookupany of my statless session beans.

I do not know why is this and if there is a work around.

Could anyone help on this?

Thank you


I
12 years ago
That was it.

Sometimes is right infront of you and you just can't see it.

Thank you Ulf.
15 years ago
It apears that the first byte that was read from the file is sent over and over to the server.

Couldn't found out more.
15 years ago
Hi!

I want to upload pictures on a server using HttpURLConnection.

My servlet is deployed in Tomcat 5.5.17.

The problem is that the upload never stops and the wrong data is uploaded.

On the server the uploaded value is allways 255 for each byte.

I belive that the communication is binary.

Did anyone encounterd this problem?
Any help will be appreciated.

Thank you.


Servlet code:




Client code:



web.xml descriptor:

15 years ago
Thank you Dave!
That solved it.

You are right about the shouting.

Thanks again.
15 years ago
Hi!

I have a jar in which is my application and a jar with dom4j;

I try to start my application as bellow:

java -classpath ./lib/dom4j-1.6.1.jar -jar httpclient.jar checkupdate

I get this exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/Branch
at com.httpclient.main.MainHttpClient.checkForUpdates MainHttpClient.java:87)
at com.httpclient.main.MainHttpClient.main(MainHttpClient.java:26)

If I use this line it works

java -classpath ./lib/dom4j-1.6.1.jar;httpclient.jar com.httpclient.main.MainHttpClient checkupdate

In the Manifest of the jar file the main class is correctly specified.
I looked inside dom4j-1.6.1.jar and the reported missing class is there.

I want to use relative paths.

Have anyone encountered this problem?

Thanks
[ June 29, 2006: Message edited by: David O'Meara ]
15 years ago
Hi!
Thanks for pointing out that the fields might be in a super class.
They were!

Also I would like to add that the fileds were package accessible (no access modifier: private, public or protected infront of them). So to be able to get them I set the accessible flag of each field to true:

addressField.setAccessible(true);
portField.setAccessible(true);

Only afthere setting true on accessible flag I was able to get the values
Thanks all for repllying so quick.
15 years ago
Hi!

I have this code:

Class cls = stream.getClass();
Field addressField = cls.getDeclaredField("address");
Field portField = cls.getDeclaredField("port");
this.dataAddress = (InetAddress)addressField.get((RecvSSRCInfo)stream);
this.dataPort = portField.getInt((RecvSSRCInfo)stream);

stream is of type com.sun.media.rtp.RecvSSRCInfo

In Eclipse on Expressions window(watch) I see the fileds address and port of stream object, they have the expected values also but when I try to get these values using reflection it throws NoSuchFieldException.

Can anyone please help with this?

Thank you!
15 years ago
Hi all!

In a JSF form i have this code fragment.

<f:verbatim >
<input name="importFile" type="file" size="10">
</f:verbatim >

To upload the selected file I use commons-fileupload-1.0.jar from tomcat's 5.0 server dir.

I get this exception:

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded

JSF forms dont allow the attribute encType to be set.
I tried this and the hole aplication dont work.

Does any one know a solution for this problem?

Thanks in advance.
17 years ago
Hello.
I am using JSF 1.0 final and tomcat 5.0
I have two jsp file
first jsp file "testform.jsp" contains:

<HTML>
<HEAD>
<title>Test Form</title>
<STYLE TYPE="text/css">
</HEAD>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<body bgcolor="white">
<f:view>
<h:form>
<jsp:include page="QA_AEC_form.jsp"/>
</h:form>
</f:view>
</body>
</HTML>


the second jsp file "QA_AEC_form.jsp" contains:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:subview id="QA_AEC_FORM">
<table>
<tr>
<td align="right">Tube room</td>
<td align="left">
<h:selectOneMenu id="tuberoom" value="">
</h:selectOneMenu>
</td>
</tr>
<tr>
<td align="right">tube name</td> <td align="left">some tube name</td>
</tr>
<tr>
<td align="right">tube model</td> <td align="left">some tube model</td>
</tr>
<tr>
<td align="right">processor name</td>
<td align="left">
<h:selectOneMenu id="processorname" value="">
</h:selectOneMenu>
</td>
</tr>
</table>
</f:subview>

when i call testform.jsp on internet explorer

this is th sourc of the rendered page:

<HTML>
<HEAD>
<title>Test Form</title>
<STYLE TYPE="text/css">
</HEAD>



<body bgcolor="white">

<form id="_id0" method="post" action="/qaddsv2/faces/testform.jsp" enctype="application/x-www-form-urlencoded">

<select id="_id0:QA_AEC_FORM:tuberoom" name="_id0:QA_AEC_FORM:tuberoom" size="1"></select><select id="_id0:QA_AEC_FORM rocessorname" name="_id0:QA_AEC_FORM rocessorname" size="1"></select>



<table>
<tr>
<td align="right">Tube room</td>
<td align="left">


</td>
</tr>
<tr>
<td align="right">tube name</td> <td align="left">some tube name</td>
</tr>
<tr>
<td align="right">tube model</td> <td align="left">some tube model</td>
</tr>
<tr>
<td align="right">processor name</td>
<td align="left">


</td>
</tr>
</table>

<input type="hidden" name="_id0" value="_id0" /></form>

</body>
</HTML>

My question is why is this happening and how can i fix it?
17 years ago
Hi, I want to write a jdbc driver for an access database and I could use some help (source code or links maybe a tutorial on how to do it).Don't want to use odbc just jdbc to connect to the database.One more question : is it possible to connect to a database just specifing the path and the name of the database ?
Tanks.
Hi Marilyn de Queiroz.
Your solution did not worked for me.
I tried an other approach and it worked.
In web.xml file I put a the folloing code:
<servlet-mapping>
<servlet-name>Register</servlet-name>
<url-pattern>/Register</url-pattern>
</servlet-mapping>
and only after that it worked.
19 years ago
Hi .
You get this error if the class is not in your import section or if the jar file that contains it is not in your classpath.Try to put the jar file in your JAVA_HOME/lib and in JAVA_HOME/jre/lib/ext and in your CATALINA_HOME/lib
19 years ago
Hi!
Can anyone help me ?
I have a servlet in the WEB-INF\classes
and when I try to access the servlet
I get the following error:
HTTP 404 - File not found
Internet Explorer
This is the web.xml content:
<web-app>
<display-name>Proiect SICE</display-name>
<description>Proiect pentru scoala.</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>Register</servlet-name>
<servlet-class>Register</servlet-class>
</servlet>
</web-app>
This is the content of the servlet:
public class Register extends HttpServlet
{
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<HTML><HEAD><TITLE>Server respons</TITLE></HEAD>");
out.println("<BODY><B>bla bla bla ...</B>");
out.println("</BODY></HTML>");
out.close();
}
}
Should I write anything else in the web.xml ?
Why can't orion see my servlet ?
19 years ago