Refactoring question

2009-11-22 Thread neo anderson

I use maven 2.0.9, jdk 1.6.0_10 to build my project. 

Now I encounter a dilemma. I have source code e.g. example/ioc/MyIoc.java,
example/ioc/tapestry5/MyIocWrapper.java and related Test files. They are
located in different folders at the beginning. 

Now I want to reorganize/ refactor the source code. So the structure may
become example/ioc/MyIoc.java, example/ioc/MyIocWrapper.java. However, there
are many classes which has similar situation. That means they may just be
located in different folders. 

As I understand, in eclipse a developer can simply right-click and choose
refactoring after modifying the source, then related source code in other
classes would be changed as well. So I would like to know is there any
chance this can be achieve using maven plugin? Or generally people who use
maven (but don't use eclipse) would recommend the best approach?

I appreciate any suggestion.

Thank you very much.
-- 
View this message in context: 
http://old.nabble.com/Refactoring-question-tp26464173p26464173.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



persistence unit can not be found during test

2009-08-12 Thread Neo Anderson
I encouter a problem when running maven test + jpa + mysql. The report result 
always shows that `No Persistence provider for EntityManager named jpa' (where 
jpa is the persistent-unit name specified in the persistence.xml under 
src/main/resources/META-INF). It looks like the test (e.g. mvn test) can not 
find the persistence.xml file; however, a tutorial I found out on the internet 
- 
http://www.stripesbook.com/blog/index.php?/archives/34-Java-Persistence-Maven-2,-JPA,-and-Hibernate-Quickstart.html,
 its source code structure is similar to mine and its test can be executed 
without a problem. 

Where should I specify the persistence.xml path so that the mvn test will pick 
up the persistence unit (I try specify persistence.xml in 
test/resources/META-INF folder it doesn't work as well)? Or where should I 
check that might cause such problem?

I appreciate any help.

env: debian kernel 2.6.30-1/ java 1.6.0_10/ maven 2.0.9

exception:

Caused by: javax.persistence.PersistenceException: No Persistence provider for 
EntityManager named jpa
at 
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
at 
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
at 
exmample.domain.PersistenceProvider.clinit(PersistenceProvider.java:35)
... 63 more


PersistenceProvider.java

public class PersistenceProvider{

public static final String PERSISTENCE_UNIT_NAME = jpa;
private static EntityManagerFactory factory;

static {
try {
factory = 
Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
}catch(Throwable t) {
throw new ExceptionInInitializerError(t);
}
}
 
public static EntityManagerFactory createPersistenceFactory() {
return factory;
}
 
public static void close() {
if(null == factory)
throw new NullPointerException(No EntityManagerFactory 
available!);
factory.close();
}   
}

persistence.xml

persistence xmlns=http://java.sun.com/xml/ns/persistence;
 xmlns:xsi=http://www.23.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/ns/persistence
 http://java.sun.com/ns/persistence/persistence_1_0.xsd;
 version=1.0
persistence-unit name=jpa
providerorg.hibernate.ejb.HibernatePersistence/provider

properties
property name=hibernate.archive.autodetection
  value=class, hbm/
 
property name=hibernate.show_sql value=true/
property name=hibernate.format_sql value=true/

property name=hibernate.dialect 
  value=org.hibernate.dialect.MySQLDialect/ 
property name=hibernate.connection.driver_class 
  value=com.mysql.jdbc.Driver/ 
property name=hibernate.connection.url 
  value=jdbc:mysql://localhost/demo/ 

property name=hibernate.connection.username value=root/ 
property name=hibernate.connection.password value=*/ 
!--property name=hibernate.hbm2ddl.auto value=create/--
/properties
/persistence-unit
/persistence 

pom.xml

dependencies

!-- bsh --
dependency
groupIdorg.beanshell/groupId
artifactIdbsh/artifactId
version2.0b4/version
/dependency 

!-- aspectj --
dependency
groupIdaspectj/groupId
artifactIdaspectjrt/artifactId
version1.5.4/version
/dependency

!-- tapestry --
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-core/artifactId
version${tapestry-release-version}/version
/dependency
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-ioc/artifactId
version${tapestry-release-version}/version
/dependency
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry5-annotations/artifactId
version${tapestry-release-version}/version
/dependency

!-- hibernate --
dependency
groupIdorg.hibernate/groupId
artifactIdhibernate/artifactId
version3.2.2.ga/version
exclusions
exclusion
artifactIdjta/artifactId
groupIdjavax.transaction/groupId
/exclusion
/exclusions
/dependency
dependency
groupIdc3p0/groupId
artifactIdc3p0/artifactId
version0.9.0/version
/dependency
dependency

Re: persistence unit can not be found during test

2009-08-12 Thread Neo Anderson
Sorry I don't understand very well. Shouldn't maven pick up persistence.xml 
either specified in the src/main/resources/META-INF or 
src/test/resources/META-INF? Or what command I need spcify so that when 
executing `mvn test', maven will pick up persistence.xml that is copied to 
target/test-classes?

Thanks for your help.

I appreciate it.

--- On Wed, 12/8/09, Brian Fox bri...@infinity.nu wrote:

 From: Brian Fox bri...@infinity.nu
 Subject: Re: persistence unit can not be found during test
 To: Maven Users List users@maven.apache.org
 Date: Wednesday, 12 August, 2009, 7:44 PM
 your resources will be copied to
 /target/test-classes/ so use that, or
 better, load it from the classpath, then you aren't path
 dependent.
 
 On Wed, Aug 12, 2009 at 3:19 PM, Neo
 Andersonjavadeveloper...@yahoo.co.uk
 wrote:
  I encouter a problem when running maven test + jpa +
 mysql. The report result always shows that `No Persistence
 provider for EntityManager named jpa' (where jpa is the
 persistent-unit name specified in the persistence.xml under
 src/main/resources/META-INF). It looks like the test (e.g.
 mvn test) can not find the persistence.xml file; however, a
 tutorial I found out on the internet - 
 http://www.stripesbook.com/blog/index.php?/archives/34-Java-Persistence-Maven-2,-JPA,-and-Hibernate-Quickstart.html,
 its source code structure is similar to mine and its test
 can be executed without a problem.
 
  Where should I specify the persistence.xml path so
 that the mvn test will pick up the persistence unit (I try
 specify persistence.xml in test/resources/META-INF folder it
 doesn't work as well)? Or where should I check that might
 cause such problem?
 
  I appreciate any help.
 
  env: debian kernel 2.6.30-1/ java 1.6.0_10/ maven
 2.0.9
 
  exception:
 
  Caused by: javax.persistence.PersistenceException: No
 Persistence provider for EntityManager named jpa
         at
 javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
         at
 javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
         at
 exmample.domain.PersistenceProvider.clinit(PersistenceProvider.java:35)
         ... 63 more
 
 
  PersistenceProvider.java
 
  public class PersistenceProvider{
 
         public static final String
 PERSISTENCE_UNIT_NAME = jpa;
         private static EntityManagerFactory
 factory;
 
         static {
                 try {
                         factory =
 Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
                 }catch(Throwable t) {
                         throw new
 ExceptionInInitializerError(t);
                 }
         }
 
         public static EntityManagerFactory
 createPersistenceFactory() {
                 return factory;
         }
 
         public static void close() {
                 if(null == factory)
                         throw new
 NullPointerException(No EntityManagerFactory available!);
                 factory.close();
         }
  }
 
  persistence.xml
 
  persistence xmlns=http://java.sun.com/xml/ns/persistence;
   xmlns:xsi=http://www.23.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/ns/persistence
   http://java.sun.com/ns/persistence/persistence_1_0.xsd;
   version=1.0
     persistence-unit name=jpa
       
  providerorg.hibernate.ejb.HibernatePersistence/provider
 
         properties
             property
 name=hibernate.archive.autodetection
                       value=class,
 hbm/
 
             property
 name=hibernate.show_sql value=true/
             property
 name=hibernate.format_sql value=true/
 
             property
 name=hibernate.dialect
                     
  value=org.hibernate.dialect.MySQLDialect/
             property
 name=hibernate.connection.driver_class
                     
  value=com.mysql.jdbc.Driver/
             property
 name=hibernate.connection.url
                     
  value=jdbc:mysql://localhost/demo/
 
             property
 name=hibernate.connection.username value=root/
             property
 name=hibernate.connection.password value=*/
             !--property
 name=hibernate.hbm2ddl.auto value=create/--
         /properties
     /persistence-unit
  /persistence
 
  pom.xml
 
         dependencies
 
         !-- bsh --
         dependency
               
  groupIdorg.beanshell/groupId
               
  artifactIdbsh/artifactId
               
  version2.0b4/version
         /dependency
 
         !-- aspectj --
         dependency
               
  groupIdaspectj/groupId
               
  artifactIdaspectjrt/artifactId
               
  version1.5.4/version
         /dependency
 
         !-- tapestry --
         dependency
               
  groupIdorg.apache.tapestry/groupId
               
  artifactIdtapestry-core/artifactId
               
  version${tapestry-release-version}/version
         /dependency
         dependency
               
  groupIdorg.apache.tapestry/groupId
               
  

RE: persistence unit can not be found during test

2009-08-12 Thread Neo Anderson
Thanks for the reply. I think now I figure out what goes wrong. The exception 
reported by the surefire is a red herring. It is indeed related to the 
dependency matrix issue. 

Orginally my hibernate entity-manager is 3.4.0 and hibernate-annotations is 
3.2.1 (I can not remember exactly its version). That would not work due to 
compatibility issue. Hibernate page has a compatibility matrix at 
https://www.hibernate.org/6.html#A3. So I change to use the following 
configuration that solves part of problems. 

dependency
groupIdorg.hibernate/groupId
artifactIdhibernate-annotations/artifactId
version3.3.1.GA/version
/dependency 
dependency
groupIdorg.hibernate/groupId
artifactIdhibernate-entitymanager/artifactId
version3.3.2.GA/version
/dependency

Also, it requires to add classpkg.pathto.ClassName/class  in 
persistence.xml.

persistence-unit name=persistenceUnitName
providerorg.hibernate.ejb.HibernatePersistence/provider
classpkg.pathto.ClassName/class!-- here --
properties
...
/properties
/persistence-unit

So that it will scan the class which would prevent error like

Caused by: java.lang.IllegalArgumentException: Unknown entity: 
pkg.pathto.ClassName

Thanks all your help.

I really appreciate it. 



--- On Wed, 12/8/09, Martin Gainty mgai...@hotmail.com wrote:

 From: Martin Gainty mgai...@hotmail.com
 Subject: RE: persistence unit can not be found during test
 To: users@maven.apache.org
 Date: Wednesday, 12 August, 2009, 8:33 PM
 
 why not use 
 oracle-toplink such as this example from
 /src/conf/persistence.xml
 
 persistence
   persistence-unit name=someDefinableName
 transaction-type=JTA 
    provideroracle.toplink.essentials.PersistenceProvider/provider
    /persistence-unit
   /persistence
  
 jta-data-sourcejdbc/someDefinableName/jta-data-source
  
 mapping-filesomeORMap.xml/mapping-file
   jar-fileentities/Jar.jar/jar-file
 
 classejbinaction.persistence.Category/class
  classejbinaction.persistence.Bid/class
  properties
    property
 name=toplink.ddl-generation
 value=drop-and-create-tables/
   /properties
 /persistence-unit
 /persistence
 http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html
 
 complete hibernate provider example is located at
 http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html
 
 anyone hear of a persistence provider named jpa?
 Martin Gainty 
 __ 
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de
 confidentialité
  
 Diese Nachricht ist vertraulich. Sollten Sie nicht der
 vorgesehene Empfaenger sein, so bitten wir hoeflich um eine
 Mitteilung. Jede unbefugte Weiterleitung oder Fertigung
 einer Kopie ist unzulaessig. Diese Nachricht dient lediglich
 dem Austausch von Informationen und entfaltet keine
 rechtliche Bindungswirkung. Aufgrund der leichten
 Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer
 den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si
 vous n'êtes pas le destinataire prévu, nous te demandons
 avec bonté que pour satisfaire informez l'expéditeur.
 N'importe quelle diffusion non autorisée ou la copie de
 ceci est interdite. Ce message sert à l'information
 seulement et n'aura pas n'importe quel effet légalement
 obligatoire. Étant donné que les email peuvent facilement
 être sujets à la manipulation, nous ne pouvons accepter
 aucune responsabilité pour le contenu fourni.
 
 
 
 
  Date: Wed, 12 Aug 2009 19:19:27 +
  From: javadeveloper...@yahoo.co.uk
  Subject: persistence unit can not be found during
 test
  To: users@maven.apache.org
  
  I encouter a problem when running maven test + jpa +
 mysql. The report result always shows that `No Persistence
 provider for EntityManager named jpa' (where jpa is the
 persistent-unit name specified in the persistence.xml under
 src/main/resources/META-INF). It looks like the test (e.g.
 mvn test) can not find the persistence.xml file; however, a
 tutorial I found out on the internet - 
 http://www.stripesbook.com/blog/index.php?/archives/34-Java-Persistence-Maven-2,-JPA,-and-Hibernate-Quickstart.html,
 its source code structure is similar to mine and its test
 can be executed without a problem. 
  
  Where should I specify the persistence.xml path so
 that the mvn test will pick up the persistence unit (I try
 specify persistence.xml in test/resources/META-INF folder it
 doesn't work as well)? Or where should I check that might
 cause such problem?
  
  I appreciate any help.
  
  env: debian kernel 2.6.30-1/ java 1.6.0_10/ maven
 2.0.9
  
  exception:
  
  Caused by: javax.persistence.PersistenceException: No
 Persistence provider for EntityManager named jpa
      at
 javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
      at
 

classpath question

2008-12-28 Thread Neo Anderson
I am build a project and that looks ok at the moment. However I encounter a 
problem when running test. 

My problem is that I have a customized xml. So I build a test located in the 
test/project/name/to/xmlTest.java, in which it will load an xml file to have  a 
small test. The xml file is located at reousrces/project/name/to/file.xml. 
Unfortunately, when executing the test (via mvn package), it seems the default 
classpath would be the place where pom.xml exists. Therefore, if in the 
xmlTest.java I specify xml path like

parser.parse(project/name/to/file.xml);

The maven throws Running project.name.xmlTest
java.io.FileNotFoundException: $HOME/path/to/pom.xml/project/name/to/file.xml 
(No such file or directory)

I read the doc - 
http://maven.apache.org/plugins/maven-surefire-plugin/examples/additional-classpath.html;
 seemingly I can add additional classpath whilst running test. But no luck, it 
still looks up the default one. 

I am able to specify the exactly path to solve the problem. 
For instance, 

parser.parse(src/parent_name/project/name/to/file.xml); 

where src/parent_name is the structure folder that will only be used when 
writing programme. But this is not what I want because I think that classpath 
should be configurable.

Is any way I can configure to specify the classpath in pom.xml?

Thanks in advice,














-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: build ear problem

2008-04-21 Thread neo anderson

I change to use different groupId - ejb for net.sf.middleware and web for
net.sf.web; but the problem still remains. From the context looks like it is
looking for the remote repository 

[code]
Downloading:
http://repo1.maven.org/maven2/net/sf/sample/middleware/sample-middle/0.1/sample-middle-0.1.pom
Downloading:
http://repo1.maven.org/maven2/net/sf/sample/middleware/sample-middle/0.1/sample-middle-0.1.jar
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

Missing:
--
1) net.sf.sample.middleware:sample-middle:ejb:0.1
...
[/code]

