Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Peter Matthews

Greenhorn
+ Follow
since Nov 07, 2005
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 Peter Matthews

Thanks guys for all your input. I guess I'll try and get moderately experienced in both, instead of specialising in one. I was just asking the question as I'm not too experienced in either (well, more in J2EE), so was just wondering whether to gain more in one than the other - but I get from your responses that it would be better to gain a good understanding of both - so that is what I'll do. If anyone has been a junior web developer - what should I expect from my first junior role - I just don't like the unknown Thanks again for all your input! Pete
16 years ago
Hi All,

I'm currently undertaking a masters degree in Web Engineering, which is due to end in September, after the submission of my thesis. The course involved many aspects of web-based programming, with strong emphasis on .NET (ASP.NET, ADO.NET) and J2EE (JSPs, Servlets, Enterprise Java Beans). I'm basically posting because of my uncertainty of my career path. I'm wanting to get into web development, but not sure whether to pursue it in J2EE or .NET. I've searched many job sites, and have seen that .NET positions are more easy to come by, however J2EE positions usually come with a better salary package. Regarding my experience between the two, I'm more experienced in J2EE (more specifically J2SE), but not sure whether to gain more experience in .NET as more jobs are available. What opinions do you all have? Is it better to go for .NET if my interest is in Web development or stick with J2EE and become more experienced in that - trying to get an unbiased opinion, as I know I'm posting in a Java forum . Also I'm not sure what to expect from my first junior position when the time comes, how much do employers expect you to know when taking a junior role - I guess I'm pretty nervous at the prospect at getting in somewhere and them throwing me into the deep end. As you can I guess I havent had any experience in software companies (one regret I have of not taking a placemen!). However I do have experience in creating websites for several companies, that have given me some experience of the development process as well as client commication skills. One final question is, would it be worthwhile taking the SCJP cert if I decide to take the J2EE path, in order to give me a better chance of getting an interview due to my limited experience? Ok, I'll stop there - any suggestions would be great!! Thanks. Pete
16 years ago
Hi Jeanne,

I have done as you suggested - and it fails at the first hurdle:

SELECT DISTINCT OBJECT(h) FROM House h, Location l
WHERE h.location = l.name

Error message returned:

Error: line(2) column(18): JDO75311: Invalid argument(s) for '='.
; requested operation cannot be completed

I have no idea what the error message means (and have search google, without luck). Do you have any ideas - the syntax and names seems fine to me!

Thanks,

Pete
Thanks for the tip, however the same exception still persists afterwards - any other ideas - maybe its a mismatch of datatypes?

SELECT DISTINCT OBJECT(h) FROM House h, Location l
WHERE h.location = l.name
AND l.description = ?1
AND h.bedrooms = ?2
AND (h.price BETWEEN ?3 AND ?4)

Ive included the database tables below to see if that is where I am going wrong - sorry about all these questions, its just that Ive been at this for a few days, and have reached no where.

create table House(
ref varchar(16),
seller varchar(16),
description varchar(512),
bedrooms integer,
location varchar(16),
price integer,
CONSTRAINT pk_house PRIMARY KEY (ref,seller),
CONSTRAINT fk_seller FOREIGN KEY (seller) REFERENCES Seller(login),
CONSTRAINT fk_location FOREIGN KEY (location) REFERENCES Location(name));

create table Location(
name varchar(16) CONSTRAINT pk_location PRIMARY KEY,
description varchar(64));

Thanks for all the help so far, much appreciated!

Pete
Thanks Jeanne,

However I'm still having difficulties - as I'm very new to EJBQL - and not too hot on SQL either.

The revised EJBQL query is:

EJBQL: SELECT DISTINCT OBJECT(h)
FROM House h, Location l WHERE h.location = l.name AND location.description = ?1 AND h.bedrooms = ?2
AND h.price BETWEEN ?3 AND ?4

But now I am getting the following error when deploying:

EJBQL: SELECT DISTINCT OBJECT(h)
FROM House h, Location l WHERE h.location = l.name AND location.description = ?1 AND h.bedrooms = ?2
AND h.price BETWEEN ?3 AND ?4
Error: line(2) column(43): JDO75311: Invalid argument(s) for '='.
; requested operation cannot be completed
C:\Documents and Settings\Peter Matthews\HBUYERS\nbproject\build-impl.xml:281: Deployment failed.
BUILD FAILED (total time: 1 second)

Any ideas what is going wrong? Do I need to specify any relationships (CMRs)? Or is my syntax incorrect?

Thanks once again for your help,

Pete
Hi All,

Figured out the last problem (previous post), but have hit another in the process...as it always seems to be the case!

The EJBQL:

SELECT DISTINCT OBJECT(h)
FROM House h, Location l WHERE l.name = ?1 AND h.bedrooms = ?2
AND h.price BETWEEN ?3 AND ?4

