M. Dooze

Greenhorn
+ Follow
since Oct 29, 2007
Merit badge: grant badges
For More
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 M. Dooze

I know that this post is sort of outdated but I just wanted to clarify a part of the original post asking for when to choose between implementing your web service as an EJB vs Servlet. My knowledge is that the choice is between EJB and a POJO( a java object--hence Plain Old Java Object). Assuming you are using JAX-WS implementation you then map the service implementation(if its a Pojo) as a servlet in web.xml (don't worry I'll provide links for tutorials)


So when or why should you choose EJB over POJO.
1. A POJO web service is packaged in a web module(you map the pojo as a servlet in web.xml while an ejb web service is packaged in an ejb-jar

2. you get the advantage of declarative transaction and security from the ejb container for your ejb web service

3. EJB web services can use additional protocols like RMI as a result of having remote interface

If you have no concerns for these three points then the choice is simply up to you.

your links:
http://www.mastertheboss.com/en/web-interfaces/101-jboss-web-services-part-1.html


http://www.learntechnology.net/content/webservices/jboss_webservices.jsp

14 years ago
I have read most of the post here about PACKAGE DOES NOT EXIST but I still cant find a solution to my problem..please see below for a description of the problem

Environment:
Perforce, Eclipse-Europa, Ant 1.7


1.I am working on two different platforms with two different eclipse workspaces.
2.I build some of the code on platform x2 and import the jar into platform x1 in Eclipse and then compile with ant each time on both platforms.
3.I have a jar file call it x2.jar from platform x2 in which I have an Interface IX2.java that I want to use on the x1 side. Please don�t ask about this design, this is how I met the company code and I have to work with it like that.

Everything was compilling and working fine even after I had made code changes on both platforms, I was testing and after making more changes on the x2 side I cleaned and recompile fine on x2 side when I can to the x1 side, that�s when things started---This has been going on for days now and I�m getting worried!


Here is the Ant output

build-wsglogin:
[echo] ************************************************************
[echo] * Building wsglogin component..
[echo] ************************************************************

prepare:
[mkdir] Created dir: C:\projects\Platform1Shim\components\wsglogin\build
[mkdir] Created dir: C:\projects\Platform1Shim\stage\wsglogin
[mkdir] Created dir: C:\projects\Platform1Shim\stage\wsglogin-client
[mkdir] Created dir: C:\projects\Platform1Shim\components\wsglogin\build\classes

compile:
[javac] Compiling 12 source files to C:\projects\Platform1Shim\components\wsglogin\build\classes
[javac] C:\projects\Platform1Shim\components\wsglogin\server\client\GatewayLogin.java:12: package com.wsgatewaylogin does not exist �this package comes from the x2 branch
[javac] import com.wsgatewaylogin.IGateway;
[javac] ^
[javac] C:\projects\Platform1Shim\components\components\wsglogin\server\client\GatewayLogin.java:20: cannot find symbol
[javac] symbol: class IGateway


[javac] public class GatewayLogin implements IGateway{
[javac] ^
[javac] 2 errors

BUILD FAILED
C:\projects\Platform1Shim\build.xml:220: The following error occurred while executing this line:
C:\projects\Platform1Shim\src\components\wsglogin\build.xml:110: Compile failed; see the compiler error output for details.

Total time: 3 minutes 43 seconds



Here�s a part of build.xml on the x1 side showing line 110
I made new additions to the file while trying to solve the problem but it doesn�t help.

<?xml version="1.0"?>

<!-- ======================================================================= -->
<!-- build file -->
<!-- ======================================================================= -->

<project name="wsglogin" default="ejbjar" basedir=".">

<property file="../local.properties"/>
<property environment="env"/>

<property name="src.dir" value="${basedir}/src"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="dev.root" value="../../.."/>
<property name="dist.dir" value="${dev.root}/stage/wsglogin"/>
<property name="client.dist.dir" value="${dev.root}/stage/wsglogin-client"/>
<property name="stage.dir" value="${dev.root}/stage"/>
<property name="conf.dir" value="${src.dir}/conf"/>
<property name="components.dir" value="../../components"/>
<property name="thirdparty.dir" value="../../../thirdparty"/>
<property name="p2.dir" value="../../../../../../Source-Branches/Platform2-1.1"/>
<property name="jboss.dir" value="${thirdparty.dir}/jboss-4.0.5/client"/>
<!-- <property name="jboss.home" value="C:/software/jboss-4.0.5.GA"/> -->

<!-- Build classpath -->
<path id="classpath">

<fileset dir="${dev.root}/stage/syncservice">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/build/distribution"> --This is the location of the jar that has the package which cannot be found
<include name="**/*.jar"/>
<!-- new addition by me-->
<include name="core2-wsgatewaylogin.jar"/> --this is the name of that jar. I tried to force it to get seen but still no luck!
<!-- end new addition-->
</fileset>
<fileset dir="${p2.dir}/compile-lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib/jboss">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${p2.dir}/lib/xfire">
<include name="**/*.jar"/>
</fileset>

<fileset dir="${p2.dir}/lib/axis">
<include name="**/*.jar"/>
</fileset>

<!-- new addition-->
<fileset dir="${thirdparty.dir}/bouncycastle/lib">
<include name ="bcprov-jdk14-116.jar"/>
</fileset>

<fileset dir="${thirdparty.dir}/apache/log4j/dist/lib">
<include name ="log4j.jar"/>
</fileset>

<fileset dir="${thirdparty.dir}/sun/j2ee/lib">
<include name ="j2ee.jar"/>
</fileset>
<!-- end new addition-->

<fileset dir="${thirdparty.dir}/junit/junit3.8.1">
<include name="**/*.jar"/>
</fileset>

<fileset dir="${jboss.dir}">
<include name="**/*.jar"/>
</fileset>

<!--
<fileset dir="${jboss.home}/client">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jboss.home}/server/all/lib">
<include name="**/*.jar"/>
</fileset>
-->


<pathelement location="${build.classes.dir}"/>
</path>


<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${client.dist.dir}"/>
<mkdir dir="${build.classes.dir}"/>
</target>

<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
optimize="off"
includes="**"> line 110 is here�this is where the failure is occurring since the package cannot be found!
<classpath refid="classpath"/>
</javac>
</target>
16 years ago
Hey jeanne,
thanks for pointing out the mistake...I have made the necessary corrections and I'd say big appology on that one..
Dooze
but you have made it even a more by adding two extra ones...so now there's a whooooping count of 5 count of with one looking uninterested and sort of shocked at how its friends are bling blinging...
never mind..I figured out the appropriate method..so i wanted to share it for anyone who may have the same issue:

loginStmt.setObject(2, info.getPermissions()); will do...

For those who aren't that familiar with jdbc placehoders, the number in this methos just refers to the location of the ?-question marke(ie the place holder) that you are setting value for in the preparedstatement...
you create the preparestatment like so:

private String loginStr = "insert insert into vn_wsg_login (user_name, remote_address, permissions, token, login_time, last_authenticated) " +
"values (?, ?, ?, ?, ?, ?)";


con = getConnection(); //my own method created for use

loginStmt = con.prepareStatement(loginStr); //this is where I am creating the prepared statement

loginStmt.setString(0,info.getUserName()); //zero for the firs ?
loginStmt.setString(1, info.getRemoteAddress()); //1 for the 2nd ? and
loginStmt.setObject(2, info.getPermissions()); //2 for the 3rd one..

good luck!
Dear all, I am having a little issue with saving a set into an oracle db using plain JDBC.
I have a transfer object LoggedInUserInfo and want to persist its filds in my login table but can't find any way to handle the collection part.

Here's the object

public class LoggedInUserInfo implements Serializable
{
private String userName;
private Date loginTime;
private String remoteAddress;

private Set <String> permissions;


public LoggedInUserInfo(String userName)
{
this.userName = userName;
this.loginTime = new Date();
}


public Date getLoginTime()
{
return loginTime;
}

public String getUserName()
{
return userName;
}


public String getRemoteAddress()
{
return remoteAddress;
}
public Set<String> getPermissions()
{
return permissions;
}

In my dao class, I issue a prepared statment and proced to set its place holders like so:

LoggedInUserInfo info --my transfer object that I want to save.
PrepareStatement loginStmt--my prepared statement

loginStmt.setString(0,info.getUsername());
..
loginStmt.setxx(1, info.getPermissions)....DOESN'T WORK HERE..WHICH METHOD CAN I USE, HOW ELSE CAN I DO THIS? setArray() is not working either...