How can I use the local one (where target folder existed) instead of
downloading from remote repository?

Thanks in advice.


VUB Stefan Seidel wrote:
 
 You have the same group and artifact id for your ejb and your war file. 
 This cannot work, because the one will overwrite the other.
 
 Stefan
 
 neo anderson wrote:
 Env: jboss 4.2.2GA/ Debian lenny testing/ jdk 1.6.0_01/maven 2.0.7
 
 I try to create an ear  file via maven, but it issues error reporting
 that
 it requires to download sub porjects (web and ejb, etc.) first. The
 message
 is as below. It looks like repository problem. Though I can download it
 manually, I prefer to get it done automatically because last time I
 create
 ear file maven successfully except the target application server is
 geronimo, not jboss (but i can't remember exactly what i did to get it
 work). So hope someone can give me advice.
 
 [code]
 ...
 [INFO]
 
 Downloading:
 http://repo1.maven.org/maven2/net/sf/sample/sample-web/0.1/sample-web-0.1.jar
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Failed to resolve artifact.
 
 Missing:
 --
 1) net.sf.sample:sample-web:ejb:0.1
 
   Try downloading the file manually from the project website.
 ...
 [/code]
 
 The way how I create ear project is through executing command 'mvn
 arcetype:create -DgropuId=net.sf.sample -DartifactId=sample -Dversion1.0'
 
 Then modifing the pom.xml (in ear folder)
 [code]
 ?xml version=1.0?
 project
  modelVersion4.0.0/modelVersion
  parent
  artifactIdsample/artifactId
  groupIdnet.sf.sample/groupId
  version0.1/version
  /parent
  artifactIdsample-ear/artifactId
  namesample-ear/name
  packagingear/packaging
  version0.1/version
  urlhttp://maven.apache.org/url
  dependencies
  dependency
  groupIdjunit/groupId
  artifactIdjunit/artifactId
  version3.8.1/version
  scopetest/scope
  /dependency
  dependency
  groupIdnet.sample/groupId
  artifactIdsample-web/artifactId
  version0.1/version
  typewar/type
  /dependency
  dependency
  groupIdnet.sample/groupId   
  artifactIdsample-web/artifactId
  version0.1/version
  typeejb/type
  /dependency
  /dependencies
  build
  plugins
  plugin
  artifactIdmaven-ear-plugin/artifactId
  configuration
  displayNameSample 
 Project/displayName
  descriptionSample EAR 
 artifact/description
  version5/version
  modules
  ejbModule
  
 groupIdnet.sf.sample/groupId
  
 artifactIdsample-middleware/artifactId
  
 bundleFileNamesample-middleware-0.1.jar/bundleFileName
  /ejbModule
  webModule
  
 groupIdnet.sf.sample/groupId
  
 artifactIdsample-web/artifactId
  
 bundleFileNamesample-web-0.1.jar/bundleFileName
  /webModule
  /modules
  /configuration
  /plugin
  /plugins
  /build
 project
 [/code]
 
 I can build ejb3 and web sub-projects successfully (execute 'mvn package'
 command and they work in jboss env). 
 
 What part I may miss in ear