The bedrooms and price conditions work, the problem occurs in the location. For example, I put in Headingley (for location name), 3 (for bedrooms), and 0 (for min price) and 500000 (for max. price). It should display no results, as there are no properties in headingley, however it displays the details of a house located in Harehills which has 3 bedrooms and is between the prices specified. Any ideas why it is ignoring the location condition?

Thanks,

Pete
Hi All,

I'm trying to put together some finder methods but hit an exception which I can't figure out - just wondered if anyone could shed some light on it (would be much appreciated! ). BTW, just to let you know, I'm a novice at the EJB thing, so if I have done anything completely silly, just excuse it

EJB QL Statement:

SELECT OBJECT(h)
FROM House h WHERE h.location = ?1
AND h.bedrooms = ?2
AND h.price BETWEEN ?3 AND ?4

Parameters:

String location
int bedrooms
int minPrice
int maxPrice

Exception:

EJBQL: SELECT OBJECT(h)
FROM House h WHERE h.location = ?1
AND h.bedrooms = ?2
AND h.price BETWEEN ?3 AND ?4
Error: line(2) column(31): JDO75311: Invalid argument(s) for '='.
; requested operation cannot be completed

I have checked all datatypes and they all correspond correctly to the database datatypes. Any help would be very welcome...

Thanks again,

Pete
Hi Ernest,

Its being used by a servlet and then being passed to a JSP... is there anyway of getting around this problem?

Thanks,

Pete
Hi All,

Just started working with Netbeans and encountered a problem when trying to format a String. I'm wanting to include more than one space between the variables as shown below:

public String toString() {
String s = ref + " " + seller + " " + description + " " + bedrooms + " " + "�"+price;

return s;
}

But everything I try, it displays only one space between each variable. Even if I use the "\t" it doesnt make a difference. Its just that I want to align them to column headings, so its quite frustrating!

Is there an option I need to change in Netbeans, or am I being dumb!?

Thanks for any help,

Pete
I meant System.exit() - these late nights are catching up with me!
16 years ago
Thanks David - taking the System.out() out did the trick!
16 years ago
Hi All,

I'm encountering a problem when trying to access a session bean via a servlet - I'm getting the following security exception aswell as Null Pointer exception:

java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkExit(SecurityManager.java:744)
at com.sun.enterprise.J2EESecurityManager.checkExit(J2EESecurityManager.java:83)
at java.lang.Runtime.exit(Runtime.java:88)
at java.lang.System.exit(System.java:868)
at searchservlet.SearchServlet.processRequest(SearchServlet.java:45)
at searchservlet.SearchServlet.doGet(SearchServlet.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
|#]

[#|2006-04-15T10:22:08.229+0100|SEVERE|sun-appserver-pe8.1_02|javax.enterprise.system.container.web|_ThreadID=13;|StandardWrapperValve[SearchServlet]: Servlet.service() for servlet SearchServlet threw exception
java.lang.NullPointerException
at searchservlet.SearchServlet.processRequest(SearchServlet.java:56)
at searchservlet.SearchServlet.doGet(SearchServlet.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
|#]

I have used the session bean via a standard client, and all worked fine, so I'm not sure why also I have a Null Pointer exception. I am novice in both servlets and session beans, so any help would be very much appreciated.

Thanks, Peter

Here is my servlet code if it helps:

16 years ago
Firstly, my apologies for cross posting. My MSc in Web Engineering mainly consists of J2EE and .NET with database development. In regards to my abilities, I undertook a bachelors in software development so I am fairly proficient in core java and database development. Coming back to the Masters thesis, I am required to come up with a novel idea (i.e. extending the knowledge base of the particular area I will research in). In addition to my thesis I will need to provide a working prototype, or final version dependent on the project I choose to do. This is the first year that this course has ran, so answering the question on what the past projects were like...I am unable to provide examples.

Thanks again.

Pete
16 years ago
Hi All,

I'm currently undertaking a masters in Web Engineering, but I'm having a hard time coming up with an interesting project for my thesis. Just wondering whether anyone could come up with any inspirational ideas for me? Obviously, it has to be web-related, but apart from that it is quite open.

Look forward to reading the responses. Thanks in advance.

Pete
16 years ago
Hi All,

First of all, thanks to Edward Chen for answering my query on javax/mail/MessagingException. Finally have that sorted, however it has led me to another problem...

Ok, heres the story...I have an applet which is deployed on Apache Webserver (localhost), with the neccessary files needed for the RMI app in the same directory - htdocs(i.e. Applet class, RMI Interface, and Stub). I have the object server running on the same machine - which is in the directory C:/pumps. For the binding I'm using rmi://localhost/PumpService. I'm running the rmiregistry in the C directory. The problem is that when I access the applet through localhost(i.e. http://localhost/pumps.htm) it doesnt work, doesnt seem to access the remote object. However, if I directly load the html page from C:/Apache2/htdocs/pumps.htm - it works perfectly. Any ideas on the way I could get it working through the localhost?

Thanks...
16 years ago