build ear problem

2008-04-20 Thread neo anderson

Env: jboss 4.2.2GA/ Debian lenny testing/ jdk 1.6.0_01/maven 2.0.7

I try to create an ear  file via maven, but it issues error reporting that
it requires to download sub porjects (web and ejb, etc.) first. The message
is as below. It looks like repository problem. Though I can download it
manually, I prefer to get it done automatically because last time I create
ear file maven successfully except the target application server is
geronimo, not jboss (but i can't remember exactly what i did to get it
work). So hope someone can give me advice.

[code]
...
[INFO]

Downloading:
http://repo1.maven.org/maven2/net/sf/sample/sample-web/0.1/sample-web-0.1.jar
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Failed to resolve artifact.

Missing:
--
1) net.sf.sample:sample-web:ejb:0.1

  Try downloading the file manually from the project website.
...
[/code]

The way how I create ear project is through executing command 'mvn
arcetype:create -DgropuId=net.sf.sample -DartifactId=sample -Dversion1.0'

Then modifing the pom.xml (in ear folder)
[code]
?xml version=1.0?
project
modelVersion4.0.0/modelVersion
parent
artifactIdsample/artifactId
groupIdnet.sf.sample/groupId
version0.1/version
/parent
artifactIdsample-ear/artifactId
namesample-ear/name
packagingear/packaging
version0.1/version
urlhttp://maven.apache.org/url
dependencies
dependency
groupIdjunit/groupId
artifactIdjunit/artifactId
version3.8.1/version
scopetest/scope
/dependency
dependency
groupIdnet.sample/groupId
artifactIdsample-web/artifactId
version0.1/version
typewar/type
/dependency
dependency
groupIdnet.sample/groupId   
artifactIdsample-web/artifactId
version0.1/version
typeejb/type
/dependency
/dependencies
build
plugins
plugin
artifactIdmaven-ear-plugin/artifactId
configuration
displayNameSample 
Project/displayName
descriptionSample EAR 
artifact/description
version5/version
modules
ejbModule

groupIdnet.sf.sample/groupId

artifactIdsample-middleware/artifactId

bundleFileNamesample-middleware-0.1.jar/bundleFileName
/ejbModule
webModule

groupIdnet.sf.sample/groupId

artifactIdsample-web/artifactId

bundleFileNamesample-web-0.1.jar/bundleFileName
/webModule
/modules
/configuration
/plugin
/plugins
/build
project
[/code]

I can build ejb3 and web sub-projects successfully (execute 'mvn package'
command and they work in jboss env). 

What part I may miss in ear pom.xml file? 

Thank you very much.

-- 
View this message in context: 
http://www.nabble.com/build-ear-problem-tp16791088s177p16791088.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ejb3 jboss persistence problem

2008-04-12 Thread neo anderson

Previously I successfully build ejb3 example with jboss version 4.2.2 by
specifying jboss library in the 'systempath'. Now I want to make use of the
maven (jboss) repository. So I change to use the dependency section of
pom.xml, modifying repository and dependency section; it is as follow:

repositories
repository
idjboss-maven2/id
urlhttp://repository.jboss.com/url
/repository
/repositories

...
dependency
groupIdjboss/groupId
artifactIdjboss-persistence-api/artifactId
version3.0.0-SNAPSHOT/version
/dependency
dependency
groupIdjboss/groupId
artifactIdjboss-ejb-api/artifactId
version4.2.0.GA/version
/dependency


But maven returns message like

Missing:
--
1) jboss:jboss-persistence-api:jar:3.0.0-SNAPSHOT

  Try downloading the file manually from the project website.


I am able to to see the jar file located in the
http://repository.jboss.com/jboss/jboss-persistence-api/ (The dependency for
jboss-ejb-api works fine.) How to solve this error without downing/
installing the jar manually?

Thanks for help,
-- 
View this message in context: 
http://www.nabble.com/ejb3-jboss-persistence-problem-tp16653034s177p16653034.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



apt-get repository

2008-03-28 Thread neo anderson

I have one question. Does any maven command or plugin support serach and add
dependency automatically (a bit like Debian apt-get)? For instance, I use
archetype to create an ejb project. Then I want to use jboss as my ejb
container. So I need to add a lot of dependencies. Is there any command or
plugin like 'mvn dependency:search-jboss'/ 'mvn dependency:add-jboss'
enabling mvn to automatically accomplish the dependencies section? Though
those dependencies can be added manually by editing the pom.xml, it is a bit
tedious step and easily to mistype the wrong characters. Or is there any
better way to accomplish such task? 

Thank you very much, 
-- 
View this message in context: 
http://www.nabble.com/apt-get-repository-tp16348997s177p16348997.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: provided dependency packaged into war

2008-03-20 Thread neo anderson

How to include library into war file? 

First I create web project skeleton by 

mvn archetype:create -DgroupId=net.sf.sample -DartifactId=wicket-hello
-Dversion=1.0 -DarchetypeArtifactId=maven-archetype-webapps


Then I modify pom.xml to include the dependency.

dependency
  groupIdorg.apache.wicket/groupId
  artifactIdwicket/artifactId
  version1.3.2/version
  scopeprovided/scope
  !--scopesystem/scope
  systemPath${basedir}/lib/wicket-1.3.2.jar/systemPath--
/dependency

However, I set scope to either provided or system. None of them will make
the library (i.e., wicket-1.3.2.jar) included into the war. 

What should I do in order to include jar file included in the WEB-INF/lib
directory?

Thanks in advice,

-- 
View this message in context: 
http://www.nabble.com/provided-dependency-packaged-into-war-tp8713555s177p16192173.html
Sent from the Maven - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



javax.naming.CommunicationException: Receive timed out problem

2008-03-03 Thread Neo Anderson
Hi

I am new to maven. And by following 
http://openejb.apache.org/3.0/simple-stateless-example.html I write a simple 
stateless session bean (ejb3) to test the jboss and maven,but encounter a 
problem. The error issues 

testHelloRemote(net.sf.sample.HelloTest)  Time elapsed: 5.06 sec   ERROR!
javax.naming.CommunicationException: Receive timed out [Root exception is 
java.net.SocketTimeoutException: Receive timed out]

The way how I test is 

1.) create ejb module
mvn archetype:create -DgroupId=net.sf.sample -DartifactId=hello -Dversion=1.0 

2.) modify pom.xml (adding dependency to pom.xml and 1.5 compatible)
build
pluginManagement
plugins
plugin
artifactIdmaven-compiler-plugin/artifactId
configuration
source1.5/source
target1.5/target
/configuration
/plugin
/plugins
/pluginManagement
/build
...
dependency
groupIdjboss/groupId
artifactIdjboss-ejb3x/artifactId
version4.0.3/version
scopesystem/scope
systemPath${basedir}\lib\jboss-ejb3x.jar/systemPath
/dependency
dependency
groupIdjboss/groupId
artifactIdjnpserver/artifactId
version1.0/version
scopesystem/scope
systemPath${basedir}\lib\jnpserver.jar/systemPath
/dependency
dependency
groupIdjboss/groupId
artifactIdjboss-common/artifactId
version1.0/version
scopesystem/scope
systemPath${basedir}\lib\jboss-common.jar/systemPath
/dependency

3.)  write stateless session bean

package net.sf.sample;

import javax.ejb.Stateless;

@Stateless
public class Hello implements HelloLocal, HelloRemote{
public String echo(){
return hello\n;
}

package net.sf.sample;

import javax.ejb.Local;

@Local
public interface HelloLocal{
public String echo();
}

package net.sf.sample;

import javax.ejb.Remote;

@Remote
public interface HelloRemote{
public String echo();


4.) run mvn command

mvn clean install

What might cause this problem?

Thank you very much,

env: jboss4.2.2.GA/ maven 2.0.8 / jdk1.6.0_04






  __
Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: javax.naming.CommunicationException: Receive timed out problem

2008-03-03 Thread Neo Anderson
Thanks your reply. Finally I solved the problem. The problem comes from the 
wrong way to setup initial context. The correct way to do that is by (in my 
test case, e.g., HelloTest)

protected void setUp() throws Exception{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, 
org.jnp.interfaces.NamingContextFactory);
env.put(Context.PROVIDER_URL, localhost);
env.put(Context.URL_PKG_PREFIXES, org.jboss.naming:org.jnp.interfaces 
);
initialContext = new InitialContext(env);
}

However, I encounter a new question. I use test case to call my ejb application 
(stateless session bean). Thus I found out when executing command 'mvn clean 
install,'  it will do test first, resulting failure because  the ejb artifact 
is still not yet deployed to the server. How can deploy to and launch the 
server first before the test case executed. 

Thanks in advice.

- Original Message 
From: VUB Stefan Seidel [EMAIL PROTECTED]
To: Maven Users List users@maven.apache.org
Sent: Monday, 3 March, 2008 9:49:25 PM
Subject: Re: javax.naming.CommunicationException: Receive timed out problem

Hi,

this is most likely not a maven problem. It seems your test tries to 
connect to a remote JBoss instance but cannot contact it (not deployed?).

regards,

Stefan

Neo Anderson wrote:
 Hi
 
 I am new to maven. And by following 
 http://openejb.apache.org/3.0/simple-stateless-example.html I write a simple 
 stateless session bean (ejb3) to test the jboss and maven,but encounter a 
 problem. The error issues 
 
 testHelloRemote(net.sf.sample.HelloTest)  Time elapsed: 5.06 sec   ERROR!
 javax.naming.CommunicationException: Receive timed out [Root exception is 
 java.net.SocketTimeoutException: Receive timed out]
 
 The way how I test is 
 
 1.) create ejb module
 mvn archetype:create -DgroupId=net.sf.sample -DartifactId=hello -Dversion=1.0 
 
 2.) modify pom.xml (adding dependency to pom.xml and 1.5 compatible)
 build
 pluginManagement
 plugins
 plugin
 artifactIdmaven-compiler-plugin/artifactId
 configuration
 source1.5/source
 target1.5/target
 /configuration
 /plugin
 /plugins
 /pluginManagement
 /build
 ...
 dependency
 groupIdjboss/groupId
 artifactIdjboss-ejb3x/artifactId
 version4.0.3/version
 scopesystem/scope
 systemPath${basedir}\lib\jboss-ejb3x.jar/systemPath
 /dependency
 dependency
 groupIdjboss/groupId
 artifactIdjnpserver/artifactId
 version1.0/version
 scopesystem/scope
 systemPath${basedir}\lib\jnpserver.jar/systemPath
 /dependency
 dependency
 groupIdjboss/groupId
 artifactIdjboss-common/artifactId
 version1.0/version
 scopesystem/scope
 systemPath${basedir}\lib\jboss-common.jar/systemPath
 /dependency
 
 3.)  write stateless session bean
 
 package net.sf.sample;
 
 import javax.ejb.Stateless;
 
 @Stateless
 public class Hello implements HelloLocal, HelloRemote{
 public String echo(){
 return hello\n;
 }
 
 package net.sf.sample;
 
 import javax.ejb.Local;
 
 @Local
 public interface HelloLocal{
 public String echo();
 }
 
 package net.sf.sample;
 
 import javax.ejb.Remote;
 
 @Remote
 public interface HelloRemote{
 public String echo();
 
 
 4.) run mvn command
 
 mvn clean install
 
 What might cause this problem?
 
 Thank you very much,
 
 env: jboss4.2.2.GA/ maven 2.0.8 / jdk1.6.0_04
 
 
 
 
 
 
   __
 Sent from Yahoo! Mail.
 A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
best regards,

Stefan Seidel
software developer

VUB Printmedia GmbH
Chopinstraße 4
D-04103 Leipzig
Germany
tel.+49 (341) 9 60 50 07
fax.+49 (341) 9 60 50 92
mail.   [EMAIL PROTECTED]
web.www.vub.de

HRB Köln 24015
UStID DE 122 649 251
GF Dr. Achim Preuss Neudorf,
Dr. Christian Preuss Neudorf

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  ___ 
Rise to the challenge for Sport Relief with Yahoo! For Good  

http://uk.promotions.yahoo.com/forgood/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The plugin 'org.apache.maven.plugins:maven-jetty-plugin' does not exist

2008-02-28 Thread Neo Anderson
I follow the http://appfuse.org/display/APF/AppFuse+QuickStart to practise to 
use the maven.

 Then I encounter a problem saying 'The plugin 
'org.apache.maven.plugins:maven-jetty-plugin' does not exist' when issuing 
command 'maven jetty:run-war'

I checked the archive - http://www.mail-archive.com/[EMAIL 
PROTECTED]/msg02587.html, but it seems no use. Either issuing command mvn -U or 
mvn -cpu does not help to run the jetty. How can I install this plugin?

Thank you very much.








  __
Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]